merge_accounting_client 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/docs/AccountsApi.md +4 -0
  4. data/docs/BalanceSheetsApi.md +4 -0
  5. data/docs/CashFlowStatementsApi.md +4 -0
  6. data/docs/CompanyInfoApi.md +4 -0
  7. data/docs/ContactsApi.md +4 -0
  8. data/docs/CreditNote.md +1 -1
  9. data/docs/CreditNoteLineItem.md +1 -1
  10. data/docs/CreditNotesApi.md +4 -0
  11. data/docs/Expense.md +1 -1
  12. data/docs/ExpenseLine.md +4 -2
  13. data/docs/ExpenseLineRequest.md +4 -2
  14. data/docs/ExpenseRequest.md +1 -1
  15. data/docs/ExpensesApi.md +4 -0
  16. data/docs/ForceResyncApi.md +1 -1
  17. data/docs/IncomeStatementsApi.md +4 -0
  18. data/docs/Invoice.md +1 -1
  19. data/docs/InvoiceLineItem.md +2 -2
  20. data/docs/InvoiceLineItemRequest.md +2 -2
  21. data/docs/InvoiceRequest.md +18 -18
  22. data/docs/InvoicesApi.md +4 -0
  23. data/docs/ItemsApi.md +4 -0
  24. data/docs/JournalEntriesApi.md +4 -0
  25. data/docs/JournalEntry.md +2 -2
  26. data/docs/JournalEntryRequest.md +10 -10
  27. data/docs/JournalLine.md +4 -2
  28. data/docs/JournalLineRequest.md +4 -2
  29. data/docs/PaymentsApi.md +4 -0
  30. data/docs/PurchaseOrder.md +2 -2
  31. data/docs/PurchaseOrderLineItem.md +2 -0
  32. data/docs/PurchaseOrderLineItemRequest.md +2 -0
  33. data/docs/PurchaseOrderRequest.md +12 -12
  34. data/docs/PurchaseOrdersApi.md +4 -0
  35. data/docs/TaxRatesApi.md +4 -0
  36. data/docs/TrackingCategoriesApi.md +4 -0
  37. data/docs/Transaction.md +4 -2
  38. data/docs/TransactionLineItem.md +2 -0
  39. data/docs/TransactionsApi.md +4 -0
  40. data/docs/VendorCredit.md +2 -2
  41. data/docs/VendorCreditLine.md +3 -1
  42. data/docs/VendorCreditsApi.md +4 -0
  43. data/lib/merge_accounting_client/api/accounts_api.rb +14 -0
  44. data/lib/merge_accounting_client/api/balance_sheets_api.rb +14 -0
  45. data/lib/merge_accounting_client/api/cash_flow_statements_api.rb +14 -0
  46. data/lib/merge_accounting_client/api/company_info_api.rb +14 -0
  47. data/lib/merge_accounting_client/api/contacts_api.rb +14 -0
  48. data/lib/merge_accounting_client/api/credit_notes_api.rb +14 -0
  49. data/lib/merge_accounting_client/api/expenses_api.rb +14 -0
  50. data/lib/merge_accounting_client/api/force_resync_api.rb +2 -2
  51. data/lib/merge_accounting_client/api/income_statements_api.rb +14 -0
  52. data/lib/merge_accounting_client/api/invoices_api.rb +14 -0
  53. data/lib/merge_accounting_client/api/items_api.rb +14 -0
  54. data/lib/merge_accounting_client/api/journal_entries_api.rb +14 -0
  55. data/lib/merge_accounting_client/api/payments_api.rb +14 -0
  56. data/lib/merge_accounting_client/api/purchase_orders_api.rb +14 -0
  57. data/lib/merge_accounting_client/api/tax_rates_api.rb +14 -0
  58. data/lib/merge_accounting_client/api/tracking_categories_api.rb +14 -0
  59. data/lib/merge_accounting_client/api/transactions_api.rb +14 -0
  60. data/lib/merge_accounting_client/api/vendor_credits_api.rb +14 -0
  61. data/lib/merge_accounting_client/models/account_integration.rb +3 -3
  62. data/lib/merge_accounting_client/models/credit_note_line_item.rb +9 -9
  63. data/lib/merge_accounting_client/models/expense.rb +3 -3
  64. data/lib/merge_accounting_client/models/expense_line.rb +37 -9
  65. data/lib/merge_accounting_client/models/expense_line_request.rb +37 -9
  66. data/lib/merge_accounting_client/models/expense_request.rb +3 -3
  67. data/lib/merge_accounting_client/models/invoice.rb +3 -3
  68. data/lib/merge_accounting_client/models/invoice_line_item.rb +15 -15
  69. data/lib/merge_accounting_client/models/invoice_line_item_request.rb +15 -15
  70. data/lib/merge_accounting_client/models/invoice_request.rb +3 -3
  71. data/lib/merge_accounting_client/models/journal_entry.rb +3 -3
  72. data/lib/merge_accounting_client/models/journal_entry_request.rb +3 -3
  73. data/lib/merge_accounting_client/models/journal_line.rb +37 -9
  74. data/lib/merge_accounting_client/models/journal_line_request.rb +37 -9
  75. data/lib/merge_accounting_client/models/payment.rb +3 -3
  76. data/lib/merge_accounting_client/models/payment_request.rb +3 -3
  77. data/lib/merge_accounting_client/models/purchase_order.rb +3 -3
  78. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +21 -10
  79. data/lib/merge_accounting_client/models/purchase_order_line_item_request.rb +21 -10
  80. data/lib/merge_accounting_client/models/purchase_order_request.rb +3 -3
  81. data/lib/merge_accounting_client/models/transaction.rb +18 -7
  82. data/lib/merge_accounting_client/models/transaction_line_item.rb +24 -13
  83. data/lib/merge_accounting_client/models/vendor_credit.rb +3 -3
  84. data/lib/merge_accounting_client/models/vendor_credit_line.rb +33 -5
  85. data/lib/merge_accounting_client/version.rb +1 -1
  86. data/spec/api/accounts_api_spec.rb +2 -0
  87. data/spec/api/balance_sheets_api_spec.rb +2 -0
  88. data/spec/api/cash_flow_statements_api_spec.rb +2 -0
  89. data/spec/api/company_info_api_spec.rb +2 -0
  90. data/spec/api/contacts_api_spec.rb +2 -0
  91. data/spec/api/credit_notes_api_spec.rb +2 -0
  92. data/spec/api/expenses_api_spec.rb +2 -0
  93. data/spec/api/force_resync_api_spec.rb +1 -1
  94. data/spec/api/income_statements_api_spec.rb +2 -0
  95. data/spec/api/invoices_api_spec.rb +2 -0
  96. data/spec/api/items_api_spec.rb +2 -0
  97. data/spec/api/journal_entries_api_spec.rb +2 -0
  98. data/spec/api/payments_api_spec.rb +2 -0
  99. data/spec/api/purchase_orders_api_spec.rb +2 -0
  100. data/spec/api/tax_rates_api_spec.rb +2 -0
  101. data/spec/api/tracking_categories_api_spec.rb +2 -0
  102. data/spec/api/transactions_api_spec.rb +2 -0
  103. data/spec/api/vendor_credits_api_spec.rb +2 -0
  104. data/spec/models/expense_line_request_spec.rb +7 -1
  105. data/spec/models/expense_line_spec.rb +7 -1
  106. data/spec/models/invoice_line_item_request_spec.rb +6 -6
  107. data/spec/models/invoice_line_item_spec.rb +6 -6
  108. data/spec/models/journal_line_request_spec.rb +7 -1
  109. data/spec/models/journal_line_spec.rb +7 -1
  110. data/spec/models/purchase_order_line_item_request_spec.rb +6 -0
  111. data/spec/models/purchase_order_line_item_spec.rb +6 -0
  112. data/spec/models/transaction_line_item_spec.rb +6 -0
  113. data/spec/models/transaction_spec.rb +6 -0
  114. data/spec/models/vendor_credit_line_spec.rb +6 -0
  115. metadata +151 -151
@@ -26,6 +26,7 @@ module MergeAccountingClient
26
26
  # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
27
27
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
28
28
  # @option opts [String] :cursor The pagination cursor value.
29
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
29
30
  # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
30
31
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
31
32
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
@@ -47,6 +48,7 @@ module MergeAccountingClient
47
48
  # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
48
49
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
49
50
  # @option opts [String] :cursor The pagination cursor value.
51
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
50
52
  # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
51
53
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
52
54
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
@@ -64,6 +66,10 @@ module MergeAccountingClient
64
66
  if @api_client.config.client_side_validation && x_account_token.nil?
65
67
  fail ArgumentError, "Missing the required parameter 'x_account_token' when calling TransactionsApi.transactions_list"
66
68
  end
69
+ allowable_values = ["account", "contact", "contact,account", "line_items", "line_items,account", "line_items,contact", "line_items,contact,account", "line_items,tracking_categories", "line_items,tracking_categories,account", "line_items,tracking_categories,contact", "line_items,tracking_categories,contact,account", "tracking_categories", "tracking_categories,account", "tracking_categories,contact", "tracking_categories,contact,account"]
70
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
71
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
72
+ end
67
73
  # resource path
68
74
  local_var_path = '/transactions'
69
75
 
@@ -73,6 +79,7 @@ module MergeAccountingClient
73
79
  query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
74
80
  query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
75
81
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
82
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
76
83
  query_params[:'include_deleted_data'] = opts[:'include_deleted_data'] if !opts[:'include_deleted_data'].nil?
77
84
  query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
78
85
  query_params[:'modified_after'] = opts[:'modified_after'] if !opts[:'modified_after'].nil?
@@ -121,6 +128,7 @@ module MergeAccountingClient
121
128
  # @param x_account_token [String] Token identifying the end user.
122
129
  # @param id [String]
123
130
  # @param [Hash] opts the optional parameters
131
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
124
132
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
125
133
  # @return [Transaction]
126
134
  def transactions_retrieve(x_account_token, id, opts = {})
@@ -132,6 +140,7 @@ module MergeAccountingClient
132
140
  # @param x_account_token [String] Token identifying the end user.
133
141
  # @param id [String]
134
142
  # @param [Hash] opts the optional parameters
143
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
135
144
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
136
145
  # @return [Array<(Transaction, Integer, Hash)>] Transaction data, response status code and response headers
137
146
  def transactions_retrieve_with_http_info(x_account_token, id, opts = {})
@@ -146,11 +155,16 @@ module MergeAccountingClient
146
155
  if @api_client.config.client_side_validation && id.nil?
147
156
  fail ArgumentError, "Missing the required parameter 'id' when calling TransactionsApi.transactions_retrieve"
148
157
  end
158
+ allowable_values = ["account", "contact", "contact,account", "line_items", "line_items,account", "line_items,contact", "line_items,contact,account", "line_items,tracking_categories", "line_items,tracking_categories,account", "line_items,tracking_categories,contact", "line_items,tracking_categories,contact,account", "tracking_categories", "tracking_categories,account", "tracking_categories,contact", "tracking_categories,contact,account"]
159
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
160
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
161
+ end
149
162
  # resource path
150
163
  local_var_path = '/transactions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
151
164
 
152
165
  # query parameters
153
166
  query_params = opts[:query_params] || {}
167
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
154
168
  query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
155
169
 
156
170
  # header parameters
@@ -26,6 +26,7 @@ module MergeAccountingClient
26
26
  # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
27
27
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
28
28
  # @option opts [String] :cursor The pagination cursor value.
29
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
29
30
  # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
30
31
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
31
32
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
@@ -47,6 +48,7 @@ module MergeAccountingClient
47
48
  # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
48
49
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
49
50
  # @option opts [String] :cursor The pagination cursor value.
51
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
50
52
  # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
51
53
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
52
54
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
@@ -64,6 +66,10 @@ module MergeAccountingClient
64
66
  if @api_client.config.client_side_validation && x_account_token.nil?
65
67
  fail ArgumentError, "Missing the required parameter 'x_account_token' when calling VendorCreditsApi.vendor_credits_list"
66
68
  end
69
+ allowable_values = ["company", "lines", "lines,company", "lines,vendor", "lines,vendor,company", "vendor", "vendor,company"]
70
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
71
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
72
+ end
67
73
  # resource path
68
74
  local_var_path = '/vendor-credits'
69
75
 
@@ -73,6 +79,7 @@ module MergeAccountingClient
73
79
  query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
74
80
  query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
75
81
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
82
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
76
83
  query_params[:'include_deleted_data'] = opts[:'include_deleted_data'] if !opts[:'include_deleted_data'].nil?
77
84
  query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
78
85
  query_params[:'modified_after'] = opts[:'modified_after'] if !opts[:'modified_after'].nil?
@@ -121,6 +128,7 @@ module MergeAccountingClient
121
128
  # @param x_account_token [String] Token identifying the end user.
122
129
  # @param id [String]
123
130
  # @param [Hash] opts the optional parameters
131
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
124
132
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
125
133
  # @return [VendorCredit]
126
134
  def vendor_credits_retrieve(x_account_token, id, opts = {})
@@ -132,6 +140,7 @@ module MergeAccountingClient
132
140
  # @param x_account_token [String] Token identifying the end user.
133
141
  # @param id [String]
134
142
  # @param [Hash] opts the optional parameters
143
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
135
144
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
136
145
  # @return [Array<(VendorCredit, Integer, Hash)>] VendorCredit data, response status code and response headers
137
146
  def vendor_credits_retrieve_with_http_info(x_account_token, id, opts = {})
@@ -146,11 +155,16 @@ module MergeAccountingClient
146
155
  if @api_client.config.client_side_validation && id.nil?
147
156
  fail ArgumentError, "Missing the required parameter 'id' when calling VendorCreditsApi.vendor_credits_retrieve"
148
157
  end
158
+ allowable_values = ["company", "lines", "lines,company", "lines,vendor", "lines,vendor,company", "vendor", "vendor,company"]
159
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
160
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
161
+ end
149
162
  # resource path
150
163
  local_var_path = '/vendor-credits/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
151
164
 
152
165
  # query parameters
153
166
  query_params = opts[:query_params] || {}
167
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
154
168
  query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
155
169
 
156
170
  # header parameters
@@ -124,7 +124,7 @@ module MergeAccountingClient
124
124
  end
125
125
 
126
126
  pattern = Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
127
- if !@color.nil? && @color !~ pattern
127
+ if !@color.nil? && @color.to_s !~ pattern
128
128
  invalid_properties.push("invalid value for \"color\", must conform to the pattern #{pattern}.")
129
129
  end
130
130
 
@@ -136,7 +136,7 @@ module MergeAccountingClient
136
136
  def valid?
137
137
  return false if @name.nil?
138
138
  return false if !@color.nil? && @color.to_s.length > 18
139
- return false if !@color.nil? && @color !~ Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
139
+ return false if !@color.nil? && @color.to_s !~ Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
140
140
  true
141
141
  end
142
142
 
@@ -148,7 +148,7 @@ module MergeAccountingClient
148
148
  end
149
149
 
150
150
  pattern = Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
151
- if !color.nil? && color !~ pattern
151
+ if !color.nil? && color.to_s !~ pattern
152
152
  fail ArgumentError, "invalid value for \"color\", must conform to the pattern #{pattern}."
153
153
  end
154
154
 
@@ -189,17 +189,17 @@ module MergeAccountingClient
189
189
  def list_invalid_properties
190
190
  invalid_properties = Array.new
191
191
  pattern = Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
192
- if !@quantity.nil? && @quantity !~ pattern
192
+ if !@quantity.nil? && @quantity.to_s !~ pattern
193
193
  invalid_properties.push("invalid value for \"quantity\", must conform to the pattern #{pattern}.")
194
194
  end
195
195
 
196
196
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
197
- if !@unit_price.nil? && @unit_price !~ pattern
197
+ if !@unit_price.nil? && @unit_price.to_s !~ pattern
198
198
  invalid_properties.push("invalid value for \"unit_price\", must conform to the pattern #{pattern}.")
199
199
  end
200
200
 
201
201
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
202
- if !@total_line_amount.nil? && @total_line_amount !~ pattern
202
+ if !@total_line_amount.nil? && @total_line_amount.to_s !~ pattern
203
203
  invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
204
204
  end
205
205
 
@@ -213,9 +213,9 @@ module MergeAccountingClient
213
213
  # Check to see if the all the properties in the model are valid
214
214
  # @return true if the model is valid
215
215
  def valid?
216
- return false if !@quantity.nil? && @quantity !~ Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
217
- return false if !@unit_price.nil? && @unit_price !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
218
- return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
216
+ return false if !@quantity.nil? && @quantity.to_s !~ Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
217
+ return false if !@unit_price.nil? && @unit_price.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
218
+ return false if !@total_line_amount.nil? && @total_line_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
219
219
  return false if @tracking_categories.nil?
220
220
  true
221
221
  end
@@ -224,7 +224,7 @@ module MergeAccountingClient
224
224
  # @param [Object] quantity Value to be assigned
225
225
  def quantity=(quantity)
226
226
  pattern = Regexp.new(/^-?\d{0,24}(?:\.\d{0,8})?$/)
227
- if !quantity.nil? && quantity !~ pattern
227
+ if !quantity.nil? && quantity.to_s !~ pattern
228
228
  fail ArgumentError, "invalid value for \"quantity\", must conform to the pattern #{pattern}."
229
229
  end
230
230
 
@@ -235,7 +235,7 @@ module MergeAccountingClient
235
235
  # @param [Object] unit_price Value to be assigned
236
236
  def unit_price=(unit_price)
237
237
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
238
- if !unit_price.nil? && unit_price !~ pattern
238
+ if !unit_price.nil? && unit_price.to_s !~ pattern
239
239
  fail ArgumentError, "invalid value for \"unit_price\", must conform to the pattern #{pattern}."
240
240
  end
241
241
 
@@ -246,7 +246,7 @@ module MergeAccountingClient
246
246
  # @param [Object] total_line_amount Value to be assigned
247
247
  def total_line_amount=(total_line_amount)
248
248
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
249
- if !total_line_amount.nil? && total_line_amount !~ pattern
249
+ if !total_line_amount.nil? && total_line_amount.to_s !~ pattern
250
250
  fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
251
251
  end
252
252
 
@@ -209,7 +209,7 @@ module MergeAccountingClient
209
209
  def list_invalid_properties
210
210
  invalid_properties = Array.new
211
211
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
212
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
212
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
213
213
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
214
214
  end
215
215
 
@@ -219,7 +219,7 @@ module MergeAccountingClient
219
219
  # Check to see if the all the properties in the model are valid
220
220
  # @return true if the model is valid
221
221
  def valid?
222
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
222
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
223
223
  true
224
224
  end
225
225
 
@@ -227,7 +227,7 @@ module MergeAccountingClient
227
227
  # @param [Object] exchange_rate Value to be assigned
228
228
  def exchange_rate=(exchange_rate)
229
229
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
230
- if !exchange_rate.nil? && exchange_rate !~ pattern
230
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
231
231
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
232
232
  end
233
233
 
@@ -16,6 +16,9 @@ require 'time'
16
16
  module MergeAccountingClient
17
17
  # # The ExpenseLine Object ### Description The `ExpenseLine` object is used to represent an expense's line items. ### Usage Example Fetch from the `GET Expense` endpoint and view the expense's line items.
18
18
  class ExpenseLine
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
19
22
  # The line's item.
20
23
  attr_accessor :item
21
24
 
@@ -38,12 +41,13 @@ module MergeAccountingClient
38
41
  # The description of the item that was purchased by the company.
39
42
  attr_accessor :description
40
43
 
41
- # The third-party API ID of the matching object.
42
- attr_accessor :remote_id
44
+ # The expense line item's exchange rate.
45
+ attr_accessor :exchange_rate
43
46
 
44
47
  # Attribute mapping from ruby-style variable name to JSON key.
45
48
  def self.attribute_map
46
49
  {
50
+ :'remote_id' => :'remote_id',
47
51
  :'item' => :'item',
48
52
  :'net_amount' => :'net_amount',
49
53
  :'tracking_category' => :'tracking_category',
@@ -52,7 +56,7 @@ module MergeAccountingClient
52
56
  :'account' => :'account',
53
57
  :'contact' => :'contact',
54
58
  :'description' => :'description',
55
- :'remote_id' => :'remote_id'
59
+ :'exchange_rate' => :'exchange_rate'
56
60
  }
57
61
  end
58
62
 
@@ -64,6 +68,7 @@ module MergeAccountingClient
64
68
  # Attribute type mapping.
65
69
  def self.openapi_types
66
70
  {
71
+ :'remote_id' => :'String',
67
72
  :'item' => :'String',
68
73
  :'net_amount' => :'Float',
69
74
  :'tracking_category' => :'String',
@@ -72,13 +77,14 @@ module MergeAccountingClient
72
77
  :'account' => :'String',
73
78
  :'contact' => :'String',
74
79
  :'description' => :'String',
75
- :'remote_id' => :'String'
80
+ :'exchange_rate' => :'String'
76
81
  }
77
82
  end
78
83
 
79
84
  # List of attributes with nullable: true
80
85
  def self.openapi_nullable
81
86
  Set.new([
87
+ :'remote_id',
82
88
  :'item',
83
89
  :'net_amount',
84
90
  :'tracking_category',
@@ -86,7 +92,7 @@ module MergeAccountingClient
86
92
  :'account',
87
93
  :'contact',
88
94
  :'description',
89
- :'remote_id'
95
+ :'exchange_rate'
90
96
  ])
91
97
  end
92
98
 
@@ -105,6 +111,10 @@ module MergeAccountingClient
105
111
  h[k.to_sym] = v
106
112
  }
107
113
 
114
+ if attributes.key?(:'remote_id')
115
+ self.remote_id = attributes[:'remote_id']
116
+ end
117
+
108
118
  if attributes.key?(:'item')
109
119
  self.item = attributes[:'item']
110
120
  end
@@ -139,8 +149,8 @@ module MergeAccountingClient
139
149
  self.description = attributes[:'description']
140
150
  end
141
151
 
142
- if attributes.key?(:'remote_id')
143
- self.remote_id = attributes[:'remote_id']
152
+ if attributes.key?(:'exchange_rate')
153
+ self.exchange_rate = attributes[:'exchange_rate']
144
154
  end
145
155
  end
146
156
 
@@ -148,20 +158,38 @@ module MergeAccountingClient
148
158
  # @return Array for valid properties with the reasons
149
159
  def list_invalid_properties
150
160
  invalid_properties = Array.new
161
+ pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
162
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
163
+ invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
164
+ end
165
+
151
166
  invalid_properties
152
167
  end
153
168
 
154
169
  # Check to see if the all the properties in the model are valid
155
170
  # @return true if the model is valid
156
171
  def valid?
172
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
157
173
  true
158
174
  end
159
175
 
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] exchange_rate Value to be assigned
178
+ def exchange_rate=(exchange_rate)
179
+ pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
180
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
181
+ fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
182
+ end
183
+
184
+ @exchange_rate = exchange_rate
185
+ end
186
+
160
187
  # Checks equality by comparing each attribute.
161
188
  # @param [Object] Object to be compared
162
189
  def ==(o)
163
190
  return true if self.equal?(o)
164
191
  self.class == o.class &&
192
+ remote_id == o.remote_id &&
165
193
  item == o.item &&
166
194
  net_amount == o.net_amount &&
167
195
  tracking_category == o.tracking_category &&
@@ -170,7 +198,7 @@ module MergeAccountingClient
170
198
  account == o.account &&
171
199
  contact == o.contact &&
172
200
  description == o.description &&
173
- remote_id == o.remote_id
201
+ exchange_rate == o.exchange_rate
174
202
  end
175
203
 
176
204
  # @see the `==` method
@@ -182,7 +210,7 @@ module MergeAccountingClient
182
210
  # Calculates hash code according to all attributes.
183
211
  # @return [Integer] Hash code
184
212
  def hash
185
- [item, net_amount, tracking_category, tracking_categories, company, account, contact, description, remote_id].hash
213
+ [remote_id, item, net_amount, tracking_category, tracking_categories, company, account, contact, description, exchange_rate].hash
186
214
  end
187
215
 
188
216
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module MergeAccountingClient
17
17
  # # The ExpenseLine Object ### Description The `ExpenseLine` object is used to represent an expense's line items. ### Usage Example Fetch from the `GET Expense` endpoint and view the expense's line items.
18
18
  class ExpenseLineRequest
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
19
22
  # The line's item.
20
23
  attr_accessor :item
21
24
 
@@ -38,8 +41,8 @@ module MergeAccountingClient
38
41
  # The description of the item that was purchased by the company.
39
42
  attr_accessor :description
40
43
 
41
- # The third-party API ID of the matching object.
42
- attr_accessor :remote_id
44
+ # The expense line item's exchange rate.
45
+ attr_accessor :exchange_rate
43
46
 
44
47
  attr_accessor :integration_params
45
48
 
@@ -48,6 +51,7 @@ module MergeAccountingClient
48
51
  # Attribute mapping from ruby-style variable name to JSON key.
49
52
  def self.attribute_map
50
53
  {
54
+ :'remote_id' => :'remote_id',
51
55
  :'item' => :'item',
52
56
  :'net_amount' => :'net_amount',
53
57
  :'tracking_category' => :'tracking_category',
@@ -56,7 +60,7 @@ module MergeAccountingClient
56
60
  :'account' => :'account',
57
61
  :'contact' => :'contact',
58
62
  :'description' => :'description',
59
- :'remote_id' => :'remote_id',
63
+ :'exchange_rate' => :'exchange_rate',
60
64
  :'integration_params' => :'integration_params',
61
65
  :'linked_account_params' => :'linked_account_params'
62
66
  }
@@ -70,6 +74,7 @@ module MergeAccountingClient
70
74
  # Attribute type mapping.
71
75
  def self.openapi_types
72
76
  {
77
+ :'remote_id' => :'String',
73
78
  :'item' => :'String',
74
79
  :'net_amount' => :'Float',
75
80
  :'tracking_category' => :'String',
@@ -78,7 +83,7 @@ module MergeAccountingClient
78
83
  :'account' => :'String',
79
84
  :'contact' => :'String',
80
85
  :'description' => :'String',
81
- :'remote_id' => :'String',
86
+ :'exchange_rate' => :'String',
82
87
  :'integration_params' => :'Hash<String, Object>',
83
88
  :'linked_account_params' => :'Hash<String, Object>'
84
89
  }
@@ -87,6 +92,7 @@ module MergeAccountingClient
87
92
  # List of attributes with nullable: true
88
93
  def self.openapi_nullable
89
94
  Set.new([
95
+ :'remote_id',
90
96
  :'item',
91
97
  :'net_amount',
92
98
  :'tracking_category',
@@ -94,7 +100,7 @@ module MergeAccountingClient
94
100
  :'account',
95
101
  :'contact',
96
102
  :'description',
97
- :'remote_id',
103
+ :'exchange_rate',
98
104
  :'integration_params',
99
105
  :'linked_account_params'
100
106
  ])
@@ -115,6 +121,10 @@ module MergeAccountingClient
115
121
  h[k.to_sym] = v
116
122
  }
117
123
 
124
+ if attributes.key?(:'remote_id')
125
+ self.remote_id = attributes[:'remote_id']
126
+ end
127
+
118
128
  if attributes.key?(:'item')
119
129
  self.item = attributes[:'item']
120
130
  end
@@ -149,8 +159,8 @@ module MergeAccountingClient
149
159
  self.description = attributes[:'description']
150
160
  end
151
161
 
152
- if attributes.key?(:'remote_id')
153
- self.remote_id = attributes[:'remote_id']
162
+ if attributes.key?(:'exchange_rate')
163
+ self.exchange_rate = attributes[:'exchange_rate']
154
164
  end
155
165
 
156
166
  if attributes.key?(:'integration_params')
@@ -170,20 +180,38 @@ module MergeAccountingClient
170
180
  # @return Array for valid properties with the reasons
171
181
  def list_invalid_properties
172
182
  invalid_properties = Array.new
183
+ pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
184
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
185
+ invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
186
+ end
187
+
173
188
  invalid_properties
174
189
  end
175
190
 
176
191
  # Check to see if the all the properties in the model are valid
177
192
  # @return true if the model is valid
178
193
  def valid?
194
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
179
195
  true
180
196
  end
181
197
 
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] exchange_rate Value to be assigned
200
+ def exchange_rate=(exchange_rate)
201
+ pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
202
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
203
+ fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
204
+ end
205
+
206
+ @exchange_rate = exchange_rate
207
+ end
208
+
182
209
  # Checks equality by comparing each attribute.
183
210
  # @param [Object] Object to be compared
184
211
  def ==(o)
185
212
  return true if self.equal?(o)
186
213
  self.class == o.class &&
214
+ remote_id == o.remote_id &&
187
215
  item == o.item &&
188
216
  net_amount == o.net_amount &&
189
217
  tracking_category == o.tracking_category &&
@@ -192,7 +220,7 @@ module MergeAccountingClient
192
220
  account == o.account &&
193
221
  contact == o.contact &&
194
222
  description == o.description &&
195
- remote_id == o.remote_id &&
223
+ exchange_rate == o.exchange_rate &&
196
224
  integration_params == o.integration_params &&
197
225
  linked_account_params == o.linked_account_params
198
226
  end
@@ -206,7 +234,7 @@ module MergeAccountingClient
206
234
  # Calculates hash code according to all attributes.
207
235
  # @return [Integer] Hash code
208
236
  def hash
209
- [item, net_amount, tracking_category, tracking_categories, company, account, contact, description, remote_id, integration_params, linked_account_params].hash
237
+ [remote_id, item, net_amount, tracking_category, tracking_categories, company, account, contact, description, exchange_rate, integration_params, linked_account_params].hash
210
238
  end
211
239
 
212
240
  # Builds the object from hash
@@ -172,7 +172,7 @@ module MergeAccountingClient
172
172
  def list_invalid_properties
173
173
  invalid_properties = Array.new
174
174
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
175
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
175
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
176
176
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
177
177
  end
178
178
 
@@ -182,7 +182,7 @@ module MergeAccountingClient
182
182
  # Check to see if the all the properties in the model are valid
183
183
  # @return true if the model is valid
184
184
  def valid?
185
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
185
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
186
186
  true
187
187
  end
188
188
 
@@ -190,7 +190,7 @@ module MergeAccountingClient
190
190
  # @param [Object] exchange_rate Value to be assigned
191
191
  def exchange_rate=(exchange_rate)
192
192
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
193
- if !exchange_rate.nil? && exchange_rate !~ pattern
193
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
194
194
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
195
195
  end
196
196
 
@@ -289,7 +289,7 @@ module MergeAccountingClient
289
289
  def list_invalid_properties
290
290
  invalid_properties = Array.new
291
291
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
292
- if !@exchange_rate.nil? && @exchange_rate !~ pattern
292
+ if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
293
293
  invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
294
294
  end
295
295
 
@@ -299,7 +299,7 @@ module MergeAccountingClient
299
299
  # Check to see if the all the properties in the model are valid
300
300
  # @return true if the model is valid
301
301
  def valid?
302
- return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
302
+ return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
303
303
  true
304
304
  end
305
305
 
@@ -307,7 +307,7 @@ module MergeAccountingClient
307
307
  # @param [Object] exchange_rate Value to be assigned
308
308
  def exchange_rate=(exchange_rate)
309
309
  pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
310
- if !exchange_rate.nil? && exchange_rate !~ pattern
310
+ if !exchange_rate.nil? && exchange_rate.to_s !~ pattern
311
311
  fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
312
312
  end
313
313