Class: ConnectWise::UnpostedProcurement

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UnpostedProcurement

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 214

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?(:'description')
    self.description = attributes[:'description']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#_infoObject

Metadata of the entity



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

def _info
  @_info
end

#avalara_tax_flagObject

Used to determine if Avalara tax is enabled.



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

def avalara_tax_flag
  @avalara_tax_flag
end

#billing_termsObject

Returns the value of attribute billing_terms.



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

def billing_terms
  @billing_terms
end

#city_tax_amountObject

Returns the value of attribute city_tax_amount.



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

def city_tax_amount
  @city_tax_amount
end

#city_tax_flagObject

Set to true if transaction is taxable at the city level.



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

def city_tax_flag
  @city_tax_flag
end

#city_tax_xrefObject

Returns the value of attribute city_tax_xref.



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

def city_tax_xref
  @city_tax_xref
end

#composite_tax_amountObject

Returns the value of attribute composite_tax_amount.



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

def composite_tax_amount
  @composite_tax_amount
end

#composite_tax_flagObject

Set to true if transaction is taxable at the composite level.



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

def composite_tax_flag
  @composite_tax_flag
end

#composite_tax_xrefObject

Returns the value of attribute composite_tax_xref.



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

def composite_tax_xref
  @composite_tax_xref
end

#country_tax_amountObject

Returns the value of attribute country_tax_amount.



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

def country_tax_amount
  @country_tax_amount
end

#country_tax_flagObject

Set to true if transaction is taxable at the country level.



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

def country_tax_flag
  @country_tax_flag
end

#country_tax_xrefObject

Returns the value of attribute country_tax_xref.



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

def country_tax_xref
  @country_tax_xref
end

#county_tax_amountObject

Returns the value of attribute county_tax_amount.



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

def county_tax_amount
  @county_tax_amount
end

#county_tax_flagObject

Set to true if transaction is taxable at the county level.



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

def county_tax_flag
  @county_tax_flag
end

#county_tax_xrefObject

Returns the value of attribute county_tax_xref.



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

def county_tax_xref
  @county_tax_xref
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#customerObject

Returns the value of attribute customer.



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

def customer
  @customer
end

#date_closedObject

Returns the value of attribute date_closed.



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

def date_closed
  @date_closed
end

#department_idObject

Returns the value of attribute department_id.



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

def department_id
  @department_id
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#freight_costObject

Returns the value of attribute freight_cost.



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

def freight_cost
  @freight_cost
end

#freight_tax_totalObject

Returns the value of attribute freight_tax_total.



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

def freight_tax_total
  @freight_tax_total
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#item_taxable_flagObject

Returns the value of attribute item_taxable_flag.



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

def item_taxable_flag
  @item_taxable_flag
end

#location_idObject

Returns the value of attribute location_id.



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

def location_id
  @location_id
end

#procurement_typeObject

Returns the value of attribute procurement_type.



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

def procurement_type
  @procurement_type
end

#purchase_dateObject

Returns the value of attribute purchase_date.



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

def purchase_date
  @purchase_date
end

#purchase_orderObject

Returns the value of attribute purchase_order.



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

def purchase_order
  @purchase_order
end

#purchase_order_taxable_flagObject

Returns the value of attribute purchase_order_taxable_flag.



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

def purchase_order_taxable_flag
  @purchase_order_taxable_flag
end

#state_tax_amountObject

Returns the value of attribute state_tax_amount.



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

def state_tax_amount
  @state_tax_amount
end

#state_tax_flagObject

Set to true if transaction is taxable at the state level.



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

def state_tax_flag
  @state_tax_flag
end

#state_tax_xrefObject

Returns the value of attribute state_tax_xref.



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

def state_tax_xref
  @state_tax_xref
end

#tax_codeObject

Returns the value of attribute tax_code.



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

def tax_code
  @tax_code
end

#tax_freight_flagObject

Returns the value of attribute tax_freight_flag.



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

def tax_freight_flag
  @tax_freight_flag
end

#tax_totalObject

Returns the value of attribute tax_total.



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

def tax_total
  @tax_total
end

#totalObject

Returns the value of attribute total.



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

def total
  @total
end

#tracking_numberObject

Returns the value of attribute tracking_number.



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

def tracking_number
  @tracking_number
end

#vendorObject

Returns the value of attribute vendor.



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

def vendor
  @vendor
end

#vendor_account_numberObject

Returns the value of attribute vendor_account_number.



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

def 
  @vendor_account_number
end

#vendor_invoice_dateObject

Returns the value of attribute vendor_invoice_date.



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

def vendor_invoice_date
  @vendor_invoice_date
end

#vendor_invoice_numberObject

Returns the value of attribute vendor_invoice_number.



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

def vendor_invoice_number
  @vendor_invoice_number
end

Class Method Details

.attribute_mapObject

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



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
158
159
160
161
162
163
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 119

def self.attribute_map
  {
    :'id' => :'id',
    :'description' => :'description',
    :'location_id' => :'locationId',
    :'department_id' => :'departmentId',
    :'procurement_type' => :'procurementType',
    :'purchase_order' => :'purchaseOrder',
    :'purchase_date' => :'purchaseDate',
    :'tracking_number' => :'trackingNumber',
    :'billing_terms' => :'billingTerms',
    :'currency' => :'currency',
    :'total' => :'total',
    :'tax_code' => :'taxCode',
    :'avalara_tax_flag' => :'avalaraTaxFlag',
    :'item_taxable_flag' => :'itemTaxableFlag',
    :'purchase_order_taxable_flag' => :'purchaseOrderTaxableFlag',
    :'state_tax_flag' => :'stateTaxFlag',
    :'state_tax_xref' => :'stateTaxXref',
    :'state_tax_amount' => :'stateTaxAmount',
    :'county_tax_flag' => :'countyTaxFlag',
    :'county_tax_xref' => :'countyTaxXref',
    :'county_tax_amount' => :'countyTaxAmount',
    :'city_tax_flag' => :'cityTaxFlag',
    :'city_tax_xref' => :'cityTaxXref',
    :'city_tax_amount' => :'cityTaxAmount',
    :'country_tax_flag' => :'countryTaxFlag',
    :'country_tax_xref' => :'countryTaxXref',
    :'country_tax_amount' => :'countryTaxAmount',
    :'composite_tax_flag' => :'compositeTaxFlag',
    :'composite_tax_xref' => :'compositeTaxXref',
    :'composite_tax_amount' => :'compositeTaxAmount',
    :'tax_total' => :'taxTotal',
    :'customer' => :'customer',
    :'vendor' => :'vendor',
    :'vendor_account_number' => :'vendorAccountNumber',
    :'vendor_invoice_number' => :'vendorInvoiceNumber',
    :'vendor_invoice_date' => :'vendorInvoiceDate',
    :'tax_freight_flag' => :'taxFreightFlag',
    :'freight_tax_total' => :'freightTaxTotal',
    :'freight_cost' => :'freightCost',
    :'date_closed' => :'dateClosed',
    :'_info' => :'_info'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 166

def self.swagger_types
  {
    :'id' => :'Integer',
    :'description' => :'String',
    :'location_id' => :'Integer',
    :'department_id' => :'Integer',
    :'procurement_type' => :'String',
    :'purchase_order' => :'PurchaseOrderReference',
    :'purchase_date' => :'DateTime',
    :'tracking_number' => :'String',
    :'billing_terms' => :'BillingTermsReference',
    :'currency' => :'CurrencyReference',
    :'total' => :'Float',
    :'tax_code' => :'TaxCodeReference',
    :'avalara_tax_flag' => :'BOOLEAN',
    :'item_taxable_flag' => :'BOOLEAN',
    :'purchase_order_taxable_flag' => :'BOOLEAN',
    :'state_tax_flag' => :'BOOLEAN',
    :'state_tax_xref' => :'String',
    :'state_tax_amount' => :'Float',
    :'county_tax_flag' => :'BOOLEAN',
    :'county_tax_xref' => :'String',
    :'county_tax_amount' => :'Float',
    :'city_tax_flag' => :'BOOLEAN',
    :'city_tax_xref' => :'String',
    :'city_tax_amount' => :'Float',
    :'country_tax_flag' => :'BOOLEAN',
    :'country_tax_xref' => :'String',
    :'country_tax_amount' => :'Float',
    :'composite_tax_flag' => :'BOOLEAN',
    :'composite_tax_xref' => :'String',
    :'composite_tax_amount' => :'Float',
    :'tax_total' => :'Float',
    :'customer' => :'CompanyReference',
    :'vendor' => :'CompanyReference',
    :'vendor_account_number' => :'String',
    :'vendor_invoice_number' => :'String',
    :'vendor_invoice_date' => :'DateTime',
    :'tax_freight_flag' => :'BOOLEAN',
    :'freight_tax_total' => :'Float',
    :'freight_cost' => :'Float',
    :'date_closed' => :'DateTime',
    :'_info' => :'Metadata'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 413

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      description == o.description &&
      location_id == o.location_id &&
      department_id == o.department_id &&
      procurement_type == o.procurement_type &&
      purchase_order == o.purchase_order &&
      purchase_date == o.purchase_date &&
      tracking_number == o.tracking_number &&
      billing_terms == o.billing_terms &&
      currency == o.currency &&
      total == o.total &&
      tax_code == o.tax_code &&
      avalara_tax_flag == o.avalara_tax_flag &&
      item_taxable_flag == o.item_taxable_flag &&
      purchase_order_taxable_flag == o.purchase_order_taxable_flag &&
      state_tax_flag == o.state_tax_flag &&
      state_tax_xref == o.state_tax_xref &&
      state_tax_amount == o.state_tax_amount &&
      county_tax_flag == o.county_tax_flag &&
      county_tax_xref == o.county_tax_xref &&
      county_tax_amount == o.county_tax_amount &&
      city_tax_flag == o.city_tax_flag &&
      city_tax_xref == o.city_tax_xref &&
      city_tax_amount == o.city_tax_amount &&
      country_tax_flag == o.country_tax_flag &&
      country_tax_xref == o.country_tax_xref &&
      country_tax_amount == o.country_tax_amount &&
      composite_tax_flag == o.composite_tax_flag &&
      composite_tax_xref == o.composite_tax_xref &&
      composite_tax_amount == o.composite_tax_amount &&
      tax_total == o.tax_total &&
      customer == o.customer &&
      vendor == o.vendor &&
       == o. &&
      vendor_invoice_number == o.vendor_invoice_number &&
      vendor_invoice_date == o.vendor_invoice_date &&
      tax_freight_flag == o.tax_freight_flag &&
      freight_tax_total == o.freight_tax_total &&
      freight_cost == o.freight_cost &&
      date_closed == o.date_closed &&
      _info == o._info
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



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
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 495

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



561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 561

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



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 474

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


461
462
463
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 461

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



467
468
469
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 467

def hash
  [id, description, location_id, department_id, procurement_type, purchase_order, purchase_date, tracking_number, billing_terms, currency, total, tax_code, avalara_tax_flag, item_taxable_flag, purchase_order_taxable_flag, state_tax_flag, state_tax_xref, state_tax_amount, county_tax_flag, county_tax_xref, county_tax_amount, city_tax_flag, city_tax_xref, city_tax_amount, country_tax_flag, country_tax_xref, country_tax_amount, composite_tax_flag, composite_tax_xref, composite_tax_amount, tax_total, customer, vendor, , vendor_invoice_number, vendor_invoice_date, tax_freight_flag, freight_tax_total, freight_cost, date_closed, _info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



388
389
390
391
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 388

def list_invalid_properties
  invalid_properties = Array.new
  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



541
542
543
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 541

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



547
548
549
550
551
552
553
554
555
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 547

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



535
536
537
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 535

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



395
396
397
398
399
# File 'lib/connectwise-ruby-sdk/models/unposted_procurement.rb', line 395

def valid?
  procurement_type_validator = EnumAttributeValidator.new('String', ["Purchase", "Adjustment", "Transfer"])
  return false unless procurement_type_validator.valid?(@procurement_type)
  return true
end