Class: ConnectWise::Company

Inherits:
Object
  • Object
show all
Defined in:
lib/connect_wise/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

Raises:

  • (ArgumentError)


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
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
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
# File 'lib/connect_wise/models/company.rb', line 256

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::Company` initialize method' unless attributes.is_a?(Hash)

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) do |(k, v), h|
    raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::Company`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)

    h[k.to_sym] = v
  end

  self.identifier = attributes[:identifier] if attributes.key?(:identifier)

  self.name = attributes[:name] if attributes.key?(:name)

  self.id = attributes[:id] if attributes.key?(:id)

  self.status = attributes[:status] if attributes.key?(:status)

  self.address_line1 = attributes[:address_line1] if attributes.key?(:address_line1)

  self.address_line2 = attributes[:address_line2] if attributes.key?(:address_line2)

  self.city = attributes[:city] if attributes.key?(:city)

  self.state = attributes[:state] if attributes.key?(:state)

  self.zip = attributes[:zip] if attributes.key?(:zip)

  self.country = attributes[:country] if attributes.key?(:country)

  self.phone_number = attributes[:phone_number] if attributes.key?(:phone_number)

  self.fax_number = attributes[:fax_number] if attributes.key?(:fax_number)

  self.website = attributes[:website] if attributes.key?(:website)

  self.territory = attributes[:territory] if attributes.key?(:territory)

  self.market = attributes[:market] if attributes.key?(:market)

  self. = attributes[:account_number] if attributes.key?(:account_number)

  self.default_contact = attributes[:default_contact] if attributes.key?(:default_contact)

  self.date_acquired = attributes[:date_acquired] if attributes.key?(:date_acquired)

  self.sic_code = attributes[:sic_code] if attributes.key?(:sic_code)

  self.parent_company = attributes[:parent_company] if attributes.key?(:parent_company)

  self.annual_revenue = attributes[:annual_revenue] if attributes.key?(:annual_revenue)

  self.number_of_employees = attributes[:number_of_employees] if attributes.key?(:number_of_employees)

  self.year_established = attributes[:year_established] if attributes.key?(:year_established)

  self.revenue_year = attributes[:revenue_year] if attributes.key?(:revenue_year)

  self.ownership_type = attributes[:ownership_type] if attributes.key?(:ownership_type)

  self.time_zone_setup = attributes[:time_zone_setup] if attributes.key?(:time_zone_setup)

  self.lead_source = attributes[:lead_source] if attributes.key?(:lead_source)

  self.lead_flag = attributes[:lead_flag] if attributes.key?(:lead_flag)

  self.unsubscribe_flag = attributes[:unsubscribe_flag] if attributes.key?(:unsubscribe_flag)

  self.calendar = attributes[:calendar] if attributes.key?(:calendar)

  self.user_defined_field1 = attributes[:user_defined_field1] if attributes.key?(:user_defined_field1)

  self.user_defined_field2 = attributes[:user_defined_field2] if attributes.key?(:user_defined_field2)

  self.user_defined_field3 = attributes[:user_defined_field3] if attributes.key?(:user_defined_field3)

  self.user_defined_field4 = attributes[:user_defined_field4] if attributes.key?(:user_defined_field4)

  self.user_defined_field5 = attributes[:user_defined_field5] if attributes.key?(:user_defined_field5)

  self.user_defined_field6 = attributes[:user_defined_field6] if attributes.key?(:user_defined_field6)

  self.user_defined_field7 = attributes[:user_defined_field7] if attributes.key?(:user_defined_field7)

  self.user_defined_field8 = attributes[:user_defined_field8] if attributes.key?(:user_defined_field8)

  self.user_defined_field9 = attributes[:user_defined_field9] if attributes.key?(:user_defined_field9)

  self.user_defined_field10 = attributes[:user_defined_field10] if attributes.key?(:user_defined_field10)

  self.vendor_identifier = attributes[:vendor_identifier] if attributes.key?(:vendor_identifier)

  self.tax_identifier = attributes[:tax_identifier] if attributes.key?(:tax_identifier)

  self.tax_code = attributes[:tax_code] if attributes.key?(:tax_code)

  self.billing_terms = attributes[:billing_terms] if attributes.key?(:billing_terms)

  self.invoice_template = attributes[:invoice_template] if attributes.key?(:invoice_template)

  self.pricing_schedule = attributes[:pricing_schedule] if attributes.key?(:pricing_schedule)

  self.company_entity_type = attributes[:company_entity_type] if attributes.key?(:company_entity_type)

  self.bill_to_company = attributes[:bill_to_company] if attributes.key?(:bill_to_company)

  self.billing_site = attributes[:billing_site] if attributes.key?(:billing_site)

  self.billing_contact = attributes[:billing_contact] if attributes.key?(:billing_contact)

  self.invoice_delivery_method = attributes[:invoice_delivery_method] if attributes.key?(:invoice_delivery_method)

  self.invoice_to_email_address = attributes[:invoice_to_email_address] if attributes.key?(:invoice_to_email_address)

  self.invoice_cc_email_address = attributes[:invoice_cc_email_address] if attributes.key?(:invoice_cc_email_address)

  self.deleted_flag = attributes[:deleted_flag] if attributes.key?(:deleted_flag)

  self.date_deleted = attributes[:date_deleted] if attributes.key?(:date_deleted)

  self.deleted_by = attributes[:deleted_by] if attributes.key?(:deleted_by)

  self.mobile_guid = attributes[:mobile_guid] if attributes.key?(:mobile_guid)

  self.facebook_url = attributes[:facebook_url] if attributes.key?(:facebook_url)

  self.twitter_url = attributes[:twitter_url] if attributes.key?(:twitter_url)

  self.linked_in_url = attributes[:linked_in_url] if attributes.key?(:linked_in_url)

  self.currency = attributes[:currency] if attributes.key?(:currency)

  self.territory_manager = attributes[:territory_manager] if attributes.key?(:territory_manager)

  self.reseller_identifier = attributes[:reseller_identifier] if attributes.key?(:reseller_identifier)

  self.is_vendor_flag = attributes[:is_vendor_flag] if attributes.key?(:is_vendor_flag)

  if attributes.key?(:types) && (value = attributes[:types]).is_a?(Array)
    self.types = value
  end

  self.site = attributes[:site] if attributes.key?(:site)

  if attributes.key?(:integrator_tags) && (value = attributes[:integrator_tags]).is_a?(Array)
    self.integrator_tags = value
  end

  if attributes.key?(:_info) && (value = attributes[:_info]).is_a?(Hash)
    self._info = value
  end

  return unless attributes.key?(:custom_fields)
  return unless (value = attributes[:custom_fields]).is_a?(Array)

  self.custom_fields = value
end

Instance Attribute Details

#_infoObject

Returns the value of attribute _info.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def _info
  @_info
end

#account_numberObject

Returns the value of attribute account_number.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def 
  @account_number
end

#address_line1Object

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country Max length: 50;



25
26
27
# File 'lib/connect_wise/models/company.rb', line 25

def address_line1
  @address_line1
end

#address_line2Object

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country Max length: 50;



28
29
30
# File 'lib/connect_wise/models/company.rb', line 28

def address_line2
  @address_line2
end

#annual_revenueObject

Returns the value of attribute annual_revenue.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def annual_revenue
  @annual_revenue
end

#bill_to_companyObject

Returns the value of attribute bill_to_company.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def bill_to_company
  @bill_to_company
end

#billing_contactObject

Returns the value of attribute billing_contact.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def billing_contact
  @billing_contact
end

#billing_siteObject

Returns the value of attribute billing_site.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def billing_site
  @billing_site
end

#billing_termsObject

Returns the value of attribute billing_terms.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def billing_terms
  @billing_terms
end

#calendarObject

Returns the value of attribute calendar.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def calendar
  @calendar
end

#cityObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country Max length: 50;



31
32
33
# File 'lib/connect_wise/models/company.rb', line 31

def city
  @city
end

#company_entity_typeObject

Returns the value of attribute company_entity_type.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def company_entity_type
  @company_entity_type
end

#countryObject

Returns the value of attribute country.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def country
  @country
end

#currencyObject

Returns the value of attribute currency.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def currency
  @currency
end

#custom_fieldsObject

Returns the value of attribute custom_fields.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def custom_fields
  @custom_fields
end

#date_acquiredObject

Returns the value of attribute date_acquired.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def date_acquired
  @date_acquired
end

#date_deletedObject

Returns the value of attribute date_deleted.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def date_deleted
  @date_deleted
end

#default_contactObject

Returns the value of attribute default_contact.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def default_contact
  @default_contact
end

#deleted_byObject

Returns the value of attribute deleted_by.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def deleted_by
  @deleted_by
end

#deleted_flagObject

Returns the value of attribute deleted_flag.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def deleted_flag
  @deleted_flag
end

#facebook_urlObject

Returns the value of attribute facebook_url.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def facebook_url
  @facebook_url
end

#fax_numberObject

Max length: 30;



43
44
45
# File 'lib/connect_wise/models/company.rb', line 43

def fax_number
  @fax_number
end

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def id
  @id
end

#identifierObject

Max length: 25;



17
18
19
# File 'lib/connect_wise/models/company.rb', line 17

def identifier
  @identifier
end

#integrator_tagsObject

Returns the value of attribute integrator_tags.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def integrator_tags
  @integrator_tags
end

#invoice_cc_email_addressObject

Returns the value of attribute invoice_cc_email_address.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def invoice_cc_email_address
  @invoice_cc_email_address
end

#invoice_delivery_methodObject

Returns the value of attribute invoice_delivery_method.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def invoice_delivery_method
  @invoice_delivery_method
end

#invoice_templateObject

Returns the value of attribute invoice_template.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def invoice_template
  @invoice_template
end

#invoice_to_email_addressObject

Returns the value of attribute invoice_to_email_address.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def invoice_to_email_address
  @invoice_to_email_address
end

#is_vendor_flagObject

Returns the value of attribute is_vendor_flag.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def is_vendor_flag
  @is_vendor_flag
end

#lead_flagObject

Returns the value of attribute lead_flag.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def lead_flag
  @lead_flag
end

#lead_sourceObject

Max length: 50;



49
50
51
# File 'lib/connect_wise/models/company.rb', line 49

def lead_source
  @lead_source
end

#linked_in_urlObject

Returns the value of attribute linked_in_url.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def linked_in_url
  @linked_in_url
end

#marketObject

Returns the value of attribute market.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def market
  @market
end

#mobile_guidObject

Returns the value of attribute mobile_guid.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def mobile_guid
  @mobile_guid
end

#nameObject

Max length: 50;



20
21
22
# File 'lib/connect_wise/models/company.rb', line 20

def name
  @name
end

#number_of_employeesObject

Returns the value of attribute number_of_employees.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def number_of_employees
  @number_of_employees
end

#ownership_typeObject

Returns the value of attribute ownership_type.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def ownership_type
  @ownership_type
end

#parent_companyObject

Returns the value of attribute parent_company.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def parent_company
  @parent_company
end

#phone_numberObject

Max length: 30;



40
41
42
# File 'lib/connect_wise/models/company.rb', line 40

def phone_number
  @phone_number
end

#pricing_scheduleObject

Returns the value of attribute pricing_schedule.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def pricing_schedule
  @pricing_schedule
end

#reseller_identifierObject

Returns the value of attribute reseller_identifier.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def reseller_identifier
  @reseller_identifier
end

#revenue_yearObject

Returns the value of attribute revenue_year.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def revenue_year
  @revenue_year
end

#sic_codeObject

Returns the value of attribute sic_code.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def sic_code
  @sic_code
end

#siteObject

Returns the value of attribute site.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def site
  @site
end

#stateObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country Max length: 50;



34
35
36
# File 'lib/connect_wise/models/company.rb', line 34

def state
  @state
end

#statusObject

Returns the value of attribute status.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def status
  @status
end

#tax_codeObject

Returns the value of attribute tax_code.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def tax_code
  @tax_code
end

#tax_identifierObject

Returns the value of attribute tax_identifier.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def tax_identifier
  @tax_identifier
end

#territoryObject

Returns the value of attribute territory.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def territory
  @territory
end

#territory_managerObject

Returns the value of attribute territory_manager.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def territory_manager
  @territory_manager
end

#time_zone_setupObject

Returns the value of attribute time_zone_setup.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def time_zone_setup
  @time_zone_setup
end

#twitter_urlObject

Returns the value of attribute twitter_url.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def twitter_url
  @twitter_url
end

#typesObject

Integrer array of Company_Type_Recids to be assigned to company that can be passed in only during new company creation (post) To update existing companies type, use the /company/companyTypeAssociations or /company/companies/ID/typeAssociations endpoints



82
83
84
# File 'lib/connect_wise/models/company.rb', line 82

def types
  @types
end

#unsubscribe_flagObject

Returns the value of attribute unsubscribe_flag.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def unsubscribe_flag
  @unsubscribe_flag
end

#user_defined_field1Object

Max length: 50;



52
53
54
# File 'lib/connect_wise/models/company.rb', line 52

def user_defined_field1
  @user_defined_field1
end

#user_defined_field10Object

Max length: 50;



79
80
81
# File 'lib/connect_wise/models/company.rb', line 79

def user_defined_field10
  @user_defined_field10
end

#user_defined_field2Object

Max length: 50;



55
56
57
# File 'lib/connect_wise/models/company.rb', line 55

def user_defined_field2
  @user_defined_field2
end

#user_defined_field3Object

Max length: 50;



58
59
60
# File 'lib/connect_wise/models/company.rb', line 58

def user_defined_field3
  @user_defined_field3
end

#user_defined_field4Object

Max length: 50;



61
62
63
# File 'lib/connect_wise/models/company.rb', line 61

def user_defined_field4
  @user_defined_field4
end

#user_defined_field5Object

Max length: 50;



64
65
66
# File 'lib/connect_wise/models/company.rb', line 64

def user_defined_field5
  @user_defined_field5
end

#user_defined_field6Object

Max length: 50;



67
68
69
# File 'lib/connect_wise/models/company.rb', line 67

def user_defined_field6
  @user_defined_field6
end

#user_defined_field7Object

Max length: 50;



70
71
72
# File 'lib/connect_wise/models/company.rb', line 70

def user_defined_field7
  @user_defined_field7
end

#user_defined_field8Object

Max length: 50;



73
74
75
# File 'lib/connect_wise/models/company.rb', line 73

def user_defined_field8
  @user_defined_field8
end

#user_defined_field9Object

Max length: 50;



76
77
78
# File 'lib/connect_wise/models/company.rb', line 76

def user_defined_field9
  @user_defined_field9
end

#vendor_identifierObject

Returns the value of attribute vendor_identifier.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def vendor_identifier
  @vendor_identifier
end

#websiteObject

Max length: 255;



46
47
48
# File 'lib/connect_wise/models/company.rb', line 46

def website
  @website
end

#year_establishedObject

Returns the value of attribute year_established.



22
23
24
# File 'lib/connect_wise/models/company.rb', line 22

def year_established
  @year_established
end

#zipObject

At least one address field is required – addressLine1, addressLine2, city, state, zip and/or country Max length: 12;



37
38
39
# File 'lib/connect_wise/models/company.rb', line 37

def zip
  @zip
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



160
161
162
# File 'lib/connect_wise/models/company.rb', line 160

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/connect_wise/models/company.rb', line 85

def self.attribute_map
  {
    identifier: :identifier,
    name: :name,
    id: :id,
    status: :status,
    address_line1: :addressLine1,
    address_line2: :addressLine2,
    city: :city,
    state: :state,
    zip: :zip,
    country: :country,
    phone_number: :phoneNumber,
    fax_number: :faxNumber,
    website: :website,
    territory: :territory,
    market: :market,
    account_number: :accountNumber,
    default_contact: :defaultContact,
    date_acquired: :dateAcquired,
    sic_code: :sicCode,
    parent_company: :parentCompany,
    annual_revenue: :annualRevenue,
    number_of_employees: :numberOfEmployees,
    year_established: :yearEstablished,
    revenue_year: :revenueYear,
    ownership_type: :ownershipType,
    time_zone_setup: :timeZoneSetup,
    lead_source: :leadSource,
    lead_flag: :leadFlag,
    unsubscribe_flag: :unsubscribeFlag,
    calendar: :calendar,
    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,
    reseller_identifier: :resellerIdentifier,
    is_vendor_flag: :isVendorFlag,
    types: :types,
    site: :site,
    integrator_tags: :integratorTags,
    _info: :_info,
    custom_fields: :customFields
  }
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



526
527
528
# File 'lib/connect_wise/models/company.rb', line 526

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/connect_wise/models/company.rb', line 240

def self.openapi_nullable
  Set.new(%i[
            annual_revenue
            number_of_employees
            year_established
            revenue_year
            lead_flag
            unsubscribe_flag
            deleted_flag
            mobile_guid
            is_vendor_flag
          ])
end

.openapi_typesObject

Attribute type mapping.



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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/connect_wise/models/company.rb', line 165

def self.openapi_types
  {
    identifier: :String,
    name: :String,
    id: :Integer,
    status: :CompanyStatusReference,
    address_line1: :String,
    address_line2: :String,
    city: :String,
    state: :String,
    zip: :String,
    country: :CountryReference,
    phone_number: :String,
    fax_number: :String,
    website: :String,
    territory: :SystemLocationReference,
    market: :MarketDescriptionReference,
    account_number: :String,
    default_contact: :ContactReference,
    date_acquired: :Time,
    sic_code: :SicCodeReference,
    parent_company: :CompanyReference,
    annual_revenue: :Float,
    number_of_employees: :Integer,
    year_established: :Integer,
    revenue_year: :Integer,
    ownership_type: :OwnershipTypeReference,
    time_zone_setup: :TimeZoneSetupReference,
    lead_source: :String,
    lead_flag: :Boolean,
    unsubscribe_flag: :Boolean,
    calendar: :CalendarReference,
    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: :Time,
    deleted_by: :String,
    mobile_guid: :String,
    facebook_url: :String,
    twitter_url: :String,
    linked_in_url: :String,
    currency: :CurrencyReference,
    territory_manager: :MemberReference,
    reseller_identifier: :String,
    is_vendor_flag: :Boolean,
    types: :'Array<CompanyTypeReference>',
    site: :SiteReference,
    integrator_tags: :'Array<String>',
    _info: :'Hash<String, String>',
    custom_fields: :'Array<CustomFieldValue>'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/connect_wise/models/company.rb', line 436

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    identifier == other.identifier &&
    name == other.name &&
    id == other.id &&
    status == other.status &&
    address_line1 == other.address_line1 &&
    address_line2 == other.address_line2 &&
    city == other.city &&
    state == other.state &&
    zip == other.zip &&
    country == other.country &&
    phone_number == other.phone_number &&
    fax_number == other.fax_number &&
    website == other.website &&
    territory == other.territory &&
    market == other.market &&
     == other. &&
    default_contact == other.default_contact &&
    date_acquired == other.date_acquired &&
    sic_code == other.sic_code &&
    parent_company == other.parent_company &&
    annual_revenue == other.annual_revenue &&
    number_of_employees == other.number_of_employees &&
    year_established == other.year_established &&
    revenue_year == other.revenue_year &&
    ownership_type == other.ownership_type &&
    time_zone_setup == other.time_zone_setup &&
    lead_source == other.lead_source &&
    lead_flag == other.lead_flag &&
    unsubscribe_flag == other.unsubscribe_flag &&
    calendar == other.calendar &&
    user_defined_field1 == other.user_defined_field1 &&
    user_defined_field2 == other.user_defined_field2 &&
    user_defined_field3 == other.user_defined_field3 &&
    user_defined_field4 == other.user_defined_field4 &&
    user_defined_field5 == other.user_defined_field5 &&
    user_defined_field6 == other.user_defined_field6 &&
    user_defined_field7 == other.user_defined_field7 &&
    user_defined_field8 == other.user_defined_field8 &&
    user_defined_field9 == other.user_defined_field9 &&
    user_defined_field10 == other.user_defined_field10 &&
    vendor_identifier == other.vendor_identifier &&
    tax_identifier == other.tax_identifier &&
    tax_code == other.tax_code &&
    billing_terms == other.billing_terms &&
    invoice_template == other.invoice_template &&
    pricing_schedule == other.pricing_schedule &&
    company_entity_type == other.company_entity_type &&
    bill_to_company == other.bill_to_company &&
    billing_site == other.billing_site &&
    billing_contact == other.billing_contact &&
    invoice_delivery_method == other.invoice_delivery_method &&
    invoice_to_email_address == other.invoice_to_email_address &&
    invoice_cc_email_address == other.invoice_cc_email_address &&
    deleted_flag == other.deleted_flag &&
    date_deleted == other.date_deleted &&
    deleted_by == other.deleted_by &&
    mobile_guid == other.mobile_guid &&
    facebook_url == other.facebook_url &&
    twitter_url == other.twitter_url &&
    linked_in_url == other.linked_in_url &&
    currency == other.currency &&
    territory_manager == other.territory_manager &&
    reseller_identifier == other.reseller_identifier &&
    is_vendor_flag == other.is_vendor_flag &&
    types == other.types &&
    site == other.site &&
    integrator_tags == other.integrator_tags &&
    _info == other._info &&
    custom_fields == other.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



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
# File 'lib/connect_wise/models/company.rb', line 556

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = ConnectWise.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/connect_wise/models/company.rb', line 627

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



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/connect_wise/models/company.rb', line 533

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array)
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


513
514
515
# File 'lib/connect_wise/models/company.rb', line 513

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



519
520
521
# File 'lib/connect_wise/models/company.rb', line 519

def hash
  [identifier, name, id, status, address_line1, address_line2, city, state, zip, country, phone_number, fax_number, website, territory, market, , default_contact, date_acquired, sic_code, parent_company, annual_revenue, number_of_employees, year_established, revenue_year, ownership_type, time_zone_setup, lead_source, lead_flag, unsubscribe_flag, calendar, 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, reseller_identifier, is_vendor_flag, types, site, integrator_tags, _info, custom_fields].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



416
417
418
419
420
421
422
423
# File 'lib/connect_wise/models/company.rb', line 416

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

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

  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



603
604
605
# File 'lib/connect_wise/models/company.rb', line 603

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



609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/connect_wise/models/company.rb', line 609

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



597
598
599
# File 'lib/connect_wise/models/company.rb', line 597

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



427
428
429
430
431
432
# File 'lib/connect_wise/models/company.rb', line 427

def valid?
  return false if @identifier.nil?
  return false if @name.nil?

  true
end