merge_accounting_client 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +16 -0
  3. data/README.md +12 -5
  4. data/docs/Account.md +3 -1
  5. data/docs/AccountDetails.md +3 -1
  6. data/docs/AccountDetailsAndActions.md +2 -0
  7. data/docs/AccountingAttachment.md +1 -1
  8. data/docs/AccountsApi.md +7 -3
  9. data/docs/AddressesApi.md +3 -1
  10. data/docs/AttachmentsApi.md +2 -2
  11. data/docs/BalanceSheet.md +3 -1
  12. data/docs/BalanceSheetsApi.md +2 -2
  13. data/docs/CashFlowStatement.md +3 -1
  14. data/docs/CashFlowStatementsApi.md +2 -2
  15. data/docs/CategoryTypeEnum.md +15 -0
  16. data/docs/CompanyInfo.md +1 -1
  17. data/docs/CompanyInfoApi.md +2 -2
  18. data/docs/Contact.md +1 -1
  19. data/docs/ContactsApi.md +7 -3
  20. data/docs/CreditNote.md +7 -1
  21. data/docs/CreditNoteLineItem.md +38 -0
  22. data/docs/CreditNotesApi.md +7 -3
  23. data/docs/DataPassthroughRequest.md +3 -1
  24. data/docs/EndUserDetailsRequest.md +9 -7
  25. data/docs/Expense.md +1 -1
  26. data/docs/ExpensesApi.md +2 -2
  27. data/docs/IncomeStatement.md +3 -1
  28. data/docs/IncomeStatementsApi.md +2 -2
  29. data/docs/InvoiceLineItem.md +0 -2
  30. data/docs/InvoicesApi.md +8 -4
  31. data/docs/Item.md +1 -1
  32. data/docs/ItemsApi.md +7 -3
  33. data/docs/JournalEntriesApi.md +2 -2
  34. data/docs/JournalEntry.md +2 -0
  35. data/docs/JournalEntryRequest.md +2 -0
  36. data/docs/LinkToken.md +3 -1
  37. data/docs/LinkedAccountsApi.md +2 -0
  38. data/docs/PaginatedTransactionList.md +22 -0
  39. data/docs/Payment.md +1 -1
  40. data/docs/PaymentsApi.md +2 -2
  41. data/docs/PurchaseOrder.md +8 -2
  42. data/docs/PurchaseOrderLineItem.md +9 -1
  43. data/docs/PurchaseOrdersApi.md +7 -3
  44. data/docs/RemoteResponse.md +5 -1
  45. data/docs/ResponseTypeEnum.md +15 -0
  46. data/docs/SyncStatus.md +2 -2
  47. data/docs/SyncStatusApi.md +1 -1
  48. data/docs/TaxRate.md +1 -1
  49. data/docs/TaxRatesApi.md +2 -2
  50. data/docs/TrackingCategoriesApi.md +7 -3
  51. data/docs/TrackingCategory.md +3 -1
  52. data/docs/Transaction.md +40 -0
  53. data/docs/TransactionLineItem.md +34 -0
  54. data/docs/TransactionsApi.md +181 -0
  55. data/docs/VendorCredit.md +1 -1
  56. data/docs/VendorCreditsApi.md +2 -2
  57. data/lib/merge_accounting_client/api/accounts_api.rb +16 -2
  58. data/lib/merge_accounting_client/api/addresses_api.rb +7 -0
  59. data/lib/merge_accounting_client/api/attachments_api.rb +2 -2
  60. data/lib/merge_accounting_client/api/balance_sheets_api.rb +2 -2
  61. data/lib/merge_accounting_client/api/cash_flow_statements_api.rb +2 -2
  62. data/lib/merge_accounting_client/api/company_info_api.rb +2 -2
  63. data/lib/merge_accounting_client/api/contacts_api.rb +16 -2
  64. data/lib/merge_accounting_client/api/credit_notes_api.rb +16 -2
  65. data/lib/merge_accounting_client/api/expenses_api.rb +2 -2
  66. data/lib/merge_accounting_client/api/income_statements_api.rb +2 -2
  67. data/lib/merge_accounting_client/api/invoices_api.rb +17 -3
  68. data/lib/merge_accounting_client/api/items_api.rb +16 -2
  69. data/lib/merge_accounting_client/api/journal_entries_api.rb +2 -2
  70. data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -0
  71. data/lib/merge_accounting_client/api/payments_api.rb +2 -2
  72. data/lib/merge_accounting_client/api/purchase_orders_api.rb +16 -2
  73. data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
  74. data/lib/merge_accounting_client/api/tax_rates_api.rb +2 -2
  75. data/lib/merge_accounting_client/api/tracking_categories_api.rb +16 -2
  76. data/lib/merge_accounting_client/api/transactions_api.rb +196 -0
  77. data/lib/merge_accounting_client/api/vendor_credits_api.rb +2 -2
  78. data/lib/merge_accounting_client/api_client.rb +3 -0
  79. data/lib/merge_accounting_client/models/account.rb +12 -2
  80. data/lib/merge_accounting_client/models/account_details.rb +15 -4
  81. data/lib/merge_accounting_client/models/account_details_and_actions.rb +12 -1
  82. data/lib/merge_accounting_client/models/account_details_and_actions_status_enum.rb +17 -7
  83. data/lib/merge_accounting_client/models/account_status_enum.rb +17 -7
  84. data/lib/merge_accounting_client/models/accounting_attachment.rb +1 -1
  85. data/lib/merge_accounting_client/models/address_type_enum.rb +17 -7
  86. data/lib/merge_accounting_client/models/balance_sheet.rb +13 -2
  87. data/lib/merge_accounting_client/models/cash_flow_statement.rb +13 -2
  88. data/lib/merge_accounting_client/models/categories_enum.rb +17 -7
  89. data/lib/merge_accounting_client/models/category_enum.rb +17 -7
  90. data/lib/merge_accounting_client/models/category_type_enum.rb +45 -0
  91. data/lib/merge_accounting_client/models/classification_enum.rb +17 -7
  92. data/lib/merge_accounting_client/models/company_info.rb +1 -1
  93. data/lib/merge_accounting_client/models/contact.rb +1 -1
  94. data/lib/merge_accounting_client/models/country_enum.rb +17 -7
  95. data/lib/merge_accounting_client/models/credit_note.rb +35 -2
  96. data/lib/merge_accounting_client/models/credit_note_line_item.rb +380 -0
  97. data/lib/merge_accounting_client/models/credit_note_status_enum.rb +17 -7
  98. data/lib/merge_accounting_client/models/currency_enum.rb +17 -7
  99. data/lib/merge_accounting_client/models/data_passthrough_request.rb +14 -5
  100. data/lib/merge_accounting_client/models/encoding_enum.rb +18 -7
  101. data/lib/merge_accounting_client/models/end_user_details_request.rb +28 -11
  102. data/lib/merge_accounting_client/models/expense.rb +1 -1
  103. data/lib/merge_accounting_client/models/income_statement.rb +13 -2
  104. data/lib/merge_accounting_client/models/invoice_line_item.rb +1 -13
  105. data/lib/merge_accounting_client/models/invoice_type_enum.rb +17 -7
  106. data/lib/merge_accounting_client/models/issue_status_enum.rb +17 -7
  107. data/lib/merge_accounting_client/models/item.rb +1 -1
  108. data/lib/merge_accounting_client/models/journal_entry.rb +12 -1
  109. data/lib/merge_accounting_client/models/journal_entry_request.rb +12 -1
  110. data/lib/merge_accounting_client/models/link_token.rb +13 -4
  111. data/lib/merge_accounting_client/models/method_enum.rb +17 -7
  112. data/lib/merge_accounting_client/models/paginated_transaction_list.rb +240 -0
  113. data/lib/merge_accounting_client/models/payment.rb +1 -1
  114. data/lib/merge_accounting_client/models/purchase_order.rb +35 -2
  115. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +83 -5
  116. data/lib/merge_accounting_client/models/purchase_order_status_enum.rb +17 -7
  117. data/lib/merge_accounting_client/models/remote_data.rb +1 -1
  118. data/lib/merge_accounting_client/models/remote_response.rb +27 -10
  119. data/lib/merge_accounting_client/models/request_format_enum.rb +17 -7
  120. data/lib/merge_accounting_client/models/response_type_enum.rb +45 -0
  121. data/lib/merge_accounting_client/models/state_enum.rb +17 -7
  122. data/lib/merge_accounting_client/models/status7d1_enum.rb +17 -7
  123. data/lib/merge_accounting_client/models/sync_status.rb +0 -10
  124. data/lib/merge_accounting_client/models/sync_status_status_enum.rb +18 -7
  125. data/lib/merge_accounting_client/models/tax_rate.rb +1 -1
  126. data/lib/merge_accounting_client/models/tracking_category.rb +13 -2
  127. data/lib/merge_accounting_client/models/transaction.rb +357 -0
  128. data/lib/merge_accounting_client/models/transaction_line_item.rb +359 -0
  129. data/lib/merge_accounting_client/models/vendor_credit.rb +1 -1
  130. data/lib/merge_accounting_client/version.rb +1 -1
  131. data/lib/merge_accounting_client.rb +7 -1
  132. data/merge_accounting_client.gemspec +1 -1
  133. data/spec/api/accounts_api_spec.rb +3 -1
  134. data/spec/api/addresses_api_spec.rb +1 -0
  135. data/spec/api/attachments_api_spec.rb +1 -1
  136. data/spec/api/balance_sheets_api_spec.rb +1 -1
  137. data/spec/api/cash_flow_statements_api_spec.rb +1 -1
  138. data/spec/api/company_info_api_spec.rb +1 -1
  139. data/spec/api/contacts_api_spec.rb +3 -1
  140. data/spec/api/credit_notes_api_spec.rb +3 -1
  141. data/spec/api/expenses_api_spec.rb +1 -1
  142. data/spec/api/income_statements_api_spec.rb +1 -1
  143. data/spec/api/invoices_api_spec.rb +3 -1
  144. data/spec/api/items_api_spec.rb +3 -1
  145. data/spec/api/journal_entries_api_spec.rb +1 -1
  146. data/spec/api/linked_accounts_api_spec.rb +1 -0
  147. data/spec/api/payments_api_spec.rb +1 -1
  148. data/spec/api/purchase_orders_api_spec.rb +3 -1
  149. data/spec/api/sync_status_api_spec.rb +1 -1
  150. data/spec/api/tax_rates_api_spec.rb +1 -1
  151. data/spec/api/tracking_categories_api_spec.rb +3 -1
  152. data/spec/api/transactions_api_spec.rb +70 -0
  153. data/spec/api/vendor_credits_api_spec.rb +1 -1
  154. data/spec/models/account_details_and_actions_spec.rb +6 -0
  155. data/spec/models/account_details_spec.rb +6 -0
  156. data/spec/models/account_spec.rb +6 -0
  157. data/spec/models/balance_sheet_spec.rb +6 -0
  158. data/spec/models/cash_flow_statement_spec.rb +6 -0
  159. data/spec/models/category_type_enum_spec.rb +28 -0
  160. data/spec/models/credit_note_line_item_spec.rb +94 -0
  161. data/spec/models/credit_note_spec.rb +18 -0
  162. data/spec/models/data_passthrough_request_spec.rb +6 -0
  163. data/spec/models/end_user_details_request_spec.rb +6 -0
  164. data/spec/models/income_statement_spec.rb +6 -0
  165. data/spec/models/invoice_line_item_spec.rb +0 -6
  166. data/spec/models/journal_entry_request_spec.rb +6 -0
  167. data/spec/models/journal_entry_spec.rb +6 -0
  168. data/spec/models/link_token_spec.rb +6 -0
  169. data/spec/models/paginated_transaction_list_spec.rb +46 -0
  170. data/spec/models/purchase_order_line_item_spec.rb +24 -0
  171. data/spec/models/purchase_order_spec.rb +18 -0
  172. data/spec/models/remote_response_spec.rb +12 -0
  173. data/spec/models/response_type_enum_spec.rb +28 -0
  174. data/spec/models/tracking_category_spec.rb +6 -0
  175. data/spec/models/transaction_line_item_spec.rb +82 -0
  176. data/spec/models/transaction_spec.rb +100 -0
  177. metadata +136 -107
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #Merge Accounting API
3
+
4
+ #The unified API for building rich integrations with multiple Accounting & Finance platforms.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: hello@merge.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MergeAccountingClient
16
+ class TransactionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Returns a list of `Transaction` objects.
23
+ # @param x_account_token [String] Token identifying the end user.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
26
+ # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
27
+ # @option opts [String] :cursor The pagination cursor value.
28
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
29
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
30
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
31
+ # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
32
+ # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
33
+ # @option opts [Integer] :page_size Number of results to return per page.
34
+ # @option opts [String] :remote_id The API provider's ID for the given object.
35
+ # @return [PaginatedTransactionList]
36
+ def transactions_list(x_account_token, opts = {})
37
+ data, _status_code, _headers = transactions_list_with_http_info(x_account_token, opts)
38
+ data
39
+ end
40
+
41
+ # Returns a list of `Transaction` objects.
42
+ # @param x_account_token [String] Token identifying the end user.
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [Time] :created_after If provided, will only return objects created after this datetime.
45
+ # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
46
+ # @option opts [String] :cursor The pagination cursor value.
47
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
48
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
49
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
50
+ # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
51
+ # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
52
+ # @option opts [Integer] :page_size Number of results to return per page.
53
+ # @option opts [String] :remote_id The API provider's ID for the given object.
54
+ # @return [Array<(PaginatedTransactionList, Integer, Hash)>] PaginatedTransactionList data, response status code and response headers
55
+ def transactions_list_with_http_info(x_account_token, opts = {})
56
+ if @api_client.config.debugging
57
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.transactions_list ...'
58
+ end
59
+ # verify the required parameter 'x_account_token' is set
60
+ if @api_client.config.client_side_validation && x_account_token.nil?
61
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling TransactionsApi.transactions_list"
62
+ end
63
+ allowable_values = ["line_items"]
64
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
65
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
66
+ end
67
+ # resource path
68
+ local_var_path = '/transactions'
69
+
70
+ # query parameters
71
+ query_params = opts[:query_params] || {}
72
+ query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
73
+ query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
74
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
75
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
76
+ query_params[:'include_deleted_data'] = opts[:'include_deleted_data'] if !opts[:'include_deleted_data'].nil?
77
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
78
+ query_params[:'modified_after'] = opts[:'modified_after'] if !opts[:'modified_after'].nil?
79
+ query_params[:'modified_before'] = opts[:'modified_before'] if !opts[:'modified_before'].nil?
80
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
81
+ query_params[:'remote_id'] = opts[:'remote_id'] if !opts[:'remote_id'].nil?
82
+
83
+ # header parameters
84
+ header_params = opts[:header_params] || {}
85
+ # HTTP header 'Accept' (if needed)
86
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
87
+ header_params[:'X-Account-Token'] = x_account_token
88
+
89
+ # form parameters
90
+ form_params = opts[:form_params] || {}
91
+
92
+ # http body (model)
93
+ post_body = opts[:debug_body]
94
+
95
+ # return_type
96
+ return_type = opts[:debug_return_type] || 'PaginatedTransactionList'
97
+
98
+ # auth_names
99
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
100
+
101
+ new_options = opts.merge(
102
+ :operation => :"TransactionsApi.transactions_list",
103
+ :header_params => header_params,
104
+ :query_params => query_params,
105
+ :form_params => form_params,
106
+ :body => post_body,
107
+ :auth_names => auth_names,
108
+ :return_type => return_type
109
+ )
110
+
111
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called: TransactionsApi#transactions_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
114
+ end
115
+ return data, status_code, headers
116
+ end
117
+
118
+ # Returns a `Transaction` object with the given `id`.
119
+ # @param x_account_token [String] Token identifying the end user.
120
+ # @param id [String]
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
123
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
124
+ # @return [Transaction]
125
+ def transactions_retrieve(x_account_token, id, opts = {})
126
+ data, _status_code, _headers = transactions_retrieve_with_http_info(x_account_token, id, opts)
127
+ data
128
+ end
129
+
130
+ # Returns a &#x60;Transaction&#x60; object with the given &#x60;id&#x60;.
131
+ # @param x_account_token [String] Token identifying the end user.
132
+ # @param id [String]
133
+ # @param [Hash] opts the optional parameters
134
+ # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
135
+ # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
136
+ # @return [Array<(Transaction, Integer, Hash)>] Transaction data, response status code and response headers
137
+ def transactions_retrieve_with_http_info(x_account_token, id, opts = {})
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.transactions_retrieve ...'
140
+ end
141
+ # verify the required parameter 'x_account_token' is set
142
+ if @api_client.config.client_side_validation && x_account_token.nil?
143
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling TransactionsApi.transactions_retrieve"
144
+ end
145
+ # verify the required parameter 'id' is set
146
+ if @api_client.config.client_side_validation && id.nil?
147
+ fail ArgumentError, "Missing the required parameter 'id' when calling TransactionsApi.transactions_retrieve"
148
+ end
149
+ allowable_values = ["line_items"]
150
+ if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
151
+ fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
152
+ end
153
+ # resource path
154
+ local_var_path = '/transactions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
159
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
160
+
161
+ # header parameters
162
+ header_params = opts[:header_params] || {}
163
+ # HTTP header 'Accept' (if needed)
164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
165
+ header_params[:'X-Account-Token'] = x_account_token
166
+
167
+ # form parameters
168
+ form_params = opts[:form_params] || {}
169
+
170
+ # http body (model)
171
+ post_body = opts[:debug_body]
172
+
173
+ # return_type
174
+ return_type = opts[:debug_return_type] || 'Transaction'
175
+
176
+ # auth_names
177
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
178
+
179
+ new_options = opts.merge(
180
+ :operation => :"TransactionsApi.transactions_retrieve",
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => return_type
187
+ )
188
+
189
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: TransactionsApi#transactions_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ return data, status_code, headers
194
+ end
195
+ end
196
+ end
@@ -26,7 +26,7 @@ module MergeAccountingClient
26
26
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
27
27
  # @option opts [String] :cursor The pagination cursor value.
28
28
  # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
29
- # @option opts [Boolean] :include_deleted_data Whether to include data that was deleted in the third-party service.
29
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
30
30
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
31
31
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
32
32
  # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
@@ -45,7 +45,7 @@ module MergeAccountingClient
45
45
  # @option opts [Time] :created_before If provided, will only return objects created before this datetime.
46
46
  # @option opts [String] :cursor The pagination cursor value.
47
47
  # @option opts [String] :expand Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
48
- # @option opts [Boolean] :include_deleted_data Whether to include data that was deleted in the third-party service.
48
+ # @option opts [Boolean] :include_deleted_data Whether to include data that was marked as deleted by third party webhooks.
49
49
  # @option opts [Boolean] :include_remote_data Whether to include the original data Merge fetched from the third-party to produce these models.
50
50
  # @option opts [Time] :modified_after If provided, will only return objects modified after this datetime.
51
51
  # @option opts [Time] :modified_before If provided, will only return objects modified before this datetime.
@@ -274,6 +274,9 @@ module MergeAccountingClient
274
274
  {}.tap do |hash|
275
275
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
276
276
  end
277
+ when 'AnyType'
278
+ # Return AnyType response as Object directly
279
+ data
277
280
  else
278
281
  # models (e.g. Pet) or oneOf
279
282
  klass = MergeAccountingClient.const_get(return_type)
@@ -47,7 +47,9 @@ module MergeAccountingClient
47
47
  # The account's number.
48
48
  attr_accessor :account_number
49
49
 
50
- # Indicates whether or not this object has been deleted on the third-party.
50
+ attr_accessor :parent_account
51
+
52
+ # Indicates whether or not this object has been deleted by third party webhooks.
51
53
  attr_accessor :remote_was_deleted
52
54
 
53
55
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -64,6 +66,7 @@ module MergeAccountingClient
64
66
  :'current_balance' => :'current_balance',
65
67
  :'currency' => :'currency',
66
68
  :'account_number' => :'account_number',
69
+ :'parent_account' => :'parent_account',
67
70
  :'remote_was_deleted' => :'remote_was_deleted'
68
71
  }
69
72
  end
@@ -87,6 +90,7 @@ module MergeAccountingClient
87
90
  :'current_balance' => :'Float',
88
91
  :'currency' => :'CurrencyEnum',
89
92
  :'account_number' => :'String',
93
+ :'parent_account' => :'String',
90
94
  :'remote_was_deleted' => :'Boolean'
91
95
  }
92
96
  end
@@ -104,6 +108,7 @@ module MergeAccountingClient
104
108
  :'current_balance',
105
109
  :'currency',
106
110
  :'account_number',
111
+ :'parent_account',
107
112
  ])
108
113
  end
109
114
 
@@ -168,6 +173,10 @@ module MergeAccountingClient
168
173
  self.account_number = attributes[:'account_number']
169
174
  end
170
175
 
176
+ if attributes.key?(:'parent_account')
177
+ self.parent_account = attributes[:'parent_account']
178
+ end
179
+
171
180
  if attributes.key?(:'remote_was_deleted')
172
181
  self.remote_was_deleted = attributes[:'remote_was_deleted']
173
182
  end
@@ -202,6 +211,7 @@ module MergeAccountingClient
202
211
  current_balance == o.current_balance &&
203
212
  currency == o.currency &&
204
213
  account_number == o.account_number &&
214
+ parent_account == o.parent_account &&
205
215
  remote_was_deleted == o.remote_was_deleted
206
216
  end
207
217
 
@@ -214,7 +224,7 @@ module MergeAccountingClient
214
224
  # Calculates hash code according to all attributes.
215
225
  # @return [Integer] Hash code
216
226
  def hash
217
- [id, remote_id, remote_data, name, description, classification, type, status, current_balance, currency, account_number, remote_was_deleted].hash
227
+ [id, remote_id, remote_data, name, description, classification, type, status, current_balance, currency, account_number, parent_account, remote_was_deleted].hash
218
228
  end
219
229
 
220
230
  # Builds the object from hash
@@ -33,6 +33,9 @@ module MergeAccountingClient
33
33
 
34
34
  attr_accessor :webhook_listener_url
35
35
 
36
+ # Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is `null` for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.
37
+ attr_accessor :is_duplicate
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -44,7 +47,8 @@ module MergeAccountingClient
44
47
  :'end_user_organization_name' => :'end_user_organization_name',
45
48
  :'end_user_email_address' => :'end_user_email_address',
46
49
  :'status' => :'status',
47
- :'webhook_listener_url' => :'webhook_listener_url'
50
+ :'webhook_listener_url' => :'webhook_listener_url',
51
+ :'is_duplicate' => :'is_duplicate'
48
52
  }
49
53
  end
50
54
 
@@ -64,7 +68,8 @@ module MergeAccountingClient
64
68
  :'end_user_organization_name' => :'String',
65
69
  :'end_user_email_address' => :'String',
66
70
  :'status' => :'String',
67
- :'webhook_listener_url' => :'String'
71
+ :'webhook_listener_url' => :'String',
72
+ :'is_duplicate' => :'Boolean'
68
73
  }
69
74
  end
70
75
 
@@ -72,6 +77,7 @@ module MergeAccountingClient
72
77
  def self.openapi_nullable
73
78
  Set.new([
74
79
  :'category',
80
+ :'is_duplicate'
75
81
  ])
76
82
  end
77
83
 
@@ -125,6 +131,10 @@ module MergeAccountingClient
125
131
  if attributes.key?(:'webhook_listener_url')
126
132
  self.webhook_listener_url = attributes[:'webhook_listener_url']
127
133
  end
134
+
135
+ if attributes.key?(:'is_duplicate')
136
+ self.is_duplicate = attributes[:'is_duplicate']
137
+ end
128
138
  end
129
139
 
130
140
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -153,7 +163,8 @@ module MergeAccountingClient
153
163
  end_user_organization_name == o.end_user_organization_name &&
154
164
  end_user_email_address == o.end_user_email_address &&
155
165
  status == o.status &&
156
- webhook_listener_url == o.webhook_listener_url
166
+ webhook_listener_url == o.webhook_listener_url &&
167
+ is_duplicate == o.is_duplicate
157
168
  end
158
169
 
159
170
  # @see the `==` method
@@ -165,7 +176,7 @@ module MergeAccountingClient
165
176
  # Calculates hash code according to all attributes.
166
177
  # @return [Integer] Hash code
167
178
  def hash
168
- [id, integration, integration_slug, category, end_user_origin_id, end_user_organization_name, end_user_email_address, status, webhook_listener_url].hash
179
+ [id, integration, integration_slug, category, end_user_origin_id, end_user_organization_name, end_user_email_address, status, webhook_listener_url, is_duplicate].hash
169
180
  end
170
181
 
171
182
  # Builds the object from hash
@@ -32,6 +32,9 @@ module MergeAccountingClient
32
32
 
33
33
  attr_accessor :webhook_listener_url
34
34
 
35
+ # Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is `null` for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.
36
+ attr_accessor :is_duplicate
37
+
35
38
  attr_accessor :integration
36
39
 
37
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -45,6 +48,7 @@ module MergeAccountingClient
45
48
  :'end_user_organization_name' => :'end_user_organization_name',
46
49
  :'end_user_email_address' => :'end_user_email_address',
47
50
  :'webhook_listener_url' => :'webhook_listener_url',
51
+ :'is_duplicate' => :'is_duplicate',
48
52
  :'integration' => :'integration'
49
53
  }
50
54
  end
@@ -65,6 +69,7 @@ module MergeAccountingClient
65
69
  :'end_user_organization_name' => :'String',
66
70
  :'end_user_email_address' => :'String',
67
71
  :'webhook_listener_url' => :'String',
72
+ :'is_duplicate' => :'Boolean',
68
73
  :'integration' => :'AccountDetailsAndActionsIntegration'
69
74
  }
70
75
  end
@@ -72,6 +77,7 @@ module MergeAccountingClient
72
77
  # List of attributes with nullable: true
73
78
  def self.openapi_nullable
74
79
  Set.new([
80
+ :'is_duplicate',
75
81
  ])
76
82
  end
77
83
 
@@ -122,6 +128,10 @@ module MergeAccountingClient
122
128
  self.webhook_listener_url = attributes[:'webhook_listener_url']
123
129
  end
124
130
 
131
+ if attributes.key?(:'is_duplicate')
132
+ self.is_duplicate = attributes[:'is_duplicate']
133
+ end
134
+
125
135
  if attributes.key?(:'integration')
126
136
  self.integration = attributes[:'integration']
127
137
  end
@@ -178,6 +188,7 @@ module MergeAccountingClient
178
188
  end_user_organization_name == o.end_user_organization_name &&
179
189
  end_user_email_address == o.end_user_email_address &&
180
190
  webhook_listener_url == o.webhook_listener_url &&
191
+ is_duplicate == o.is_duplicate &&
181
192
  integration == o.integration
182
193
  end
183
194
 
@@ -190,7 +201,7 @@ module MergeAccountingClient
190
201
  # Calculates hash code according to all attributes.
191
202
  # @return [Integer] Hash code
192
203
  def hash
193
- [id, category, status, status_detail, end_user_origin_id, end_user_organization_name, end_user_email_address, webhook_listener_url, integration].hash
204
+ [id, category, status, status_detail, end_user_origin_id, end_user_organization_name, end_user_email_address, webhook_listener_url, is_duplicate, integration].hash
194
205
  end
195
206
 
196
207
  # Builds the object from hash
@@ -19,18 +19,28 @@ module MergeAccountingClient
19
19
  INCOMPLETE = "INCOMPLETE".freeze
20
20
  RELINK_NEEDED = "RELINK_NEEDED".freeze
21
21
 
22
- # Builds the enum from string
23
- # @param [String] The enum value in the form of the string
24
- # @return [String] The enum value
25
- def self.build_from_hash(value)
26
- new.build_from_hash(value)
27
- end
22
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
23
+
24
+ attr_accessor :value
25
+ attr_accessor :raw_value
28
26
 
29
27
  # Builds the enum from string
30
28
  # @param [String] The enum value in the form of the string
31
29
  # @return [String] The enum value
32
30
  def build_from_hash(value)
33
- value
31
+ @raw_value = value
32
+ if ["COMPLETE", "INCOMPLETE", "RELINK_NEEDED", ].include? value
33
+ @value = value
34
+ else
35
+ @value = MERGE_NONSTANDARD_VALUE
36
+ end
37
+
38
+ self
39
+ end
40
+
41
+ def self.build_from_hash(value)
42
+ IssueStatusEnum.new.build_from_hash(value)
34
43
  end
35
44
  end
45
+
36
46
  end
@@ -19,18 +19,28 @@ module MergeAccountingClient
19
19
  PENDING = "PENDING".freeze
20
20
  INACTIVE = "INACTIVE".freeze
21
21
 
22
- # Builds the enum from string
23
- # @param [String] The enum value in the form of the string
24
- # @return [String] The enum value
25
- def self.build_from_hash(value)
26
- new.build_from_hash(value)
27
- end
22
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
23
+
24
+ attr_accessor :value
25
+ attr_accessor :raw_value
28
26
 
29
27
  # Builds the enum from string
30
28
  # @param [String] The enum value in the form of the string
31
29
  # @return [String] The enum value
32
30
  def build_from_hash(value)
33
- value
31
+ @raw_value = value
32
+ if ["ACTIVE", "PENDING", "INACTIVE", ].include? value
33
+ @value = value
34
+ else
35
+ @value = MERGE_NONSTANDARD_VALUE
36
+ end
37
+
38
+ self
39
+ end
40
+
41
+ def self.build_from_hash(value)
42
+ IssueStatusEnum.new.build_from_hash(value)
34
43
  end
35
44
  end
45
+
36
46
  end
@@ -29,7 +29,7 @@ module MergeAccountingClient
29
29
  # The attachment's url.
30
30
  attr_accessor :file_url
31
31
 
32
- # Indicates whether or not this object has been deleted on the third-party.
32
+ # Indicates whether or not this object has been deleted by third party webhooks.
33
33
  attr_accessor :remote_was_deleted
34
34
 
35
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,18 +18,28 @@ module MergeAccountingClient
18
18
  BILLING = "BILLING".freeze
19
19
  SHIPPING = "SHIPPING".freeze
20
20
 
21
- # Builds the enum from string
22
- # @param [String] The enum value in the form of the string
23
- # @return [String] The enum value
24
- def self.build_from_hash(value)
25
- new.build_from_hash(value)
26
- end
21
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
22
+
23
+ attr_accessor :value
24
+ attr_accessor :raw_value
27
25
 
28
26
  # Builds the enum from string
29
27
  # @param [String] The enum value in the form of the string
30
28
  # @return [String] The enum value
31
29
  def build_from_hash(value)
32
- value
30
+ @raw_value = value
31
+ if ["BILLING", "SHIPPING", ].include? value
32
+ @value = value
33
+ else
34
+ @value = MERGE_NONSTANDARD_VALUE
35
+ end
36
+
37
+ self
38
+ end
39
+
40
+ def self.build_from_hash(value)
41
+ IssueStatusEnum.new.build_from_hash(value)
33
42
  end
34
43
  end
44
+
35
45
  end
@@ -26,6 +26,9 @@ module MergeAccountingClient
26
26
  # The balance sheet's name.
27
27
  attr_accessor :name
28
28
 
29
+ # The balance sheet's currency.
30
+ attr_accessor :currency
31
+
29
32
  # The balance sheet's date. The balance sheet data will reflect the company's financial position this point in time.
30
33
  attr_accessor :date
31
34
 
@@ -41,7 +44,7 @@ module MergeAccountingClient
41
44
  # The time that balance sheet was generated by the accounting system.
42
45
  attr_accessor :remote_generated_at
43
46
 
44
- # Indicates whether or not this object has been deleted on the third-party.
47
+ # Indicates whether or not this object has been deleted by third party webhooks.
45
48
  attr_accessor :remote_was_deleted
46
49
 
47
50
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -51,6 +54,7 @@ module MergeAccountingClient
51
54
  :'remote_id' => :'remote_id',
52
55
  :'remote_data' => :'remote_data',
53
56
  :'name' => :'name',
57
+ :'currency' => :'currency',
54
58
  :'date' => :'date',
55
59
  :'net_assets' => :'net_assets',
56
60
  :'assets' => :'assets',
@@ -73,6 +77,7 @@ module MergeAccountingClient
73
77
  :'remote_id' => :'String',
74
78
  :'remote_data' => :'Array<RemoteData>',
75
79
  :'name' => :'String',
80
+ :'currency' => :'CurrencyEnum',
76
81
  :'date' => :'Time',
77
82
  :'net_assets' => :'Float',
78
83
  :'assets' => :'Array<ReportItem>',
@@ -89,6 +94,7 @@ module MergeAccountingClient
89
94
  :'remote_id',
90
95
  :'remote_data',
91
96
  :'name',
97
+ :'currency',
92
98
  :'date',
93
99
  :'net_assets',
94
100
  :'remote_generated_at',
@@ -128,6 +134,10 @@ module MergeAccountingClient
128
134
  self.name = attributes[:'name']
129
135
  end
130
136
 
137
+ if attributes.key?(:'currency')
138
+ self.currency = attributes[:'currency']
139
+ end
140
+
131
141
  if attributes.key?(:'date')
132
142
  self.date = attributes[:'date']
133
143
  end
@@ -185,6 +195,7 @@ module MergeAccountingClient
185
195
  remote_id == o.remote_id &&
186
196
  remote_data == o.remote_data &&
187
197
  name == o.name &&
198
+ currency == o.currency &&
188
199
  date == o.date &&
189
200
  net_assets == o.net_assets &&
190
201
  assets == o.assets &&
@@ -203,7 +214,7 @@ module MergeAccountingClient
203
214
  # Calculates hash code according to all attributes.
204
215
  # @return [Integer] Hash code
205
216
  def hash
206
- [id, remote_id, remote_data, name, date, net_assets, assets, liabilities, equity, remote_generated_at, remote_was_deleted].hash
217
+ [id, remote_id, remote_data, name, currency, date, net_assets, assets, liabilities, equity, remote_generated_at, remote_was_deleted].hash
207
218
  end
208
219
 
209
220
  # Builds the object from hash