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
56
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 33

def initialize(params = {})
    @on_match_action = params.dig(:on_match_action)
    @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

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def address1
  @address1
end

#address2String

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def address2
  @address2
end

#address3String

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def address3
  @address3
end

#cityString

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def city
  @city
end

#company_erp_keyString

Returns The original primary key or unique ID of the company to which this contact belongs. This value should match the [Company ErpKey](developer.lockstep.io/docs/importing-companies#erpkey) field on the [CompanySyncModel](developer.lockstep.io/docs/importing-companies).

Returns:



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

def company_erp_key
  @company_erp_key
end

#contact_codeString

Returns A friendly human-readable code that describes this Contact.

Returns:

  • (String)

    A friendly human-readable code that describes this Contact.



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

def contact_code
  @contact_code
end

#contact_nameString

Returns The name of the contact.

Returns:

  • (String)

    The name of the contact.



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

def contact_name
  @contact_name
end

#country_codeString

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def country_code
  @country_code
end

#createdDate-time

Returns If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.



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

def created
  @created
end

#email_addressString

Returns The email address of the contact.

Returns:

  • (String)

    The email address of the contact.



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

def email_address
  @email_address
end

#erp_keyString

Returns This is the primary key of the Contact record. For this field, you should use whatever the contact’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your contact records in a database, whatever the primary key for the contact table is in the database should be the “ErpKey”. As some ERP systems don’t maintain a unique key for Contacts, we also support syncing Contacts with ERP keys of the form prefix|index, for example ContactPrefix|1, ContactPrefix|2 and so on. For this reason, please ensure that your Contact ERP keys don’t otherwise contain the ‘|’ symbol or that it is replaced by an alternate symbol if they do. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    This is the primary key of the Contact record. For this field, you should use whatever the contact’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your contact records in a database, whatever the primary key for the contact table is in the database should be the “ErpKey”. As some ERP systems don’t maintain a unique key for Contacts, we also support syncing Contacts with ERP keys of the form prefix|index, for example ContactPrefix|1, ContactPrefix|2 and so on. For this reason, please ensure that your Contact ERP keys don’t otherwise contain the ‘|’ symbol or that it is replaced by an alternate symbol if they do. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



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

def erp_key
  @erp_key
end

#faxString

Returns The fax number of the contact.

Returns:

  • (String)

    The fax number of the contact.



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

def fax
  @fax
end

#is_activeBoolean

Returns True if this contact is considered “active”.

Returns:

  • (Boolean)

    True if this contact is considered “active”.



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

def is_active
  @is_active
end

#modifiedDate-time

Returns If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.



144
145
146
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 144

def modified
  @modified
end

#on_match_actionMatchAction

Returns Indicates what action to take when an existing object has been found during the sync process.

Returns:

  • (MatchAction)

    Indicates what action to take when an existing object has been found during the sync process.



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

def on_match_action
  @on_match_action
end

#phoneString

Returns The phone number of the contact.

Returns:

  • (String)

    The phone number of the contact.



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

def phone
  @phone
end

#picture_urlString

Returns If available, the URL of a photograph that shows this contact.

Returns:

  • (String)

    If available, the URL of a photograph that shows this contact.



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

def picture_url
  @picture_url
end

#postal_codeString

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def postal_code
  @postal_code
end

#role_codeString

Returns The role code for the contact.

Returns:

  • (String)

    The role code for the contact.



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

def role_code
  @role_code
end

#state_regionString

Returns The mailing address information for this contact.

Returns:

  • (String)

    The mailing address information for this contact.



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

def state_region
  @state_region
end

#titleString

Returns The title of the contact.

Returns:

  • (String)

    The title of the contact.



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

def title
  @title
end

#webpage_urlString

Returns A webpage URL for more information about this contact.

Returns:

  • (String)

    A webpage URL for more information about this contact.



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

def webpage_url
  @webpage_url
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 148

def as_json(options={})
    {
        'onMatchAction' => @on_match_action,
        '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

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



177
178
179
# File 'lib/lockstep_sdk/models/contact_sync_model.rb', line 177

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