Class: LockstepSdk::ContactModel

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

Overview

A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ContactModel

Initialize the ContactModel using the provided prototype



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/lockstep_sdk/models/contact_model.rb', line 28

def initialize(params = {})
    @contact_id = params.dig(:contact_id)
    @company_id = params.dig(:company_id)
    @group_key = params.dig(:group_key)
    @erp_key = params.dig(: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)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
end

Instance Attribute Details

#address1String

Returns The first line of the address.

Returns:

  • (String)

    The first line of the address.



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

def address1
  @address1
end

#address2String

Returns The second line of the address.

Returns:

  • (String)

    The second line of the address.



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

def address2
  @address2
end

#address3String

Returns The third line of the address.

Returns:

  • (String)

    The third line of the address.



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

def address3
  @address3
end

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.



163
164
165
# File 'lib/lockstep_sdk/models/contact_model.rb', line 163

def app_enrollment_id
  @app_enrollment_id
end

#attachmentsAttachmentModel

Returns A collection of attachments linked to this record. To retrieve this collection, specify ‘Attachments` in the `include` parameter when retrieving data. To create an attachment, use the [Upload Attachment](developer.lockstep.io/reference/post_api-v1-attachments) endpoint with the `TableKey` to `Contact` and the `ObjectKey` set to the `ContactId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



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

def attachments
  @attachments
end

#cityString

Returns The city of the address.

Returns:

  • (String)

    The city of the address.



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

def city
  @city
end

#company_idUuid

Returns The ID of the company to which this contact belongs.

Returns:

  • (Uuid)

    The ID of the company to which this contact belongs.



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

def company_id
  @company_id
end

#contact_codeString

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

Returns:

  • (String)

    A friendly human-readable code that describes this Contact.



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

def contact_code
  @contact_code
end

#contact_idUuid

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.

Returns:

  • (Uuid)

    The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.



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

def contact_id
  @contact_id
end

#contact_nameString

Returns The name of the contact.

Returns:

  • (String)

    The name of the contact.



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

def contact_name
  @contact_name
end

#country_codeString

Returns The two character country code of the address. This will be validated by the /api/v1/definitions/countries data set.

Returns:

  • (String)

    The two character country code of the address. This will be validated by the /api/v1/definitions/countries data set



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

def country_code
  @country_code
end

#createdDate-time

Returns The date on which this record was created.

Returns:

  • (Date-time)

    The date on which this record was created.



147
148
149
# File 'lib/lockstep_sdk/models/contact_model.rb', line 147

def created
  @created
end

#created_user_idUuid

Returns The ID of the user who created this contact.

Returns:

  • (Uuid)

    The ID of the user who created this contact.



151
152
153
# File 'lib/lockstep_sdk/models/contact_model.rb', line 151

def created_user_id
  @created_user_id
end

#custom_field_definitionsCustomFieldDefinitionModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify ‘CustomFieldDefinitions` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Contact` and the `ObjectKey` set to the `ContactId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



175
176
177
# File 'lib/lockstep_sdk/models/contact_model.rb', line 175

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify ‘CustomFieldValues` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Contact` and the `ObjectKey` set to the `ContactId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



179
180
181
# File 'lib/lockstep_sdk/models/contact_model.rb', line 179

def custom_field_values
  @custom_field_values
end

#email_addressEmail

Returns The email address of the contact.

Returns:

  • (Email)

    The email address of the contact.



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

def email_address
  @email_address
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system. If this contact record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    The unique ID of this record as it was known in its originating financial system. If this contact record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



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

def erp_key
  @erp_key
end

#faxString

Returns The fax number of the contact.

Returns:

  • (String)

    The fax number of the contact.



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

def fax
  @fax
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



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

def group_key
  @group_key
end

#is_activeBoolean

Returns Flag indicating if the contact is active.

Returns:

  • (Boolean)

    Flag indicating if the contact is active.



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

def is_active
  @is_active
end

#modifiedDate-time

Returns The date on which this record was last modified.

Returns:

  • (Date-time)

    The date on which this record was last modified.



155
156
157
# File 'lib/lockstep_sdk/models/contact_model.rb', line 155

def modified
  @modified
end

#modified_user_idUuid

Returns The ID of the user who last modified this contact.

Returns:

  • (Uuid)

    The ID of the user who last modified this contact.



159
160
161
# File 'lib/lockstep_sdk/models/contact_model.rb', line 159

def modified_user_id
  @modified_user_id
end

#notesNoteModel

Returns A collection of notes linked to this record. To retrieve this collection, specify ‘Notes` in the `include` parameter when retrieving data. To create a note, use the [Create Note](developer.lockstep.io/reference/post_api-v1-notes) endpoint with the `TableKey` to `Contact` and the `ObjectKey` set to the `ContactId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



167
168
169
# File 'lib/lockstep_sdk/models/contact_model.rb', line 167

def notes
  @notes
end

#phoneString

Returns The phone number of the contact.

Returns:

  • (String)

    The phone number of the contact.



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

def phone
  @phone
end

#picture_urlUri

Returns The picture/avatar url of the contact.

Returns:

  • (Uri)

    The picture/avatar url of the contact.



143
144
145
# File 'lib/lockstep_sdk/models/contact_model.rb', line 143

def picture_url
  @picture_url
end

#postal_codeString

Returns The postal/zip code of the address.

Returns:

  • (String)

    The postal/zip code of the address.



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

def postal_code
  @postal_code
end

#role_codeString

Returns The role code for the contact.

Returns:

  • (String)

    The role code for the contact.



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

def role_code
  @role_code
end

#state_regionString

Returns The state/region of the address.

Returns:

  • (String)

    The state/region of the address.



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

def state_region
  @state_region
end

#titleString

Returns The title of the contact.

Returns:

  • (String)

    The title of the contact.



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

def title
  @title
end

#webpage_urlUri

Returns The webpage url of the contact.

Returns:

  • (Uri)

    The webpage url of the contact.



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

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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/lockstep_sdk/models/contact_model.rb', line 183

def as_json(options={})
    {
        'contactId' => @contact_id,
        'companyId' => @company_id,
        'groupKey' => @group_key,
        'erpKey' => @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,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'notes' => @notes,
        'attachments' => @attachments,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



220
221
222
# File 'lib/lockstep_sdk/models/contact_model.rb', line 220

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