Class: LockstepSdk::ContactSyncModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/contact_sync_model.rb

Overview

The ContactSyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. To import data from an external system, convert your original data into the ContactSyncModel format and call the [Upload Sync File API](developer.lockstep.io/reference/post_api-v1-sync-zip). This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep platform.

Once imported, this record will be available in the Lockstep API as a [ContactModel](developer.lockstep.io/docs/contactmodel).

For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ContactSyncModel

Initialize the ContactSyncModel using the provided prototype



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 33

def initialize(params = {})
    @erp_key = params.dig(:erp_key)
    @company_erp_key = params.dig(:company_erp_key)
    @contact_name = params.dig(:contact_name)
    @contact_code = params.dig(:contact_code)
    @title = params.dig(:title)
    @role_code = params.dig(:role_code)
    @email_address = params.dig(:email_address)
    @phone = params.dig(:phone)
    @fax = params.dig(:fax)
    @address1 = params.dig(:address1)
    @address2 = params.dig(:address2)
    @address3 = params.dig(:address3)
    @city = params.dig(:city)
    @state_region = params.dig(:state_region)
    @postal_code = params.dig(:postal_code)
    @country_code = params.dig(:country_code)
    @is_active = params.dig(:is_active)
    @webpage_url = params.dig(:webpage_url)
    @picture_url = params.dig(:picture_url)
    @created = params.dig(:created)
    @modified = params.dig(:modified)
end

Instance Attribute Details

#address1String



95
96
97
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 95

def address1
  @address1
end

#address2String



99
100
101
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 99

def address2
  @address2
end

#address3String



103
104
105
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 103

def address3
  @address3
end

#cityString



107
108
109
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 107

def city
  @city
end

#company_erp_keyString



63
64
65
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 63

def company_erp_key
  @company_erp_key
end

#contact_codeString



71
72
73
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 71

def contact_code
  @contact_code
end

#contact_nameString



67
68
69
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 67

def contact_name
  @contact_name
end

#country_codeString



119
120
121
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 119

def country_code
  @country_code
end

#createdDate-time



135
136
137
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 135

def created
  @created
end

#email_addressString



83
84
85
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 83

def email_address
  @email_address
end

#erp_keyString



59
60
61
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 59

def erp_key
  @erp_key
end

#faxString



91
92
93
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 91

def fax
  @fax
end

#is_activeBoolean



123
124
125
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 123

def is_active
  @is_active
end

#modifiedDate-time



139
140
141
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 139

def modified
  @modified
end

#phoneString



87
88
89
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 87

def phone
  @phone
end

#picture_urlString



131
132
133
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 131

def picture_url
  @picture_url
end

#postal_codeString



115
116
117
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 115

def postal_code
  @postal_code
end

#role_codeString



79
80
81
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 79

def role_code
  @role_code
end

#state_regionString



111
112
113
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 111

def state_region
  @state_region
end

#titleString



75
76
77
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 75

def title
  @title
end

#webpage_urlString



127
128
129
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 127

def webpage_url
  @webpage_url
end

Instance Method Details

#as_json(options = {}) ⇒ object



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 143

def as_json(options={})
    {
        'erpKey' => @erp_key,
        'companyErpKey' => @company_erp_key,
        'contactName' => @contact_name,
        'contactCode' => @contact_code,
        'title' => @title,
        'roleCode' => @role_code,
        'emailAddress' => @email_address,
        'phone' => @phone,
        'fax' => @fax,
        'address1' => @address1,
        'address2' => @address2,
        'address3' => @address3,
        'city' => @city,
        'stateRegion' => @state_region,
        'postalCode' => @postal_code,
        'countryCode' => @country_code,
        'isActive' => @is_active,
        'webpageUrl' => @webpage_url,
        'pictureUrl' => @picture_url,
        'created' => @created,
        'modified' => @modified,
    }
end

#to_json(*options) ⇒ String



171
172
173
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 171

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end