Class: ConnectWise::GLExportPurchaseTransactionDetailTax

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ GLExportPurchaseTransactionDetailTax

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#account_numberObject

Returns the value of attribute account_number.



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

def 
  @account_number
end

#cogs_xrefObject

Returns the value of attribute cogs_xref.



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

def cogs_xref
  @cogs_xref
end

#costObject

Returns the value of attribute cost.



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

def cost
  @cost
end

#cost_account_numberObject

Returns the value of attribute cost_account_number.



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

def 
  @cost_account_number
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#document_dateObject

Returns the value of attribute document_date.



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

def document_date
  @document_date
end

#drop_shipped_flagObject

Returns the value of attribute drop_shipped_flag.



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

def drop_shipped_flag
  @drop_shipped_flag
end

#gl_classObject

Returns the value of attribute gl_class.



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

def gl_class
  @gl_class
end

#gl_item_idObject

Returns the value of attribute gl_item_id.



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

def gl_item_id
  @gl_item_id
end

#gl_type_idObject

Returns the value of attribute gl_type_id.



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

def gl_type_id
  @gl_type_id
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#inventory_account_numberObject

Returns the value of attribute inventory_account_number.



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

def 
  @inventory_account_number
end

#inventory_xrefObject

Returns the value of attribute inventory_xref.



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

def inventory_xref
  @inventory_xref
end

#itemObject

Returns the value of attribute item.



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

def item
  @item
end

#item_costObject

Returns the value of attribute item_cost.



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

def item_cost
  @item_cost
end

#item_descriptionObject

Returns the value of attribute item_description.



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

def item_description
  @item_description
end

#item_priceObject

Returns the value of attribute item_price.



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

def item_price
  @item_price
end

#item_type_xrefObject

Returns the value of attribute item_type_xref.



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

def item_type_xref
  @item_type_xref
end

#line_numberObject

Returns the value of attribute line_number.



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

def line_number
  @line_number
end

#location_xrefObject

Returns the value of attribute location_xref.



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

def location_xref
  @location_xref
end

#memoObject

Returns the value of attribute memo.



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

def memo
  @memo
end

#price_level_xrefObject

Returns the value of attribute price_level_xref.



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

def price_level_xref
  @price_level_xref
end

#purchase_header_tax_groupObject

Returns the value of attribute purchase_header_tax_group.



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

def purchase_header_tax_group
  @purchase_header_tax_group
end

#quantityObject

Returns the value of attribute quantity.



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

def quantity
  @quantity
end

#sales_codeObject

Returns the value of attribute sales_code.



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

def sales_code
  @sales_code
end

#sales_descriptionObject

Returns the value of attribute sales_description.



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

def sales_description
  @sales_description
end

#serial_numbersObject

Returns the value of attribute serial_numbers.



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

def serial_numbers
  @serial_numbers
end

#serialized_flagObject

Returns the value of attribute serialized_flag.



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

def serialized_flag
  @serialized_flag
end

#shipment_methodObject

Returns the value of attribute shipment_method.



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

def shipment_method
  @shipment_method
end

#sub_categoryObject

Returns the value of attribute sub_category.



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

def sub_category
  @sub_category
end

#tax_agency_xrefObject

Returns the value of attribute tax_agency_xref.



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

def tax_agency_xref
  @tax_agency_xref
end

#tax_codeObject

Returns the value of attribute tax_code.



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

def tax_code
  @tax_code
end

#tax_noteObject

Returns the value of attribute tax_note.



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

def tax_note
  @tax_note
end

#tax_rateObject

Returns the value of attribute tax_rate.



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

def tax_rate
  @tax_rate
end

#tax_rate_percentObject

Returns the value of attribute tax_rate_percent.



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

def tax_rate_percent
  @tax_rate_percent
end

#taxable_flagObject

Returns the value of attribute taxable_flag.



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

def taxable_flag
  @taxable_flag
end

#totalObject

Returns the value of attribute total.



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

def total
  @total
end

#unit_of_measureObject

Returns the value of attribute unit_of_measure.



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

def unit_of_measure
  @unit_of_measure
end

#uom_schedule_xrefObject

Returns the value of attribute uom_schedule_xref.



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

def uom_schedule_xref
  @uom_schedule_xref
end

#vendor_account_numberObject

Returns the value of attribute vendor_account_number.



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

def 
  @vendor_account_number
end

#vendor_numberObject

Returns the value of attribute vendor_number.



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

def vendor_number
  @vendor_number
end

#warehouse_binObject

Returns the value of attribute warehouse_bin.



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

def warehouse_bin
  @warehouse_bin
end

#warehouse_siteObject

Returns the value of attribute warehouse_site.



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

def warehouse_site
  @warehouse_site
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'document_date' => :'documentDate',
    :'account_number' => :'accountNumber',
    :'gl_class' => :'glClass',
    :'cost' => :'cost',
    :'sales_code' => :'salesCode',
    :'gl_type_id' => :'glTypeId',
    :'gl_item_id' => :'glItemId',
    :'memo' => :'memo',
    :'vendor_number' => :'vendorNumber',
    :'vendor_account_number' => :'vendorAccountNumber',
    :'cost_account_number' => :'costAccountNumber',
    :'inventory_account_number' => :'inventoryAccountNumber',
    :'item_type_xref' => :'itemTypeXref',
    :'inventory_xref' => :'inventoryXref',
    :'cogs_xref' => :'cogsXref',
    :'uom_schedule_xref' => :'uomScheduleXref',
    :'price_level_xref' => :'priceLevelXref',
    :'location_xref' => :'locationXref',
    :'item' => :'item',
    :'taxable_flag' => :'taxableFlag',
    :'sales_description' => :'salesDescription',
    :'item_description' => :'itemDescription',
    :'item_price' => :'itemPrice',
    :'item_cost' => :'itemCost',
    :'unit_of_measure' => :'unitOfMeasure',
    :'quantity' => :'quantity',
    :'total' => :'total',
    :'currency' => :'currency',
    :'serialized_flag' => :'serializedFlag',
    :'serial_numbers' => :'serialNumbers',
    :'drop_shipped_flag' => :'dropShippedFlag',
    :'line_number' => :'lineNumber',
    :'warehouse_site' => :'warehouseSite',
    :'warehouse_bin' => :'warehouseBin',
    :'shipment_method' => :'shipmentMethod',
    :'sub_category' => :'subCategory',
    :'tax_code' => :'taxCode',
    :'tax_rate' => :'taxRate',
    :'tax_rate_percent' => :'taxRatePercent',
    :'tax_agency_xref' => :'taxAgencyXref',
    :'tax_note' => :'taxNote',
    :'purchase_header_tax_group' => :'purchaseHeaderTaxGroup'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'id' => :'Integer',
    :'document_date' => :'DateTime',
    :'account_number' => :'String',
    :'gl_class' => :'String',
    :'cost' => :'Float',
    :'sales_code' => :'String',
    :'gl_type_id' => :'String',
    :'gl_item_id' => :'String',
    :'memo' => :'String',
    :'vendor_number' => :'String',
    :'vendor_account_number' => :'String',
    :'cost_account_number' => :'String',
    :'inventory_account_number' => :'String',
    :'item_type_xref' => :'String',
    :'inventory_xref' => :'String',
    :'cogs_xref' => :'String',
    :'uom_schedule_xref' => :'String',
    :'price_level_xref' => :'String',
    :'location_xref' => :'String',
    :'item' => :'IvItemReference',
    :'taxable_flag' => :'BOOLEAN',
    :'sales_description' => :'String',
    :'item_description' => :'String',
    :'item_price' => :'Float',
    :'item_cost' => :'Float',
    :'unit_of_measure' => :'UnitOfMeasureReference',
    :'quantity' => :'Float',
    :'total' => :'Float',
    :'currency' => :'CurrencyReference',
    :'serialized_flag' => :'BOOLEAN',
    :'serial_numbers' => :'String',
    :'drop_shipped_flag' => :'BOOLEAN',
    :'line_number' => :'Integer',
    :'warehouse_site' => :'SiteReference',
    :'warehouse_bin' => :'WarehouseBinReference',
    :'shipment_method' => :'ShipmentMethodReference',
    :'sub_category' => :'ProductSubCategoryReference',
    :'tax_code' => :'TaxCodeReference',
    :'tax_rate' => :'Float',
    :'tax_rate_percent' => :'Float',
    :'tax_agency_xref' => :'String',
    :'tax_note' => :'String',
    :'purchase_header_tax_group' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      document_date == o.document_date &&
       == o. &&
      gl_class == o.gl_class &&
      cost == o.cost &&
      sales_code == o.sales_code &&
      gl_type_id == o.gl_type_id &&
      gl_item_id == o.gl_item_id &&
      memo == o.memo &&
      vendor_number == o.vendor_number &&
       == o. &&
       == o. &&
       == o. &&
      item_type_xref == o.item_type_xref &&
      inventory_xref == o.inventory_xref &&
      cogs_xref == o.cogs_xref &&
      uom_schedule_xref == o.uom_schedule_xref &&
      price_level_xref == o.price_level_xref &&
      location_xref == o.location_xref &&
      item == o.item &&
      taxable_flag == o.taxable_flag &&
      sales_description == o.sales_description &&
      item_description == o.item_description &&
      item_price == o.item_price &&
      item_cost == o.item_cost &&
      unit_of_measure == o.unit_of_measure &&
      quantity == o.quantity &&
      total == o.total &&
      currency == o.currency &&
      serialized_flag == o.serialized_flag &&
      serial_numbers == o.serial_numbers &&
      drop_shipped_flag == o.drop_shipped_flag &&
      line_number == o.line_number &&
      warehouse_site == o.warehouse_site &&
      warehouse_bin == o.warehouse_bin &&
      shipment_method == o.shipment_method &&
      sub_category == o.sub_category &&
      tax_code == o.tax_code &&
      tax_rate == o.tax_rate &&
      tax_rate_percent == o.tax_rate_percent &&
      tax_agency_xref == o.tax_agency_xref &&
      tax_note == o.tax_note &&
      purchase_header_tax_group == o.purchase_header_tax_group
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



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/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 473

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



539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 539

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



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 452

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


439
440
441
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 439

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



445
446
447
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 445

def hash
  [id, document_date, , gl_class, cost, sales_code, gl_type_id, gl_item_id, memo, vendor_number, , , , item_type_xref, inventory_xref, cogs_xref, uom_schedule_xref, price_level_xref, location_xref, item, taxable_flag, sales_description, item_description, item_price, item_cost, unit_of_measure, quantity, total, currency, serialized_flag, serial_numbers, drop_shipped_flag, line_number, warehouse_site, warehouse_bin, shipment_method, sub_category, tax_code, tax_rate, tax_rate_percent, tax_agency_xref, tax_note, purchase_header_tax_group].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



376
377
378
379
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 376

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



519
520
521
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 519

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



525
526
527
528
529
530
531
532
533
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 525

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



513
514
515
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 513

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



383
384
385
# File 'lib/connectwise-ruby-sdk/models/gl_export_purchase_transaction_detail_tax.rb', line 383

def valid?
  return true
end