merge_accounting_client 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +224 -229
  3. data/docs/CreditNote.md +1 -1
  4. data/docs/CreditNoteLineItem.md +1 -1
  5. data/docs/Expense.md +1 -1
  6. data/docs/ExpenseLine.md +4 -2
  7. data/docs/ExpenseLineRequest.md +4 -2
  8. data/docs/ExpenseRequest.md +1 -1
  9. data/docs/Invoice.md +1 -1
  10. data/docs/InvoiceLineItem.md +2 -2
  11. data/docs/InvoiceLineItemRequest.md +2 -2
  12. data/docs/InvoiceRequest.md +18 -18
  13. data/docs/JournalEntry.md +2 -2
  14. data/docs/JournalEntryRequest.md +10 -10
  15. data/docs/JournalLine.md +4 -2
  16. data/docs/JournalLineRequest.md +4 -2
  17. data/docs/PurchaseOrder.md +2 -2
  18. data/docs/PurchaseOrderLineItem.md +2 -0
  19. data/docs/PurchaseOrderLineItemRequest.md +2 -0
  20. data/docs/PurchaseOrderRequest.md +12 -12
  21. data/docs/SyncStatusApi.md +11 -15
  22. data/docs/Transaction.md +4 -2
  23. data/docs/TransactionLineItem.md +2 -0
  24. data/docs/VendorCredit.md +2 -2
  25. data/docs/VendorCreditLine.md +3 -1
  26. data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
  27. data/lib/merge_accounting_client/api/transactions_api.rb +2 -2
  28. data/lib/merge_accounting_client/models/account_integration.rb +3 -3
  29. data/lib/merge_accounting_client/models/credit_note_line_item.rb +9 -9
  30. data/lib/merge_accounting_client/models/expense.rb +3 -3
  31. data/lib/merge_accounting_client/models/expense_line.rb +37 -9
  32. data/lib/merge_accounting_client/models/expense_line_request.rb +37 -9
  33. data/lib/merge_accounting_client/models/expense_request.rb +3 -3
  34. data/lib/merge_accounting_client/models/invoice.rb +3 -3
  35. data/lib/merge_accounting_client/models/invoice_line_item.rb +15 -15
  36. data/lib/merge_accounting_client/models/invoice_line_item_request.rb +15 -15
  37. data/lib/merge_accounting_client/models/invoice_request.rb +3 -3
  38. data/lib/merge_accounting_client/models/journal_entry.rb +3 -3
  39. data/lib/merge_accounting_client/models/journal_entry_request.rb +3 -3
  40. data/lib/merge_accounting_client/models/journal_line.rb +37 -9
  41. data/lib/merge_accounting_client/models/journal_line_request.rb +37 -9
  42. data/lib/merge_accounting_client/models/payment.rb +3 -3
  43. data/lib/merge_accounting_client/models/payment_request.rb +3 -3
  44. data/lib/merge_accounting_client/models/purchase_order.rb +3 -3
  45. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +21 -10
  46. data/lib/merge_accounting_client/models/purchase_order_line_item_request.rb +21 -10
  47. data/lib/merge_accounting_client/models/purchase_order_request.rb +3 -3
  48. data/lib/merge_accounting_client/models/sync_status_status_enum.rb +2 -1
  49. data/lib/merge_accounting_client/models/transaction.rb +18 -7
  50. data/lib/merge_accounting_client/models/transaction_line_item.rb +24 -13
  51. data/lib/merge_accounting_client/models/vendor_credit.rb +3 -3
  52. data/lib/merge_accounting_client/models/vendor_credit_line.rb +33 -5
  53. data/lib/merge_accounting_client/version.rb +1 -1
  54. data/spec/api/sync_status_api_spec.rb +1 -1
  55. data/spec/models/expense_line_request_spec.rb +7 -1
  56. data/spec/models/expense_line_spec.rb +7 -1
  57. data/spec/models/invoice_line_item_request_spec.rb +6 -6
  58. data/spec/models/invoice_line_item_spec.rb +6 -6
  59. data/spec/models/journal_line_request_spec.rb +7 -1
  60. data/spec/models/journal_line_spec.rb +7 -1
  61. data/spec/models/purchase_order_line_item_request_spec.rb +6 -0
  62. data/spec/models/purchase_order_line_item_spec.rb +6 -0
  63. data/spec/models/transaction_line_item_spec.rb +6 -0
  64. data/spec/models/transaction_spec.rb +6 -0
  65. data/spec/models/vendor_credit_line_spec.rb +6 -0
  66. metadata +146 -146
@@ -152,7 +152,7 @@ module MergeAccountingClient
152
152
  def list_invalid_properties
153
153
  invalid_properties = Array.new
154
154
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
155
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
155
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
156
156
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
157
157
  end
158
158
 
@@ -162,7 +162,7 @@ module MergeAccountingClient
162
162
  # Check to see if the all the properties in the model are valid
163
163
  # @return true if the model is valid
164
164
  def valid?
165
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
165
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
166
166
  true
167
167
  end
168
168
 
@@ -170,7 +170,7 @@ module MergeAccountingClient
170
170
  # @param [Object] exchange_rate Value to be assigned
171
171
  def exchange_rate=(exchange_rate)
172
172
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
173
- if !exchange_rate.nil? && exchange_rate !~ pattern
173
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
174
174
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
175
175
  end
176
176
 
@@ -249,7 +249,7 @@ module MergeAccountingClient
249
249
  def list_invalid_properties
250
250
  invalid_properties = Array.new
251
251
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
252
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
252
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
253
253
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
254
254
  end
255
255
 
@@ -259,7 +259,7 @@ module MergeAccountingClient
259
259
  # Check to see if the all the properties in the model are valid
260
260
  # @return true if the model is valid
261
261
  def valid?
262
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
262
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
263
263
  true
264
264
  end
265
265
 
@@ -267,7 +267,7 @@ module MergeAccountingClient
267
267
  # @param [Object] exchange_rate Value to be assigned
268
268
  def exchange_rate=(exchange_rate)
269
269
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
270
- if !exchange_rate.nil? && exchange_rate !~ pattern
270
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
271
271
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
272
272
  end
273
273
 
@@ -16,6 +16,9 @@ require 'time'
16
16
  module MergeAccountingClient
17
17
  # # The PurchaseOrderLineItem Object ### Description The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. ### Usage Example Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders.
18
18
  class PurchaseOrderLineItem
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
19
22
  # A description of the good being purchased.
20
23
  attr_accessor :description
21
24
 
@@ -54,6 +57,7 @@ module MergeAccountingClient
54
57
  # Attribute mapping from ruby-style variable name to JSON key.
55
58
  def self.attribute_map
56
59
  {
60
+ :'remote_id' => :'remote_id',
57
61
  :'description' => :'description',
58
62
  :'unit_price' => :'unit_price',
59
63
  :'quantity' => :'quantity',
@@ -77,6 +81,7 @@ module MergeAccountingClient
77
81
  # Attribute type mapping.
78
82
  def self.openapi_types
79
83
  {
84
+ :'remote_id' => :'String',
80
85
  :'description' => :'String',
81
86
  :'unit_price' => :'Float',
82
87
  :'quantity' => :'Float',
@@ -95,6 +100,7 @@ module MergeAccountingClient
95
100
  # List of attributes with nullable: true
96
101
  def self.openapi_nullable
97
102
  Set.new([
103
+ :'remote_id',
98
104
  :'description',
99
105
  :'unit_price',
100
106
  :'quantity',
@@ -124,6 +130,10 @@ module MergeAccountingClient
124
130
  h[k.to_sym] = v
125
131
  }
126
132
 
133
+ if attributes.key?(:'remote_id')
134
+ self.remote_id = attributes[:'remote_id']
135
+ end
136
+
127
137
  if attributes.key?(:'description')
128
138
  self.description = attributes[:'description']
129
139
  end
@@ -184,17 +194,17 @@ module MergeAccountingClient
184
194
  end
185
195
 
186
196
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
187
- if !@tax_amount.nil? && @tax_amount !~ pattern
197
+ if !@tax_amount.nil? && @tax_amount.to_s !~ pattern
188
198
  invalid_properties.push("invalid value for \"tax_amount\", must conform to the pattern #{pattern}.")
189
199
  end
190
200
 
191
201
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
192
- if !@total_line_amount.nil? && @total_line_amount !~ pattern
202
+ if !@total_line_amount.nil? && @total_line_amount.to_s !~ pattern
193
203
  invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
194
204
  end
195
205
 
196
206
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
197
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
207
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
198
208
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
199
209
  end
200
210
 
@@ -205,9 +215,9 @@ module MergeAccountingClient
205
215
  # @return true if the model is valid
206
216
  def valid?
207
217
  return false if @tracking_categories.nil?
208
- return false if !@tax_amount.nil? && @tax_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
209
- return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
210
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
218
+ return false if !@tax_amount.nil? && @tax_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
219
+ return false if !@total_line_amount.nil? && @total_line_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
220
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
211
221
  true
212
222
  end
213
223
 
@@ -215,7 +225,7 @@ module MergeAccountingClient
215
225
  # @param [Object] tax_amount Value to be assigned
216
226
  def tax_amount=(tax_amount)
217
227
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
218
- if !tax_amount.nil? && tax_amount !~ pattern
228
+ if !tax_amount.nil? && tax_amount.to_s !~ pattern
219
229
  fail ArgumentError, "invalid value for \"tax_amount\", must conform to the pattern #{pattern}."
220
230
  end
221
231
 
@@ -226,7 +236,7 @@ module MergeAccountingClient
226
236
  # @param [Object] total_line_amount Value to be assigned
227
237
  def total_line_amount=(total_line_amount)
228
238
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
229
- if !total_line_amount.nil? && total_line_amount !~ pattern
239
+ if !total_line_amount.nil? && total_line_amount.to_s !~ pattern
230
240
  fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
231
241
  end
232
242
 
@@ -237,7 +247,7 @@ module MergeAccountingClient
237
247
  # @param [Object] exchange_rate Value to be assigned
238
248
  def exchange_rate=(exchange_rate)
239
249
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
240
- if !exchange_rate.nil? && exchange_rate !~ pattern
250
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
241
251
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
242
252
  end
243
253
 
@@ -249,6 +259,7 @@ module MergeAccountingClient
249
259
  def ==(o)
250
260
  return true if self.equal?(o)
251
261
  self.class == o.class &&
262
+ remote_id == o.remote_id &&
252
263
  description == o.description &&
253
264
  unit_price == o.unit_price &&
254
265
  quantity == o.quantity &&
@@ -272,7 +283,7 @@ module MergeAccountingClient
272
283
  # Calculates hash code according to all attributes.
273
284
  # @return [Integer] Hash code
274
285
  def hash
275
- [description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company].hash
286
+ [remote_id, description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company].hash
276
287
  end
277
288
 
278
289
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module MergeAccountingClient
17
17
  # # The PurchaseOrderLineItem Object ### Description The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. ### Usage Example Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders.
18
18
  class PurchaseOrderLineItemRequest
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
19
22
  # A description of the good being purchased.
20
23
  attr_accessor :description
21
24
 
@@ -58,6 +61,7 @@ module MergeAccountingClient
58
61
  # Attribute mapping from ruby-style variable name to JSON key.
59
62
  def self.attribute_map
60
63
  {
64
+ :'remote_id' => :'remote_id',
61
65
  :'description' => :'description',
62
66
  :'unit_price' => :'unit_price',
63
67
  :'quantity' => :'quantity',
@@ -83,6 +87,7 @@ module MergeAccountingClient
83
87
  # Attribute type mapping.
84
88
  def self.openapi_types
85
89
  {
90
+ :'remote_id' => :'String',
86
91
  :'description' => :'String',
87
92
  :'unit_price' => :'Float',
88
93
  :'quantity' => :'Float',
@@ -103,6 +108,7 @@ module MergeAccountingClient
103
108
  # List of attributes with nullable: true
104
109
  def self.openapi_nullable
105
110
  Set.new([
111
+ :'remote_id',
106
112
  :'description',
107
113
  :'unit_price',
108
114
  :'quantity',
@@ -134,6 +140,10 @@ module MergeAccountingClient
134
140
  h[k.to_sym] = v
135
141
  }
136
142
 
143
+ if attributes.key?(:'remote_id')
144
+ self.remote_id = attributes[:'remote_id']
145
+ end
146
+
137
147
  if attributes.key?(:'description')
138
148
  self.description = attributes[:'description']
139
149
  end
@@ -206,17 +216,17 @@ module MergeAccountingClient
206
216
  end
207
217
 
208
218
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
209
- if !@tax_amount.nil? && @tax_amount !~ pattern
219
+ if !@tax_amount.nil? && @tax_amount.to_s !~ pattern
210
220
  invalid_properties.push("invalid value for \"tax_amount\", must conform to the pattern #{pattern}.")
211
221
  end
212
222
 
213
223
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
214
- if !@total_line_amount.nil? && @total_line_amount !~ pattern
224
+ if !@total_line_amount.nil? && @total_line_amount.to_s !~ pattern
215
225
  invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
216
226
  end
217
227
 
218
228
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
219
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
229
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
220
230
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
221
231
  end
222
232
 
@@ -227,9 +237,9 @@ module MergeAccountingClient
227
237
  # @return true if the model is valid
228
238
  def valid?
229
239
  return false if @tracking_categories.nil?
230
- return false if !@tax_amount.nil? && @tax_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
231
- return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
232
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
240
+ return false if !@tax_amount.nil? && @tax_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
241
+ return false if !@total_line_amount.nil? && @total_line_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
242
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
233
243
  true
234
244
  end
235
245
 
@@ -237,7 +247,7 @@ module MergeAccountingClient
237
247
  # @param [Object] tax_amount Value to be assigned
238
248
  def tax_amount=(tax_amount)
239
249
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
240
- if !tax_amount.nil? && tax_amount !~ pattern
250
+ if !tax_amount.nil? && tax_amount.to_s !~ pattern
241
251
  fail ArgumentError, "invalid value for \"tax_amount\", must conform to the pattern #{pattern}."
242
252
  end
243
253
 
@@ -248,7 +258,7 @@ module MergeAccountingClient
248
258
  # @param [Object] total_line_amount Value to be assigned
249
259
  def total_line_amount=(total_line_amount)
250
260
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
251
- if !total_line_amount.nil? && total_line_amount !~ pattern
261
+ if !total_line_amount.nil? && total_line_amount.to_s !~ pattern
252
262
  fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
253
263
  end
254
264
 
@@ -259,7 +269,7 @@ module MergeAccountingClient
259
269
  # @param [Object] exchange_rate Value to be assigned
260
270
  def exchange_rate=(exchange_rate)
261
271
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
262
- if !exchange_rate.nil? && exchange_rate !~ pattern
272
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
263
273
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
264
274
  end
265
275
 
@@ -271,6 +281,7 @@ module MergeAccountingClient
271
281
  def ==(o)
272
282
  return true if self.equal?(o)
273
283
  self.class == o.class &&
284
+ remote_id == o.remote_id &&
274
285
  description == o.description &&
275
286
  unit_price == o.unit_price &&
276
287
  quantity == o.quantity &&
@@ -296,7 +307,7 @@ module MergeAccountingClient
296
307
  # Calculates hash code according to all attributes.
297
308
  # @return [Integer] Hash code
298
309
  def hash
299
- [description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company, integration_params, linked_account_params].hash
310
+ [remote_id, description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company, integration_params, linked_account_params].hash
300
311
  end
301
312
 
302
313
  # Builds the object from hash
@@ -202,7 +202,7 @@ module MergeAccountingClient
202
202
  def list_invalid_properties
203
203
  invalid_properties = Array.new
204
204
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
205
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
205
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
206
206
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
207
207
  end
208
208
 
@@ -212,7 +212,7 @@ module MergeAccountingClient
212
212
  # Check to see if the all the properties in the model are valid
213
213
  # @return true if the model is valid
214
214
  def valid?
215
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
215
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
216
216
  true
217
217
  end
218
218
 
@@ -220,7 +220,7 @@ module MergeAccountingClient
220
220
  # @param [Object] exchange_rate Value to be assigned
221
221
  def exchange_rate=(exchange_rate)
222
222
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
223
- if !exchange_rate.nil? && exchange_rate !~ pattern
223
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
224
224
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
225
225
  end
226
226
 
@@ -20,6 +20,7 @@ module MergeAccountingClient
20
20
  FAILED = "FAILED".freeze
21
21
  DISABLED = "DISABLED".freeze
22
22
  PAUSED = "PAUSED".freeze
23
+ PARTIALLY_SYNCED = "PARTIALLY_SYNCED".freeze
23
24
 
24
25
  MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
25
26
 
@@ -31,7 +32,7 @@ module MergeAccountingClient
31
32
  # @return [String] The enum value
32
33
  def build_from_hash(value)
33
34
  @raw_value = value
34
- if ["SYNCING", "DONE", "FAILED", "DISABLED", "PAUSED", ].include? value
35
+ if ["SYNCING", "DONE", "FAILED", "DISABLED", "PAUSED", "PARTIALLY_SYNCED"].include? value
35
36
  @value = value
36
37
  else
37
38
  @value = MERGE_NONSTANDARD_VALUE
@@ -43,6 +43,8 @@ module MergeAccountingClient
43
43
  # The company the transaction belongs to.
44
44
  attr_accessor :company
45
45
 
46
+ attr_accessor :tracking_categories
47
+
46
48
  attr_accessor :line_items
47
49
 
48
50
  # Indicates whether or not this object has been deleted by third party webhooks.
@@ -69,6 +71,7 @@ module MergeAccountingClient
69
71
  :'currency' => :'currency',
70
72
  :'exchange_rate' => :'exchange_rate',
71
73
  :'company' => :'company',
74
+ :'tracking_categories' => :'tracking_categories',
72
75
  :'line_items' => :'line_items',
73
76
  :'remote_was_deleted' => :'remote_was_deleted',
74
77
  :'id' => :'id',
@@ -95,6 +98,7 @@ module MergeAccountingClient
95
98
  :'currency' => :'CurrencyEnum',
96
99
  :'exchange_rate' => :'String',
97
100
  :'company' => :'String',
101
+ :'tracking_categories' => :'Array<String>',
98
102
  :'line_items' => :'Array<TransactionLineItem>',
99
103
  :'remote_was_deleted' => :'Boolean',
100
104
  :'id' => :'String',
@@ -173,6 +177,12 @@ module MergeAccountingClient
173
177
  self.company = attributes[:'company']
174
178
  end
175
179
 
180
+ if attributes.key?(:'tracking_categories')
181
+ if (value = attributes[:'tracking_categories']).is_a?(Array)
182
+ self.tracking_categories = value
183
+ end
184
+ end
185
+
176
186
  if attributes.key?(:'line_items')
177
187
  if (value = attributes[:'line_items']).is_a?(Array)
178
188
  self.line_items = value
@@ -209,12 +219,12 @@ module MergeAccountingClient
209
219
  def list_invalid_properties
210
220
  invalid_properties = Array.new
211
221
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
212
- if !@total_amount.nil? && @total_amount !~ pattern
222
+ if !@total_amount.nil? && @total_amount.to_s !~ pattern
213
223
  invalid_properties.push("invalid value for \"total_amount\", must conform to the pattern #{pattern}.")
214
224
  end
215
225
 
216
226
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
217
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
227
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
218
228
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
219
229
  end
220
230
 
@@ -224,8 +234,8 @@ module MergeAccountingClient
224
234
  # Check to see if the all the properties in the model are valid
225
235
  # @return true if the model is valid
226
236
  def valid?
227
- return false if !@total_amount.nil? && @total_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
228
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
237
+ return false if !@total_amount.nil? && @total_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
238
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
229
239
  true
230
240
  end
231
241
 
@@ -233,7 +243,7 @@ module MergeAccountingClient
233
243
  # @param [Object] total_amount Value to be assigned
234
244
  def total_amount=(total_amount)
235
245
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
236
- if !total_amount.nil? && total_amount !~ pattern
246
+ if !total_amount.nil? && total_amount.to_s !~ pattern
237
247
  fail ArgumentError, "invalid value for \"total_amount\", must conform to the pattern #{pattern}."
238
248
  end
239
249
 
@@ -244,7 +254,7 @@ module MergeAccountingClient
244
254
  # @param [Object] exchange_rate Value to be assigned
245
255
  def exchange_rate=(exchange_rate)
246
256
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
247
- if !exchange_rate.nil? && exchange_rate !~ pattern
257
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
248
258
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
249
259
  end
250
260
 
@@ -265,6 +275,7 @@ module MergeAccountingClient
265
275
  currency == o.currency &&
266
276
  exchange_rate == o.exchange_rate &&
267
277
  company == o.company &&
278
+ tracking_categories == o.tracking_categories &&
268
279
  line_items == o.line_items &&
269
280
  remote_was_deleted == o.remote_was_deleted &&
270
281
  id == o.id &&
@@ -282,7 +293,7 @@ module MergeAccountingClient
282
293
  # Calculates hash code according to all attributes.
283
294
  # @return [Integer] Hash code
284
295
  def hash
285
- [transaction_type, number, transaction_date, account, contact, total_amount, currency, exchange_rate, company, line_items, remote_was_deleted, id, remote_id, field_mappings, remote_data].hash
296
+ [transaction_type, number, transaction_date, account, contact, total_amount, currency, exchange_rate, company, tracking_categories, line_items, remote_was_deleted, id, remote_id, field_mappings, remote_data].hash
286
297
  end
287
298
 
288
299
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module MergeAccountingClient
17
17
  # # The TransactionLineItem Object ### Description The `TransactionLineItem` object is used to represent a transaction's line items. ### Usage Example Fetch from the `GET TransactionLineItem` endpoint and view the transaction's line items.
18
18
  class TransactionLineItem
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
19
22
  # An internal note used by the business to clarify purpose of the transaction.
20
23
  attr_accessor :memo
21
24
 
@@ -54,6 +57,7 @@ module MergeAccountingClient
54
57
  # Attribute mapping from ruby-style variable name to JSON key.
55
58
  def self.attribute_map
56
59
  {
60
+ :'remote_id' => :'remote_id',
57
61
  :'memo' => :'memo',
58
62
  :'unit_price' => :'unit_price',
59
63
  :'quantity' => :'quantity',
@@ -77,6 +81,7 @@ module MergeAccountingClient
77
81
  # Attribute type mapping.
78
82
  def self.openapi_types
79
83
  {
84
+ :'remote_id' => :'String',
80
85
  :'memo' => :'String',
81
86
  :'unit_price' => :'String',
82
87
  :'quantity' => :'String',
@@ -95,6 +100,7 @@ module MergeAccountingClient
95
100
  # List of attributes with nullable: true
96
101
  def self.openapi_nullable
97
102
  Set.new([
103
+ :'remote_id',
98
104
  :'memo',
99
105
  :'unit_price',
100
106
  :'quantity',
@@ -124,6 +130,10 @@ module MergeAccountingClient
124
130
  h[k.to_sym] = v
125
131
  }
126
132
 
133
+ if attributes.key?(:'remote_id')
134
+ self.remote_id = attributes[:'remote_id']
135
+ end
136
+
127
137
  if attributes.key?(:'memo')
128
138
  self.memo = attributes[:'memo']
129
139
  end
@@ -180,12 +190,12 @@ module MergeAccountingClient
180
190
  def list_invalid_properties
181
191
  invalid_properties = Array.new
182
192
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
183
- if !@unit_price.nil? && @unit_price !~ pattern
193
+ if !@unit_price.nil? && @unit_price.to_s !~ pattern
184
194
  invalid_properties.push("invalid value for \"unit_price\", must conform to the pattern #{pattern}.")
185
195
  end
186
196
 
187
197
  pattern = Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
188
- if !@quantity.nil? && @quantity !~ pattern
198
+ if !@quantity.nil? && @quantity.to_s !~ pattern
189
199
  invalid_properties.push("invalid value for \"quantity\", must conform to the pattern #{pattern}.")
190
200
  end
191
201
 
@@ -194,12 +204,12 @@ module MergeAccountingClient
194
204
  end
195
205
 
196
206
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
197
- if !@total_line_amount.nil? && @total_line_amount !~ pattern
207
+ if !@total_line_amount.nil? && @total_line_amount.to_s !~ pattern
198
208
  invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
199
209
  end
200
210
 
201
211
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
202
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
212
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
203
213
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
204
214
  end
205
215
 
@@ -209,11 +219,11 @@ module MergeAccountingClient
209
219
  # Check to see if the all the properties in the model are valid
210
220
  # @return true if the model is valid
211
221
  def valid?
212
- return false if !@unit_price.nil? && @unit_price !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
213
- return false if !@quantity.nil? && @quantity !~ Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
222
+ return false if !@unit_price.nil? && @unit_price.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
223
+ return false if !@quantity.nil? && @quantity.to_s !~ Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
214
224
  return false if @tracking_categories.nil?
215
- return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
216
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
225
+ return false if !@total_line_amount.nil? && @total_line_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
226
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
217
227
  true
218
228
  end
219
229
 
@@ -221,7 +231,7 @@ module MergeAccountingClient
221
231
  # @param [Object] unit_price Value to be assigned
222
232
  def unit_price=(unit_price)
223
233
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
224
- if !unit_price.nil? && unit_price !~ pattern
234
+ if !unit_price.nil? && unit_price.to_s !~ pattern
225
235
  fail ArgumentError, "invalid value for \"unit_price\", must conform to the pattern #{pattern}."
226
236
  end
227
237
 
@@ -232,7 +242,7 @@ module MergeAccountingClient
232
242
  # @param [Object] quantity Value to be assigned
233
243
  def quantity=(quantity)
234
244
  pattern = Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
235
- if !quantity.nil? && quantity !~ pattern
245
+ if !quantity.nil? && quantity.to_s !~ pattern
236
246
  fail ArgumentError, "invalid value for \"quantity\", must conform to the pattern #{pattern}."
237
247
  end
238
248
 
@@ -243,7 +253,7 @@ module MergeAccountingClient
243
253
  # @param [Object] total_line_amount Value to be assigned
244
254
  def total_line_amount=(total_line_amount)
245
255
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
246
- if !total_line_amount.nil? && total_line_amount !~ pattern
256
+ if !total_line_amount.nil? && total_line_amount.to_s !~ pattern
247
257
  fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
248
258
  end
249
259
 
@@ -254,7 +264,7 @@ module MergeAccountingClient
254
264
  # @param [Object] exchange_rate Value to be assigned
255
265
  def exchange_rate=(exchange_rate)
256
266
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
257
- if !exchange_rate.nil? && exchange_rate !~ pattern
267
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
258
268
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
259
269
  end
260
270
 
@@ -266,6 +276,7 @@ module MergeAccountingClient
266
276
  def ==(o)
267
277
  return true if self.equal?(o)
268
278
  self.class == o.class &&
279
+ remote_id == o.remote_id &&
269
280
  memo == o.memo &&
270
281
  unit_price == o.unit_price &&
271
282
  quantity == o.quantity &&
@@ -289,7 +300,7 @@ module MergeAccountingClient
289
300
  # Calculates hash code according to all attributes.
290
301
  # @return [Integer] Hash code
291
302
  def hash
292
- [memo, unit_price, quantity, item, account, tracking_category, tracking_categories, total_line_amount, tax_rate, currency, exchange_rate, company].hash
303
+ [remote_id, memo, unit_price, quantity, item, account, tracking_category, tracking_categories, total_line_amount, tax_rate, currency, exchange_rate, company].hash
293
304
  end
294
305
 
295
306
  # Builds the object from hash
@@ -189,7 +189,7 @@ module MergeAccountingClient
189
189
  def list_invalid_properties
190
190
  invalid_properties = Array.new
191
191
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
192
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
192
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
193
193
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
194
194
  end
195
195
 
@@ -199,7 +199,7 @@ module MergeAccountingClient
199
199
  # Check to see if the all the properties in the model are valid
200
200
  # @return true if the model is valid
201
201
  def valid?
202
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
202
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
203
203
  true
204
204
  end
205
205
 
@@ -207,7 +207,7 @@ module MergeAccountingClient
207
207
  # @param [Object] exchange_rate Value to be assigned
208
208
  def exchange_rate=(exchange_rate)
209
209
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
210
- if !exchange_rate.nil? && exchange_rate !~ pattern
210
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
211
211
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
212
212
  end
213
213