Class: LockstepSdk::CompanyModel

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

Overview

A Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.

See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CompanyModel

Initialize the CompanyModel using the provided prototype



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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/lockstep_sdk/models/company_model.rb', line 29

def initialize(params = {})
    @company_id = params.dig(:company_id)
    @company_name = params.dig(:company_name)
    @erp_key = params.dig(:erp_key)
    @company_type = params.dig(:company_type)
    @parent_company_id = params.dig(:parent_company_id)
    @enterprise_id = params.dig(:enterprise_id)
    @group_key = params.dig(:group_key)
    @is_active = params.dig(:is_active)
    @default_currency_code = params.dig(:default_currency_code)
    @company_logo_url = params.dig(:company_logo_url)
    @primary_contact_id = params.dig(:primary_contact_id)
    @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 = params.dig(:country)
    @time_zone = params.dig(:time_zone)
    @phone_number = params.dig(:phone_number)
    @fax_number = params.dig(:fax_number)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @modified_user_name = params.dig(:modified_user_name)
    @tax_id = params.dig(:tax_id)
    @duns_number = params.dig(:duns_number)
    @ap_email_address = params.dig(:ap_email_address)
    @ar_email_address = params.dig(:ar_email_address)
    @preferred_delivery_method = params.dig(:preferred_delivery_method)
    @domain_name = params.dig(:domain_name)
    @company_classification_code_def_id = params.dig(:company_classification_code_def_id)
    @description = params.dig(:description)
    @website = params.dig(:website)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @email_address = params.dig(:email_address)
    @public_url_slug = params.dig(:public_url_slug)
    @view_box_settings = params.dig(:view_box_settings)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
    @contacts = params.dig(:contacts)
    @invoices = params.dig(:invoices)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
    @company_classification_code_definition = params.dig(:company_classification_code_definition)
end

Instance Attribute Details

#address1String



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

def address1
  @address1
end

#address2String



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

def address2
  @address2
end

#address3String



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

def address3
  @address3
end

#ap_email_addressEmail



192
193
194
# File 'lib/lockstep_sdk/models/company_model.rb', line 192

def ap_email_address
  @ap_email_address
end

#app_enrollment_idUuid



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

def app_enrollment_id
  @app_enrollment_id
end

#ar_email_addressEmail



196
197
198
# File 'lib/lockstep_sdk/models/company_model.rb', line 196

def ar_email_address
  @ar_email_address
end

#attachmentsAttachmentModel



240
241
242
# File 'lib/lockstep_sdk/models/company_model.rb', line 240

def attachments
  @attachments
end

#cityString



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

def city
  @city
end

#company_classification_code_def_idUuid



208
209
210
# File 'lib/lockstep_sdk/models/company_model.rb', line 208

def company_classification_code_def_id
  @company_classification_code_def_id
end

#company_classification_code_definitionCodeDefinitionModel



260
261
262
# File 'lib/lockstep_sdk/models/company_model.rb', line 260

def company_classification_code_definition
  @company_classification_code_definition
end

#company_idUuid



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

def company_id
  @company_id
end

#company_logo_urlString



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

def company_logo_url
  @company_logo_url
end

#company_nameString



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

def company_name
  @company_name
end

#company_typeString



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

def company_type
  @company_type
end

#contactsContactModel



244
245
246
# File 'lib/lockstep_sdk/models/company_model.rb', line 244

def contacts
  @contacts
end

#countryString



148
149
150
# File 'lib/lockstep_sdk/models/company_model.rb', line 148

def country
  @country
end

#createdDate-time



164
165
166
# File 'lib/lockstep_sdk/models/company_model.rb', line 164

def created
  @created
end

#created_user_idUuid



168
169
170
# File 'lib/lockstep_sdk/models/company_model.rb', line 168

def created_user_id
  @created_user_id
end

#custom_field_definitionsCustomFieldDefinitionModel



252
253
254
# File 'lib/lockstep_sdk/models/company_model.rb', line 252

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel



256
257
258
# File 'lib/lockstep_sdk/models/company_model.rb', line 256

def custom_field_values
  @custom_field_values
end

#default_currency_codeString



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

def default_currency_code
  @default_currency_code
end

#descriptionString



212
213
214
# File 'lib/lockstep_sdk/models/company_model.rb', line 212

def description
  @description
end

#domain_nameString



204
205
206
# File 'lib/lockstep_sdk/models/company_model.rb', line 204

def domain_name
  @domain_name
end

#duns_numberString



188
189
190
# File 'lib/lockstep_sdk/models/company_model.rb', line 188

def duns_number
  @duns_number
end

#email_addressEmail



224
225
226
# File 'lib/lockstep_sdk/models/company_model.rb', line 224

def email_address
  @email_address
end

#enterprise_idUuid



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

def enterprise_id
  @enterprise_id
end

#erp_keyString



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

def erp_key
  @erp_key
end

#fax_numberString



160
161
162
# File 'lib/lockstep_sdk/models/company_model.rb', line 160

def fax_number
  @fax_number
end

#group_keyUuid



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

def group_key
  @group_key
end

#invoicesObject



248
249
250
# File 'lib/lockstep_sdk/models/company_model.rb', line 248

def invoices
  @invoices
end

#is_activeBoolean



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

def is_active
  @is_active
end

#modifiedDate-time



172
173
174
# File 'lib/lockstep_sdk/models/company_model.rb', line 172

def modified
  @modified
end

#modified_user_idUuid



176
177
178
# File 'lib/lockstep_sdk/models/company_model.rb', line 176

def modified_user_id
  @modified_user_id
end

#modified_user_nameString



180
181
182
# File 'lib/lockstep_sdk/models/company_model.rb', line 180

def modified_user_name
  @modified_user_name
end

#notesNoteModel



236
237
238
# File 'lib/lockstep_sdk/models/company_model.rb', line 236

def notes
  @notes
end

#parent_company_idUuid



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

def parent_company_id
  @parent_company_id
end

#phone_numberString



156
157
158
# File 'lib/lockstep_sdk/models/company_model.rb', line 156

def phone_number
  @phone_number
end

#postal_codeString



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

def postal_code
  @postal_code
end

#preferred_delivery_methodString



200
201
202
# File 'lib/lockstep_sdk/models/company_model.rb', line 200

def preferred_delivery_method
  @preferred_delivery_method
end

#primary_contact_idUuid



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

def primary_contact_id
  @primary_contact_id
end

#public_url_slugString



228
229
230
# File 'lib/lockstep_sdk/models/company_model.rb', line 228

def public_url_slug
  @public_url_slug
end

#state_regionString



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

def state_region
  @state_region
end

#tax_idString



184
185
186
# File 'lib/lockstep_sdk/models/company_model.rb', line 184

def tax_id
  @tax_id
end

#time_zoneString



152
153
154
# File 'lib/lockstep_sdk/models/company_model.rb', line 152

def time_zone
  @time_zone
end

#view_box_settingsViewBoxSettingsModel



232
233
234
# File 'lib/lockstep_sdk/models/company_model.rb', line 232

def view_box_settings
  @view_box_settings
end

#websiteString



216
217
218
# File 'lib/lockstep_sdk/models/company_model.rb', line 216

def website
  @website
end

Instance Method Details

#as_json(options = {}) ⇒ object



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/lockstep_sdk/models/company_model.rb', line 264

def as_json(options={})
    {
        'companyId' => @company_id,
        'companyName' => @company_name,
        'erpKey' => @erp_key,
        'companyType' => @company_type,
        'parentCompanyId' => @parent_company_id,
        'enterpriseId' => @enterprise_id,
        'groupKey' => @group_key,
        'isActive' => @is_active,
        'defaultCurrencyCode' => @default_currency_code,
        'companyLogoUrl' => @company_logo_url,
        'primaryContactId' => @primary_contact_id,
        'address1' => @address1,
        'address2' => @address2,
        'address3' => @address3,
        'city' => @city,
        'stateRegion' => @state_region,
        'postalCode' => @postal_code,
        'country' => @country,
        'timeZone' => @time_zone,
        'phoneNumber' => @phone_number,
        'faxNumber' => @fax_number,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'modifiedUserName' => @modified_user_name,
        'taxId' => @tax_id,
        'dunsNumber' => @duns_number,
        'apEmailAddress' => @ap_email_address,
        'arEmailAddress' => @ar_email_address,
        'preferredDeliveryMethod' => @preferred_delivery_method,
        'domainName' => @domain_name,
        'companyClassificationCodeDefId' => @company_classification_code_def_id,
        'description' => @description,
        'website' => @website,
        'appEnrollmentId' => @app_enrollment_id,
        'emailAddress' => @email_address,
        'publicUrlSlug' => @public_url_slug,
        'viewBoxSettings' => @view_box_settings,
        'notes' => @notes,
        'attachments' => @attachments,
        'contacts' => @contacts,
        'invoices' => @invoices,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
        'companyClassificationCodeDefinition' => @company_classification_code_definition,
    }
end

#to_json(*options) ⇒ String



317
318
319
# File 'lib/lockstep_sdk/models/company_model.rb', line 317

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