Class: ConnectWise::Company

Inherits:
Object
  • Object
show all
Defined in:
lib/connectwise-ruby-sdk/models/company.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Company

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 284

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'identifier')
    self.identifier = attributes[:'identifier']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'type')
    self.type = attributes[:'type']
  end

  if attributes.has_key?(:'addressLine1')
    self.address_line1 = attributes[:'addressLine1']
  end

  if attributes.has_key?(:'addressLine2')
    self.address_line2 = attributes[:'addressLine2']
  end

  if attributes.has_key?(:'city')
    self.city = attributes[:'city']
  end

  if attributes.has_key?(:'state')
    self.state = attributes[:'state']
  end

  if attributes.has_key?(:'zip')
    self.zip = attributes[:'zip']
  end

  if attributes.has_key?(:'country')
    self.country = attributes[:'country']
  end

  if attributes.has_key?(:'phoneNumber')
    self.phone_number = attributes[:'phoneNumber']
  end

  if attributes.has_key?(:'faxNumber')
    self.fax_number = attributes[:'faxNumber']
  end

  if attributes.has_key?(:'website')
    self.website = attributes[:'website']
  end

  if attributes.has_key?(:'territoryId')
    self.territory_id = attributes[:'territoryId']
  end

  if attributes.has_key?(:'marketId')
    self.market_id = attributes[:'marketId']
  end

  if attributes.has_key?(:'accountNumber')
    self. = attributes[:'accountNumber']
  end

  if attributes.has_key?(:'defaultContact')
    self.default_contact = attributes[:'defaultContact']
  end

  if attributes.has_key?(:'dateAcquired')
    self.date_acquired = attributes[:'dateAcquired']
  end

  if attributes.has_key?(:'sicCode')
    self.sic_code = attributes[:'sicCode']
  end

  if attributes.has_key?(:'parentCompany')
    self.parent_company = attributes[:'parentCompany']
  end

  if attributes.has_key?(:'annualRevenue')
    self.annual_revenue = attributes[:'annualRevenue']
  end

  if attributes.has_key?(:'numberOfEmployees')
    self.number_of_employees = attributes[:'numberOfEmployees']
  end

  if attributes.has_key?(:'ownershipType')
    self.ownership_type = attributes[:'ownershipType']
  end

  if attributes.has_key?(:'timeZone')
    self.time_zone = attributes[:'timeZone']
  end

  if attributes.has_key?(:'leadSource')
    self.lead_source = attributes[:'leadSource']
  end

  if attributes.has_key?(:'leadFlag')
    self.lead_flag = attributes[:'leadFlag']
  end

  if attributes.has_key?(:'unsubscribeFlag')
    self.unsubscribe_flag = attributes[:'unsubscribeFlag']
  end

  if attributes.has_key?(:'calendarId')
    self.calendar_id = attributes[:'calendarId']
  end

  if attributes.has_key?(:'userDefinedField1')
    self.user_defined_field1 = attributes[:'userDefinedField1']
  end

  if attributes.has_key?(:'userDefinedField2')
    self.user_defined_field2 = attributes[:'userDefinedField2']
  end

  if attributes.has_key?(:'userDefinedField3')
    self.user_defined_field3 = attributes[:'userDefinedField3']
  end

  if attributes.has_key?(:'userDefinedField4')
    self.user_defined_field4 = attributes[:'userDefinedField4']
  end

  if attributes.has_key?(:'userDefinedField5')
    self.user_defined_field5 = attributes[:'userDefinedField5']
  end

  if attributes.has_key?(:'userDefinedField6')
    self.user_defined_field6 = attributes[:'userDefinedField6']
  end

  if attributes.has_key?(:'userDefinedField7')
    self.user_defined_field7 = attributes[:'userDefinedField7']
  end

  if attributes.has_key?(:'userDefinedField8')
    self.user_defined_field8 = attributes[:'userDefinedField8']
  end

  if attributes.has_key?(:'userDefinedField9')
    self.user_defined_field9 = attributes[:'userDefinedField9']
  end

  if attributes.has_key?(:'userDefinedField10')
    self.user_defined_field10 = attributes[:'userDefinedField10']
  end

  if attributes.has_key?(:'vendorIdentifier')
    self.vendor_identifier = attributes[:'vendorIdentifier']
  end

  if attributes.has_key?(:'taxIdentifier')
    self.tax_identifier = attributes[:'taxIdentifier']
  end

  if attributes.has_key?(:'taxCode')
    self.tax_code = attributes[:'taxCode']
  end

  if attributes.has_key?(:'billingTerms')
    self.billing_terms = attributes[:'billingTerms']
  end

  if attributes.has_key?(:'invoiceTemplate')
    self.invoice_template = attributes[:'invoiceTemplate']
  end

  if attributes.has_key?(:'pricingSchedule')
    self.pricing_schedule = attributes[:'pricingSchedule']
  end

  if attributes.has_key?(:'companyEntityType')
    self.company_entity_type = attributes[:'companyEntityType']
  end

  if attributes.has_key?(:'billToCompany')
    self.bill_to_company = attributes[:'billToCompany']
  end

  if attributes.has_key?(:'billingSite')
    self.billing_site = attributes[:'billingSite']
  end

  if attributes.has_key?(:'billingContact')
    self.billing_contact = attributes[:'billingContact']
  end

  if attributes.has_key?(:'invoiceDeliveryMethod')
    self.invoice_delivery_method = attributes[:'invoiceDeliveryMethod']
  end

  if attributes.has_key?(:'invoiceToEmailAddress')
    self.invoice_to_email_address = attributes[:'invoiceToEmailAddress']
  end

  if attributes.has_key?(:'invoiceCCEmailAddress')
    self.invoice_cc_email_address = attributes[:'invoiceCCEmailAddress']
  end

  if attributes.has_key?(:'deletedFlag')
    self.deleted_flag = attributes[:'deletedFlag']
  end

  if attributes.has_key?(:'dateDeleted')
    self.date_deleted = attributes[:'dateDeleted']
  end

  if attributes.has_key?(:'deletedBy')
    self.deleted_by = attributes[:'deletedBy']
  end

  if attributes.has_key?(:'mobileGuid')
    self.mobile_guid = attributes[:'mobileGuid']
  end

  if attributes.has_key?(:'facebookUrl')
    self.facebook_url = attributes[:'facebookUrl']
  end

  if attributes.has_key?(:'twitterUrl')
    self.twitter_url = attributes[:'twitterUrl']
  end

  if attributes.has_key?(:'linkedInUrl')
    self.linked_in_url = attributes[:'linkedInUrl']
  end

  if attributes.has_key?(:'currency')
    self.currency = attributes[:'currency']
  end

  if attributes.has_key?(:'territoryManager')
    self.territory_manager = attributes[:'territoryManager']
  end

  if attributes.has_key?(:'_info')
    self._info = attributes[:'_info']
  end

  if attributes.has_key?(:'customFields')
    if (value = attributes[:'customFields']).is_a?(Array)
      self.custom_fields = value
    end
  end

end

Instance Attribute Details

#_infoObject

Metadata of the entity



139
140
141
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 139

def _info
  @_info
end

#account_numberObject

Returns the value of attribute account_number.



45
46
47
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 45

def 
  @account_number
end

#address_line1Object

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



18
19
20
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 18

def address_line1
  @address_line1
end

#address_line2Object

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



21
22
23
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 21

def address_line2
  @address_line2
end

#annual_revenueObject

Returns the value of attribute annual_revenue.



55
56
57
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 55

def annual_revenue
  @annual_revenue
end

#bill_to_companyObject

Returns the value of attribute bill_to_company.



108
109
110
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 108

def bill_to_company
  @bill_to_company
end

#billing_contactObject

Returns the value of attribute billing_contact.



112
113
114
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 112

def billing_contact
  @billing_contact
end

#billing_siteObject

Returns the value of attribute billing_site.



110
111
112
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 110

def billing_site
  @billing_site
end

#billing_termsObject

Returns the value of attribute billing_terms.



99
100
101
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 99

def billing_terms
  @billing_terms
end

#calendar_idObject

Returns the value of attribute calendar_id.



70
71
72
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 70

def calendar_id
  @calendar_id
end

#cityObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



24
25
26
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 24

def city
  @city
end

#company_entity_typeObject

Based on CompanyEntityType Report



106
107
108
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 106

def company_entity_type
  @company_entity_type
end

#countryObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



33
34
35
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 33

def country
  @country
end

#currencyObject

Returns the value of attribute currency.



134
135
136
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 134

def currency
  @currency
end

#custom_fieldsObject

Returns the value of attribute custom_fields.



141
142
143
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 141

def custom_fields
  @custom_fields
end

#date_acquiredObject

Returns the value of attribute date_acquired.



49
50
51
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 49

def date_acquired
  @date_acquired
end

#date_deletedObject

Returns the value of attribute date_deleted.



122
123
124
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 122

def date_deleted
  @date_deleted
end

#default_contactObject

Returns the value of attribute default_contact.



47
48
49
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 47

def default_contact
  @default_contact
end

#deleted_byObject

Returns the value of attribute deleted_by.



124
125
126
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 124

def deleted_by
  @deleted_by
end

#deleted_flagObject

Returns the value of attribute deleted_flag.



120
121
122
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 120

def deleted_flag
  @deleted_flag
end

#facebook_urlObject

Returns the value of attribute facebook_url.



128
129
130
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 128

def facebook_url
  @facebook_url
end

#fax_numberObject

Returns the value of attribute fax_number.



37
38
39
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 37

def fax_number
  @fax_number
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 7

def id
  @id
end

#identifierObject

Returns the value of attribute identifier.



9
10
11
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 9

def identifier
  @identifier
end

#invoice_cc_email_addressObject

Returns the value of attribute invoice_cc_email_address.



118
119
120
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 118

def invoice_cc_email_address
  @invoice_cc_email_address
end

#invoice_delivery_methodObject

Returns the value of attribute invoice_delivery_method.



114
115
116
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 114

def invoice_delivery_method
  @invoice_delivery_method
end

#invoice_templateObject

Returns the value of attribute invoice_template.



101
102
103
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 101

def invoice_template
  @invoice_template
end

#invoice_to_email_addressObject

Returns the value of attribute invoice_to_email_address.



116
117
118
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 116

def invoice_to_email_address
  @invoice_to_email_address
end

#lead_flagObject

Returns the value of attribute lead_flag.



66
67
68
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 66

def lead_flag
  @lead_flag
end

#lead_sourceObject

Returns the value of attribute lead_source.



64
65
66
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 64

def lead_source
  @lead_source
end

#linked_in_urlObject

Returns the value of attribute linked_in_url.



132
133
134
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 132

def linked_in_url
  @linked_in_url
end

#market_idObject

Returns the value of attribute market_id.



43
44
45
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 43

def market_id
  @market_id
end

#mobile_guidObject

Returns the value of attribute mobile_guid.



126
127
128
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 126

def mobile_guid
  @mobile_guid
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 11

def name
  @name
end

#number_of_employeesObject

Returns the value of attribute number_of_employees.



57
58
59
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 57

def number_of_employees
  @number_of_employees
end

#ownership_typeObject

Returns the value of attribute ownership_type.



59
60
61
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 59

def ownership_type
  @ownership_type
end

#parent_companyObject

Returns the value of attribute parent_company.



53
54
55
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 53

def parent_company
  @parent_company
end

#phone_numberObject

Returns the value of attribute phone_number.



35
36
37
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 35

def phone_number
  @phone_number
end

#pricing_scheduleObject

Returns the value of attribute pricing_schedule.



103
104
105
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 103

def pricing_schedule
  @pricing_schedule
end

#sic_codeObject

Returns the value of attribute sic_code.



51
52
53
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 51

def sic_code
  @sic_code
end

#stateObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



27
28
29
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 27

def state
  @state
end

#statusObject

Returns the value of attribute status.



13
14
15
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 13

def status
  @status
end

#tax_codeObject

New companies will be created with the default tax code unless otherwise specified.



97
98
99
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 97

def tax_code
  @tax_code
end

#tax_identifierObject

Returns the value of attribute tax_identifier.



94
95
96
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 94

def tax_identifier
  @tax_identifier
end

#territory_idObject

Returns the value of attribute territory_id.



41
42
43
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 41

def territory_id
  @territory_id
end

#territory_managerObject

Returns the value of attribute territory_manager.



136
137
138
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 136

def territory_manager
  @territory_manager
end

#time_zoneObject

The specified system time zone for the Company



62
63
64
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 62

def time_zone
  @time_zone
end

#twitter_urlObject

Returns the value of attribute twitter_url.



130
131
132
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 130

def twitter_url
  @twitter_url
end

#typeObject

Returns the value of attribute type.



15
16
17
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 15

def type
  @type
end

#unsubscribe_flagObject

Returns the value of attribute unsubscribe_flag.



68
69
70
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 68

def unsubscribe_flag
  @unsubscribe_flag
end

#user_defined_field1Object

Returns the value of attribute user_defined_field1.



72
73
74
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 72

def user_defined_field1
  @user_defined_field1
end

#user_defined_field10Object

Returns the value of attribute user_defined_field10.



90
91
92
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 90

def user_defined_field10
  @user_defined_field10
end

#user_defined_field2Object

Returns the value of attribute user_defined_field2.



74
75
76
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 74

def user_defined_field2
  @user_defined_field2
end

#user_defined_field3Object

Returns the value of attribute user_defined_field3.



76
77
78
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 76

def user_defined_field3
  @user_defined_field3
end

#user_defined_field4Object

Returns the value of attribute user_defined_field4.



78
79
80
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 78

def user_defined_field4
  @user_defined_field4
end

#user_defined_field5Object

Returns the value of attribute user_defined_field5.



80
81
82
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 80

def user_defined_field5
  @user_defined_field5
end

#user_defined_field6Object

Returns the value of attribute user_defined_field6.



82
83
84
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 82

def user_defined_field6
  @user_defined_field6
end

#user_defined_field7Object

Returns the value of attribute user_defined_field7.



84
85
86
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 84

def user_defined_field7
  @user_defined_field7
end

#user_defined_field8Object

Returns the value of attribute user_defined_field8.



86
87
88
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 86

def user_defined_field8
  @user_defined_field8
end

#user_defined_field9Object

Returns the value of attribute user_defined_field9.



88
89
90
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 88

def user_defined_field9
  @user_defined_field9
end

#vendor_identifierObject

Returns the value of attribute vendor_identifier.



92
93
94
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 92

def vendor_identifier
  @vendor_identifier
end

#websiteObject

Returns the value of attribute website.



39
40
41
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 39

def website
  @website
end

#zipObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country



30
31
32
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 30

def zip
  @zip
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



145
146
147
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
174
175
176
177
178
179
180
181
182
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
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 145

def self.attribute_map
  {
    :'id' => :'id',
    :'identifier' => :'identifier',
    :'name' => :'name',
    :'status' => :'status',
    :'type' => :'type',
    :'address_line1' => :'addressLine1',
    :'address_line2' => :'addressLine2',
    :'city' => :'city',
    :'state' => :'state',
    :'zip' => :'zip',
    :'country' => :'country',
    :'phone_number' => :'phoneNumber',
    :'fax_number' => :'faxNumber',
    :'website' => :'website',
    :'territory_id' => :'territoryId',
    :'market_id' => :'marketId',
    :'account_number' => :'accountNumber',
    :'default_contact' => :'defaultContact',
    :'date_acquired' => :'dateAcquired',
    :'sic_code' => :'sicCode',
    :'parent_company' => :'parentCompany',
    :'annual_revenue' => :'annualRevenue',
    :'number_of_employees' => :'numberOfEmployees',
    :'ownership_type' => :'ownershipType',
    :'time_zone' => :'timeZone',
    :'lead_source' => :'leadSource',
    :'lead_flag' => :'leadFlag',
    :'unsubscribe_flag' => :'unsubscribeFlag',
    :'calendar_id' => :'calendarId',
    :'user_defined_field1' => :'userDefinedField1',
    :'user_defined_field2' => :'userDefinedField2',
    :'user_defined_field3' => :'userDefinedField3',
    :'user_defined_field4' => :'userDefinedField4',
    :'user_defined_field5' => :'userDefinedField5',
    :'user_defined_field6' => :'userDefinedField6',
    :'user_defined_field7' => :'userDefinedField7',
    :'user_defined_field8' => :'userDefinedField8',
    :'user_defined_field9' => :'userDefinedField9',
    :'user_defined_field10' => :'userDefinedField10',
    :'vendor_identifier' => :'vendorIdentifier',
    :'tax_identifier' => :'taxIdentifier',
    :'tax_code' => :'taxCode',
    :'billing_terms' => :'billingTerms',
    :'invoice_template' => :'invoiceTemplate',
    :'pricing_schedule' => :'pricingSchedule',
    :'company_entity_type' => :'companyEntityType',
    :'bill_to_company' => :'billToCompany',
    :'billing_site' => :'billingSite',
    :'billing_contact' => :'billingContact',
    :'invoice_delivery_method' => :'invoiceDeliveryMethod',
    :'invoice_to_email_address' => :'invoiceToEmailAddress',
    :'invoice_cc_email_address' => :'invoiceCCEmailAddress',
    :'deleted_flag' => :'deletedFlag',
    :'date_deleted' => :'dateDeleted',
    :'deleted_by' => :'deletedBy',
    :'mobile_guid' => :'mobileGuid',
    :'facebook_url' => :'facebookUrl',
    :'twitter_url' => :'twitterUrl',
    :'linked_in_url' => :'linkedInUrl',
    :'currency' => :'currency',
    :'territory_manager' => :'territoryManager',
    :'_info' => :'_info',
    :'custom_fields' => :'customFields'
  }
end

.swagger_typesObject

Attribute type mapping.



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 214

def self.swagger_types
  {
    :'id' => :'Integer',
    :'identifier' => :'String',
    :'name' => :'String',
    :'status' => :'CompanyStatusReference',
    :'type' => :'CompanyTypeReference',
    :'address_line1' => :'String',
    :'address_line2' => :'String',
    :'city' => :'String',
    :'state' => :'String',
    :'zip' => :'String',
    :'country' => :'CountryReference',
    :'phone_number' => :'String',
    :'fax_number' => :'String',
    :'website' => :'String',
    :'territory_id' => :'Integer',
    :'market_id' => :'Integer',
    :'account_number' => :'String',
    :'default_contact' => :'ContactReference',
    :'date_acquired' => :'DateTime',
    :'sic_code' => :'SicCodeReference',
    :'parent_company' => :'CompanyReference',
    :'annual_revenue' => :'Float',
    :'number_of_employees' => :'Integer',
    :'ownership_type' => :'OwnershipTypeReference',
    :'time_zone' => :'TimeZoneSetupReference',
    :'lead_source' => :'String',
    :'lead_flag' => :'BOOLEAN',
    :'unsubscribe_flag' => :'BOOLEAN',
    :'calendar_id' => :'Integer',
    :'user_defined_field1' => :'String',
    :'user_defined_field2' => :'String',
    :'user_defined_field3' => :'String',
    :'user_defined_field4' => :'String',
    :'user_defined_field5' => :'String',
    :'user_defined_field6' => :'String',
    :'user_defined_field7' => :'String',
    :'user_defined_field8' => :'String',
    :'user_defined_field9' => :'String',
    :'user_defined_field10' => :'String',
    :'vendor_identifier' => :'String',
    :'tax_identifier' => :'String',
    :'tax_code' => :'TaxCodeReference',
    :'billing_terms' => :'BillingTermsReference',
    :'invoice_template' => :'InvoiceTemplateReference',
    :'pricing_schedule' => :'PricingScheduleReference',
    :'company_entity_type' => :'EntityTypeReference',
    :'bill_to_company' => :'CompanyReference',
    :'billing_site' => :'SiteReference',
    :'billing_contact' => :'ContactReference',
    :'invoice_delivery_method' => :'BillingDeliveryReference',
    :'invoice_to_email_address' => :'String',
    :'invoice_cc_email_address' => :'String',
    :'deleted_flag' => :'BOOLEAN',
    :'date_deleted' => :'DateTime',
    :'deleted_by' => :'String',
    :'mobile_guid' => :'Guid',
    :'facebook_url' => :'String',
    :'twitter_url' => :'String',
    :'linked_in_url' => :'String',
    :'currency' => :'CurrencyReference',
    :'territory_manager' => :'MemberReference',
    :'_info' => :'Metadata',
    :'custom_fields' => :'Array<CustomFieldValue>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 945

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      identifier == o.identifier &&
      name == o.name &&
      status == o.status &&
      type == o.type &&
      address_line1 == o.address_line1 &&
      address_line2 == o.address_line2 &&
      city == o.city &&
      state == o.state &&
      zip == o.zip &&
      country == o.country &&
      phone_number == o.phone_number &&
      fax_number == o.fax_number &&
      website == o.website &&
      territory_id == o.territory_id &&
      market_id == o.market_id &&
       == o. &&
      default_contact == o.default_contact &&
      date_acquired == o.date_acquired &&
      sic_code == o.sic_code &&
      parent_company == o.parent_company &&
      annual_revenue == o.annual_revenue &&
      number_of_employees == o.number_of_employees &&
      ownership_type == o.ownership_type &&
      time_zone == o.time_zone &&
      lead_source == o.lead_source &&
      lead_flag == o.lead_flag &&
      unsubscribe_flag == o.unsubscribe_flag &&
      calendar_id == o.calendar_id &&
      user_defined_field1 == o.user_defined_field1 &&
      user_defined_field2 == o.user_defined_field2 &&
      user_defined_field3 == o.user_defined_field3 &&
      user_defined_field4 == o.user_defined_field4 &&
      user_defined_field5 == o.user_defined_field5 &&
      user_defined_field6 == o.user_defined_field6 &&
      user_defined_field7 == o.user_defined_field7 &&
      user_defined_field8 == o.user_defined_field8 &&
      user_defined_field9 == o.user_defined_field9 &&
      user_defined_field10 == o.user_defined_field10 &&
      vendor_identifier == o.vendor_identifier &&
      tax_identifier == o.tax_identifier &&
      tax_code == o.tax_code &&
      billing_terms == o.billing_terms &&
      invoice_template == o.invoice_template &&
      pricing_schedule == o.pricing_schedule &&
      company_entity_type == o.company_entity_type &&
      bill_to_company == o.bill_to_company &&
      billing_site == o.billing_site &&
      billing_contact == o.billing_contact &&
      invoice_delivery_method == o.invoice_delivery_method &&
      invoice_to_email_address == o.invoice_to_email_address &&
      invoice_cc_email_address == o.invoice_cc_email_address &&
      deleted_flag == o.deleted_flag &&
      date_deleted == o.date_deleted &&
      deleted_by == o.deleted_by &&
      mobile_guid == o.mobile_guid &&
      facebook_url == o.facebook_url &&
      twitter_url == o.twitter_url &&
      linked_in_url == o.linked_in_url &&
      currency == o.currency &&
      territory_manager == o.territory_manager &&
      _info == o._info &&
      custom_fields == o.custom_fields
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1049

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = ConnectWise.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1115

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1028

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


1015
1016
1017
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1015

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



1021
1022
1023
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1021

def hash
  [id, identifier, name, status, type, address_line1, address_line2, city, state, zip, country, phone_number, fax_number, website, territory_id, market_id, , default_contact, date_acquired, sic_code, parent_company, annual_revenue, number_of_employees, ownership_type, time_zone, lead_source, lead_flag, unsubscribe_flag, calendar_id, user_defined_field1, user_defined_field2, user_defined_field3, user_defined_field4, user_defined_field5, user_defined_field6, user_defined_field7, user_defined_field8, user_defined_field9, user_defined_field10, vendor_identifier, tax_identifier, tax_code, billing_terms, invoice_template, pricing_schedule, company_entity_type, bill_to_company, billing_site, billing_contact, invoice_delivery_method, invoice_to_email_address, invoice_cc_email_address, deleted_flag, date_deleted, deleted_by, mobile_guid, facebook_url, twitter_url, linked_in_url, currency, territory_manager, _info, custom_fields].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 548

def list_invalid_properties
  invalid_properties = Array.new
  if @identifier.nil?
    invalid_properties.push("invalid value for 'identifier', identifier cannot be nil.")
  end

  if @identifier.to_s.length > 25
    invalid_properties.push("invalid value for 'identifier', the character length must be smaller than or equal to 25.")
  end

  if @name.nil?
    invalid_properties.push("invalid value for 'name', name cannot be nil.")
  end

  if @name.to_s.length > 50
    invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 50.")
  end

  if !@address_line1.nil? && @address_line1.to_s.length > 50
    invalid_properties.push("invalid value for 'address_line1', the character length must be smaller than or equal to 50.")
  end

  if !@address_line2.nil? && @address_line2.to_s.length > 50
    invalid_properties.push("invalid value for 'address_line2', the character length must be smaller than or equal to 50.")
  end

  if !@city.nil? && @city.to_s.length > 50
    invalid_properties.push("invalid value for 'city', the character length must be smaller than or equal to 50.")
  end

  if !@state.nil? && @state.to_s.length > 50
    invalid_properties.push("invalid value for 'state', the character length must be smaller than or equal to 50.")
  end

  if !@zip.nil? && @zip.to_s.length > 12
    invalid_properties.push("invalid value for 'zip', the character length must be smaller than or equal to 12.")
  end

  if !@phone_number.nil? && @phone_number.to_s.length > 30
    invalid_properties.push("invalid value for 'phone_number', the character length must be smaller than or equal to 30.")
  end

  if !@fax_number.nil? && @fax_number.to_s.length > 30
    invalid_properties.push("invalid value for 'fax_number', the character length must be smaller than or equal to 30.")
  end

  if !@website.nil? && @website.to_s.length > 255
    invalid_properties.push("invalid value for 'website', the character length must be smaller than or equal to 255.")
  end

  if !@account_number.nil? && @account_number.to_s.length > 100
    invalid_properties.push("invalid value for 'account_number', the character length must be smaller than or equal to 100.")
  end

  if !@lead_source.nil? && @lead_source.to_s.length > 50
    invalid_properties.push("invalid value for 'lead_source', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field1.nil? && @user_defined_field1.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field1', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field2.nil? && @user_defined_field2.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field2', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field3.nil? && @user_defined_field3.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field3', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field4.nil? && @user_defined_field4.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field4', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field5.nil? && @user_defined_field5.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field5', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field6.nil? && @user_defined_field6.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field6', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field7.nil? && @user_defined_field7.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field7', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field8.nil? && @user_defined_field8.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field8', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field9.nil? && @user_defined_field9.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field9', the character length must be smaller than or equal to 50.")
  end

  if !@user_defined_field10.nil? && @user_defined_field10.to_s.length > 50
    invalid_properties.push("invalid value for 'user_defined_field10', the character length must be smaller than or equal to 50.")
  end

  if !@vendor_identifier.nil? && @vendor_identifier.to_s.length > 100
    invalid_properties.push("invalid value for 'vendor_identifier', the character length must be smaller than or equal to 100.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



1095
1096
1097
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1095

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



1101
1102
1103
1104
1105
1106
1107
1108
1109
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1101

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



1089
1090
1091
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 1089

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/connectwise-ruby-sdk/models/company.rb', line 655

def valid?
  return false if @identifier.nil?
  return false if @identifier.to_s.length > 25
  return false if @name.nil?
  return false if @name.to_s.length > 50
  return false if !@address_line1.nil? && @address_line1.to_s.length > 50
  return false if !@address_line2.nil? && @address_line2.to_s.length > 50
  return false if !@city.nil? && @city.to_s.length > 50
  return false if !@state.nil? && @state.to_s.length > 50
  return false if !@zip.nil? && @zip.to_s.length > 12
  return false if !@phone_number.nil? && @phone_number.to_s.length > 30
  return false if !@fax_number.nil? && @fax_number.to_s.length > 30
  return false if !@website.nil? && @website.to_s.length > 255
  return false if !@account_number.nil? && @account_number.to_s.length > 100
  return false if !@lead_source.nil? && @lead_source.to_s.length > 50
  return false if !@user_defined_field1.nil? && @user_defined_field1.to_s.length > 50
  return false if !@user_defined_field2.nil? && @user_defined_field2.to_s.length > 50
  return false if !@user_defined_field3.nil? && @user_defined_field3.to_s.length > 50
  return false if !@user_defined_field4.nil? && @user_defined_field4.to_s.length > 50
  return false if !@user_defined_field5.nil? && @user_defined_field5.to_s.length > 50
  return false if !@user_defined_field6.nil? && @user_defined_field6.to_s.length > 50
  return false if !@user_defined_field7.nil? && @user_defined_field7.to_s.length > 50
  return false if !@user_defined_field8.nil? && @user_defined_field8.to_s.length > 50
  return false if !@user_defined_field9.nil? && @user_defined_field9.to_s.length > 50
  return false if !@user_defined_field10.nil? && @user_defined_field10.to_s.length > 50
  return false if !@vendor_identifier.nil? && @vendor_identifier.to_s.length > 100
  return true
end