Class: ConnectWise::GLExportTransactionDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/connect_wise/models/gl_export_transaction_detail.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ GLExportTransactionDetail

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Raises:

  • (ArgumentError)


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

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::GLExportTransactionDetail` 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::GLExportTransactionDetail`. 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.id = attributes[:id] if attributes.key?(:id)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  self.tax_levels = value
end

Instance Attribute Details

#account_numberObject

Returns the value of attribute account_number.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def 
  @account_number
end

#cogs_xrefObject

Returns the value of attribute cogs_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def cogs_xref
  @cogs_xref
end

#costObject

Returns the value of attribute cost.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def cost
  @cost
end

#cost_account_numberObject

Returns the value of attribute cost_account_number.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def 
  
end

#currencyObject

Returns the value of attribute currency.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def currency
  @currency
end

#descriptionObject

Returns the value of attribute description.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def description
  @description
end

#document_dateObject

Returns the value of attribute document_date.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def document_date
  @document_date
end

#document_typeObject

Returns the value of attribute document_type.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def document_type
  @document_type
end

#drop_shipped_flagObject

Returns the value of attribute drop_shipped_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def drop_shipped_flag
  @drop_shipped_flag
end

#gl_classObject

Returns the value of attribute gl_class.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def gl_class
  @gl_class
end

#gl_item_idObject

Returns the value of attribute gl_item_id.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def gl_item_id
  @gl_item_id
end

#gl_type_idObject

Returns the value of attribute gl_type_id.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def gl_type_id
  @gl_type_id
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def id
  @id
end

#inventory_account_numberObject

Returns the value of attribute inventory_account_number.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def 
  
end

#inventory_xrefObject

Returns the value of attribute inventory_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def inventory_xref
  @inventory_xref
end

#invoice_summary_optionObject

Returns the value of attribute invoice_summary_option.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def invoice_summary_option
  @invoice_summary_option
end

#itemObject

Returns the value of attribute item.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item
  @item
end

#item_costObject

Returns the value of attribute item_cost.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item_cost
  @item_cost
end

#item_descriptionObject

Returns the value of attribute item_description.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item_description
  @item_description
end

#item_priceObject

Returns the value of attribute item_price.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item_price
  @item_price
end

#item_taxable_flagObject

Returns the value of attribute item_taxable_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item_taxable_flag
  @item_taxable_flag
end

#item_type_xrefObject

Returns the value of attribute item_type_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def item_type_xref
  @item_type_xref
end

#location_xrefObject

Returns the value of attribute location_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def location_xref
  @location_xref
end

#memoObject

Returns the value of attribute memo.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def memo
  @memo
end

#price_level_xrefObject

Returns the value of attribute price_level_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def price_level_xref
  @price_level_xref
end

#productObject

Returns the value of attribute product.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def product
  @product
end

#product_account_numberObject

Returns the value of attribute product_account_number.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def 
  
end

#quantityObject

Returns the value of attribute quantity.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def quantity
  @quantity
end

#sales_codeObject

Returns the value of attribute sales_code.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def sales_code
  @sales_code
end

#sales_descriptionObject

Returns the value of attribute sales_description.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def sales_description
  @sales_description
end

#serial_numbersObject

Returns the value of attribute serial_numbers.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def serial_numbers
  @serial_numbers
end

#serialized_flagObject

Returns the value of attribute serialized_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def serialized_flag
  @serialized_flag
end

#shipment_methodObject

Returns the value of attribute shipment_method.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def shipment_method
  @shipment_method
end

#sub_categoryObject

Returns the value of attribute sub_category.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def sub_category
  @sub_category
end

#tax_agency_xrefObject

Returns the value of attribute tax_agency_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_agency_xref
  @tax_agency_xref
end

#tax_codeObject

Returns the value of attribute tax_code.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_code
  @tax_code
end

#tax_code_xrefObject

Returns the value of attribute tax_code_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_code_xref
  @tax_code_xref
end

#tax_levelsObject

Returns the value of attribute tax_levels.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_levels
  @tax_levels
end

#tax_noteObject

Returns the value of attribute tax_note.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_note
  @tax_note
end

#tax_rateObject

Returns the value of attribute tax_rate.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_rate
  @tax_rate
end

#tax_rate_percentObject

Returns the value of attribute tax_rate_percent.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def tax_rate_percent
  @tax_rate_percent
end

#taxable2_flagObject

Returns the value of attribute taxable2_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def taxable2_flag
  @taxable2_flag
end

#taxable3_flagObject

Returns the value of attribute taxable3_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def taxable3_flag
  @taxable3_flag
end

#taxable4_flagObject

Returns the value of attribute taxable4_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def taxable4_flag
  @taxable4_flag
end

#taxable5_flagObject

Returns the value of attribute taxable5_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def taxable5_flag
  @taxable5_flag
end

#taxable_flagObject

Returns the value of attribute taxable_flag.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def taxable_flag
  @taxable_flag
end

#time_entryObject

Returns the value of attribute time_entry.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def time_entry
  @time_entry
end

#totalObject

Returns the value of attribute total.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def total
  @total
end

#unit_of_measureObject

Returns the value of attribute unit_of_measure.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def unit_of_measure
  @unit_of_measure
end

#uom_schedule_xrefObject

Returns the value of attribute uom_schedule_xref.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def uom_schedule_xref
  @uom_schedule_xref
end

#warehouse_binObject

Returns the value of attribute warehouse_bin.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def warehouse_bin
  @warehouse_bin
end

#warehouse_siteObject

Returns the value of attribute warehouse_site.



16
17
18
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 16

def warehouse_site
  @warehouse_site
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



77
78
79
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 77

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 19

def self.attribute_map
  {
    id: :id,
    document_date: :documentDate,
    document_type: :documentType,
    account_number: :accountNumber,
    gl_class: :glClass,
    gl_type_id: :glTypeId,
    gl_item_id: :glItemId,
    invoice_summary_option: :invoiceSummaryOption,
    cost: :cost,
    sales_code: :salesCode,
    memo: :memo,
    description: :description,
    quantity: :quantity,
    total: :total,
    currency: :currency,
    time_entry: :timeEntry,
    cost_account_number: :costAccountNumber,
    inventory_account_number: :inventoryAccountNumber,
    product_account_number: :productAccountNumber,
    tax_code: :taxCode,
    tax_code_xref: :taxCodeXref,
    tax_agency_xref: :taxAgencyXref,
    tax_note: :taxNote,
    tax_rate: :taxRate,
    tax_rate_percent: :taxRatePercent,
    taxable_flag: :taxableFlag,
    taxable2_flag: :taxable2Flag,
    taxable3_flag: :taxable3Flag,
    taxable4_flag: :taxable4Flag,
    taxable5_flag: :taxable5Flag,
    item: :item,
    product: :product,
    item_taxable_flag: :itemTaxableFlag,
    item_price: :itemPrice,
    item_cost: :itemCost,
    item_description: :itemDescription,
    sales_description: :salesDescription,
    unit_of_measure: :unitOfMeasure,
    sub_category: :subCategory,
    serialized_flag: :serializedFlag,
    serial_numbers: :serialNumbers,
    warehouse_site: :warehouseSite,
    warehouse_bin: :warehouseBin,
    shipment_method: :shipmentMethod,
    drop_shipped_flag: :dropShippedFlag,
    item_type_xref: :itemTypeXref,
    inventory_xref: :inventoryXref,
    cogs_xref: :cogsXref,
    uom_schedule_xref: :uomScheduleXref,
    price_level_xref: :priceLevelXref,
    location_xref: :locationXref,
    tax_levels: :taxLevels
  }
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



368
369
370
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 368

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

.openapi_nullableObject

List of attributes with nullable: true



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 140

def self.openapi_nullable
  Set.new(i[
            id
            cost
            quantity
            total
            tax_rate
            tax_rate_percent
            taxable_flag
            taxable2_flag
            taxable3_flag
            taxable4_flag
            taxable5_flag
            item_taxable_flag
            item_price
            item_cost
            serialized_flag
            drop_shipped_flag
          ])
end

.openapi_typesObject

Attribute type mapping.



82
83
84
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
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 82

def self.openapi_types
  {
    id: :Integer,
    document_date: :String,
    document_type: :String,
    account_number: :String,
    gl_class: :String,
    gl_type_id: :String,
    gl_item_id: :String,
    invoice_summary_option: :String,
    cost: :Float,
    sales_code: :String,
    memo: :String,
    description: :String,
    quantity: :Float,
    total: :Float,
    currency: :CurrencyReference,
    time_entry: :TimeEntryReference,
    cost_account_number: :String,
    inventory_account_number: :String,
    product_account_number: :String,
    tax_code: :TaxCodeReference,
    tax_code_xref: :String,
    tax_agency_xref: :String,
    tax_note: :String,
    tax_rate: :Float,
    tax_rate_percent: :Float,
    taxable_flag: :Boolean,
    taxable2_flag: :Boolean,
    taxable3_flag: :Boolean,
    taxable4_flag: :Boolean,
    taxable5_flag: :Boolean,
    item: :IvItemReference,
    product: :ProductReference,
    item_taxable_flag: :Boolean,
    item_price: :Float,
    item_cost: :Float,
    item_description: :String,
    sales_description: :String,
    unit_of_measure: :UnitOfMeasureReference,
    sub_category: :ProductSubCategoryReference,
    serialized_flag: :Boolean,
    serial_numbers: :String,
    warehouse_site: :SiteReference,
    warehouse_bin: :WarehouseBinReference,
    shipment_method: :ShipmentMethodReference,
    drop_shipped_flag: :Boolean,
    item_type_xref: :String,
    inventory_xref: :String,
    cogs_xref: :String,
    uom_schedule_xref: :String,
    price_level_xref: :String,
    location_xref: :String,
    tax_levels: :'Array<GLExportTransactionDetailTaxLevel>'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

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

  self.class == other.class &&
    id == other.id &&
    document_date == other.document_date &&
    document_type == other.document_type &&
     == other. &&
    gl_class == other.gl_class &&
    gl_type_id == other.gl_type_id &&
    gl_item_id == other.gl_item_id &&
    invoice_summary_option == other.invoice_summary_option &&
    cost == other.cost &&
    sales_code == other.sales_code &&
    memo == other.memo &&
    description == other.description &&
    quantity == other.quantity &&
    total == other.total &&
    currency == other.currency &&
    time_entry == other.time_entry &&
     == other. &&
     == other. &&
     == other. &&
    tax_code == other.tax_code &&
    tax_code_xref == other.tax_code_xref &&
    tax_agency_xref == other.tax_agency_xref &&
    tax_note == other.tax_note &&
    tax_rate == other.tax_rate &&
    tax_rate_percent == other.tax_rate_percent &&
    taxable_flag == other.taxable_flag &&
    taxable2_flag == other.taxable2_flag &&
    taxable3_flag == other.taxable3_flag &&
    taxable4_flag == other.taxable4_flag &&
    taxable5_flag == other.taxable5_flag &&
    item == other.item &&
    product == other.product &&
    item_taxable_flag == other.item_taxable_flag &&
    item_price == other.item_price &&
    item_cost == other.item_cost &&
    item_description == other.item_description &&
    sales_description == other.sales_description &&
    unit_of_measure == other.unit_of_measure &&
    sub_category == other.sub_category &&
    serialized_flag == other.serialized_flag &&
    serial_numbers == other.serial_numbers &&
    warehouse_site == other.warehouse_site &&
    warehouse_bin == other.warehouse_bin &&
    shipment_method == other.shipment_method &&
    drop_shipped_flag == other.drop_shipped_flag &&
    item_type_xref == other.item_type_xref &&
    inventory_xref == other.inventory_xref &&
    cogs_xref == other.cogs_xref &&
    uom_schedule_xref == other.uom_schedule_xref &&
    price_level_xref == other.price_level_xref &&
    location_xref == other.location_xref &&
    tax_levels == other.tax_levels
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



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/connect_wise/models/gl_export_transaction_detail.rb', line 398

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



469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 469

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



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 375

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


355
356
357
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 355

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



361
362
363
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 361

def hash
  [id, document_date, document_type, , gl_class, gl_type_id, gl_item_id, invoice_summary_option, cost, sales_code, memo, description, quantity, total, currency, time_entry, , , , tax_code, tax_code_xref, tax_agency_xref, tax_note, tax_rate, tax_rate_percent, taxable_flag, taxable2_flag, taxable3_flag, taxable4_flag, taxable5_flag, item, product, item_taxable_flag, item_price, item_cost, item_description, sales_description, unit_of_measure, sub_category, serialized_flag, serial_numbers, warehouse_site, warehouse_bin, shipment_method, drop_shipped_flag, item_type_xref, inventory_xref, cogs_xref, uom_schedule_xref, price_level_xref, location_xref, tax_levels].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



283
284
285
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 283

def list_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



445
446
447
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 445

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



451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 451

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



439
440
441
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 439

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



289
290
291
# File 'lib/connect_wise/models/gl_export_transaction_detail.rb', line 289

def valid?
  true
end