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
@@ -44,7 +44,7 @@ module MergeAccountingClient
44
44
 
45
45
  attr_accessor :lines
46
46
 
47
- # 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.
48
48
  attr_accessor :remote_was_deleted
49
49
 
50
50
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -26,6 +26,9 @@ module MergeAccountingClient
26
26
  # The income statement's name.
27
27
  attr_accessor :name
28
28
 
29
+ # The income statement's currency.
30
+ attr_accessor :currency
31
+
29
32
  # The income statement's start period.
30
33
  attr_accessor :start_period
31
34
 
@@ -49,7 +52,7 @@ module MergeAccountingClient
49
52
  # The income statement's net income.
50
53
  attr_accessor :net_income
51
54
 
52
- # Indicates whether or not this object has been deleted on the third-party.
55
+ # Indicates whether or not this object has been deleted by third party webhooks.
53
56
  attr_accessor :remote_was_deleted
54
57
 
55
58
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -59,6 +62,7 @@ module MergeAccountingClient
59
62
  :'remote_id' => :'remote_id',
60
63
  :'remote_data' => :'remote_data',
61
64
  :'name' => :'name',
65
+ :'currency' => :'currency',
62
66
  :'start_period' => :'start_period',
63
67
  :'end_period' => :'end_period',
64
68
  :'income' => :'income',
@@ -84,6 +88,7 @@ module MergeAccountingClient
84
88
  :'remote_id' => :'String',
85
89
  :'remote_data' => :'Array<RemoteData>',
86
90
  :'name' => :'String',
91
+ :'currency' => :'CurrencyEnum',
87
92
  :'start_period' => :'Time',
88
93
  :'end_period' => :'Time',
89
94
  :'income' => :'Array<ReportItem>',
@@ -103,6 +108,7 @@ module MergeAccountingClient
103
108
  :'remote_id',
104
109
  :'remote_data',
105
110
  :'name',
111
+ :'currency',
106
112
  :'start_period',
107
113
  :'end_period',
108
114
  :'gross_profit',
@@ -144,6 +150,10 @@ module MergeAccountingClient
144
150
  self.name = attributes[:'name']
145
151
  end
146
152
 
153
+ if attributes.key?(:'currency')
154
+ self.currency = attributes[:'currency']
155
+ end
156
+
147
157
  if attributes.key?(:'start_period')
148
158
  self.start_period = attributes[:'start_period']
149
159
  end
@@ -215,6 +225,7 @@ module MergeAccountingClient
215
225
  remote_id == o.remote_id &&
216
226
  remote_data == o.remote_data &&
217
227
  name == o.name &&
228
+ currency == o.currency &&
218
229
  start_period == o.start_period &&
219
230
  end_period == o.end_period &&
220
231
  income == o.income &&
@@ -236,7 +247,7 @@ module MergeAccountingClient
236
247
  # Calculates hash code according to all attributes.
237
248
  # @return [Integer] Hash code
238
249
  def hash
239
- [id, remote_id, remote_data, name, start_period, end_period, income, cost_of_sales, gross_profit, operating_expenses, net_operating_income, non_operating_expenses, net_income, remote_was_deleted].hash
250
+ [id, remote_id, remote_data, name, currency, start_period, end_period, income, cost_of_sales, gross_profit, operating_expenses, net_operating_income, non_operating_expenses, net_income, remote_was_deleted].hash
240
251
  end
241
252
 
242
253
  # Builds the object from hash
@@ -21,8 +21,6 @@ module MergeAccountingClient
21
21
  # The third-party API ID of the matching object.
22
22
  attr_accessor :remote_id
23
23
 
24
- attr_accessor :remote_data
25
-
26
24
  # The line item's description.
27
25
  attr_accessor :description
28
26
 
@@ -46,7 +44,6 @@ module MergeAccountingClient
46
44
  {
47
45
  :'id' => :'id',
48
46
  :'remote_id' => :'remote_id',
49
- :'remote_data' => :'remote_data',
50
47
  :'description' => :'description',
51
48
  :'unit_price' => :'unit_price',
52
49
  :'quantity' => :'quantity',
@@ -67,7 +64,6 @@ module MergeAccountingClient
67
64
  {
68
65
  :'id' => :'String',
69
66
  :'remote_id' => :'String',
70
- :'remote_data' => :'Array<RemoteData>',
71
67
  :'description' => :'String',
72
68
  :'unit_price' => :'Float',
73
69
  :'quantity' => :'Float',
@@ -82,7 +78,6 @@ module MergeAccountingClient
82
78
  def self.openapi_nullable
83
79
  Set.new([
84
80
  :'remote_id',
85
- :'remote_data',
86
81
  :'description',
87
82
  :'unit_price',
88
83
  :'quantity',
@@ -116,12 +111,6 @@ module MergeAccountingClient
116
111
  self.remote_id = attributes[:'remote_id']
117
112
  end
118
113
 
119
- if attributes.key?(:'remote_data')
120
- if (value = attributes[:'remote_data']).is_a?(Array)
121
- self.remote_data = value
122
- end
123
- end
124
-
125
114
  if attributes.key?(:'description')
126
115
  self.description = attributes[:'description']
127
116
  end
@@ -171,7 +160,6 @@ module MergeAccountingClient
171
160
  self.class == o.class &&
172
161
  id == o.id &&
173
162
  remote_id == o.remote_id &&
174
- remote_data == o.remote_data &&
175
163
  description == o.description &&
176
164
  unit_price == o.unit_price &&
177
165
  quantity == o.quantity &&
@@ -190,7 +178,7 @@ module MergeAccountingClient
190
178
  # Calculates hash code according to all attributes.
191
179
  # @return [Integer] Hash code
192
180
  def hash
193
- [id, remote_id, remote_data, description, unit_price, quantity, total_amount, item, account, tracking_category].hash
181
+ [id, remote_id, description, unit_price, quantity, total_amount, item, account, tracking_category].hash
194
182
  end
195
183
 
196
184
  # Builds the object from hash
@@ -18,18 +18,28 @@ module MergeAccountingClient
18
18
  RECEIVABLE = "ACCOUNTS_RECEIVABLE".freeze
19
19
  PAYABLE = "ACCOUNTS_PAYABLE".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 ["ACCOUNTS_RECEIVABLE", "ACCOUNTS_PAYABLE", ].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
@@ -18,18 +18,28 @@ module MergeAccountingClient
18
18
  ONGOING = "ONGOING".freeze
19
19
  RESOLVED = "RESOLVED".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 ["ONGOING", "RESOLVED", ].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
@@ -42,7 +42,7 @@ module MergeAccountingClient
42
42
  # When the third party's item note was updated.
43
43
  attr_accessor :remote_updated_at
44
44
 
45
- # Indicates whether or not this object has been deleted on the third-party.
45
+ # Indicates whether or not this object has been deleted by third party webhooks.
46
46
  attr_accessor :remote_was_deleted
47
47
 
48
48
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -29,6 +29,9 @@ module MergeAccountingClient
29
29
  # When the third party's journal entry was created.
30
30
  attr_accessor :remote_created_at
31
31
 
32
+ # When the third party's journal entry was updated.
33
+ attr_accessor :remote_updated_at
34
+
32
35
  # Array of `Payment` object IDs.
33
36
  attr_accessor :payments
34
37
 
@@ -50,6 +53,7 @@ module MergeAccountingClient
50
53
  :'remote_data' => :'remote_data',
51
54
  :'transaction_date' => :'transaction_date',
52
55
  :'remote_created_at' => :'remote_created_at',
56
+ :'remote_updated_at' => :'remote_updated_at',
53
57
  :'payments' => :'payments',
54
58
  :'memo' => :'memo',
55
59
  :'currency' => :'currency',
@@ -71,6 +75,7 @@ module MergeAccountingClient
71
75
  :'remote_data' => :'Array<RemoteData>',
72
76
  :'transaction_date' => :'Time',
73
77
  :'remote_created_at' => :'Time',
78
+ :'remote_updated_at' => :'Time',
74
79
  :'payments' => :'Array<String>',
75
80
  :'memo' => :'String',
76
81
  :'currency' => :'CurrencyEnum',
@@ -86,6 +91,7 @@ module MergeAccountingClient
86
91
  :'remote_data',
87
92
  :'transaction_date',
88
93
  :'remote_created_at',
94
+ :'remote_updated_at',
89
95
  :'memo',
90
96
  :'currency',
91
97
  ])
@@ -128,6 +134,10 @@ module MergeAccountingClient
128
134
  self.remote_created_at = attributes[:'remote_created_at']
129
135
  end
130
136
 
137
+ if attributes.key?(:'remote_updated_at')
138
+ self.remote_updated_at = attributes[:'remote_updated_at']
139
+ end
140
+
131
141
  if attributes.key?(:'payments')
132
142
  if (value = attributes[:'payments']).is_a?(Array)
133
143
  self.payments = value
@@ -176,6 +186,7 @@ module MergeAccountingClient
176
186
  remote_data == o.remote_data &&
177
187
  transaction_date == o.transaction_date &&
178
188
  remote_created_at == o.remote_created_at &&
189
+ remote_updated_at == o.remote_updated_at &&
179
190
  payments == o.payments &&
180
191
  memo == o.memo &&
181
192
  currency == o.currency &&
@@ -192,7 +203,7 @@ module MergeAccountingClient
192
203
  # Calculates hash code according to all attributes.
193
204
  # @return [Integer] Hash code
194
205
  def hash
195
- [id, remote_id, remote_data, transaction_date, remote_created_at, payments, memo, currency, lines, remote_was_deleted].hash
206
+ [id, remote_id, remote_data, transaction_date, remote_created_at, remote_updated_at, payments, memo, currency, lines, remote_was_deleted].hash
196
207
  end
197
208
 
198
209
  # Builds the object from hash
@@ -25,6 +25,9 @@ module MergeAccountingClient
25
25
  # When the third party's journal entry was created.
26
26
  attr_accessor :remote_created_at
27
27
 
28
+ # When the third party's journal entry was updated.
29
+ attr_accessor :remote_updated_at
30
+
28
31
  # Array of `Payment` object IDs.
29
32
  attr_accessor :payments
30
33
 
@@ -40,6 +43,7 @@ module MergeAccountingClient
40
43
  :'remote_id' => :'remote_id',
41
44
  :'transaction_date' => :'transaction_date',
42
45
  :'remote_created_at' => :'remote_created_at',
46
+ :'remote_updated_at' => :'remote_updated_at',
43
47
  :'payments' => :'payments',
44
48
  :'memo' => :'memo',
45
49
  :'currency' => :'currency'
@@ -57,6 +61,7 @@ module MergeAccountingClient
57
61
  :'remote_id' => :'String',
58
62
  :'transaction_date' => :'Time',
59
63
  :'remote_created_at' => :'Time',
64
+ :'remote_updated_at' => :'Time',
60
65
  :'payments' => :'Array<String>',
61
66
  :'memo' => :'String',
62
67
  :'currency' => :'CurrencyEnum'
@@ -69,6 +74,7 @@ module MergeAccountingClient
69
74
  :'remote_id',
70
75
  :'transaction_date',
71
76
  :'remote_created_at',
77
+ :'remote_updated_at',
72
78
  :'memo',
73
79
  :'currency'
74
80
  ])
@@ -101,6 +107,10 @@ module MergeAccountingClient
101
107
  self.remote_created_at = attributes[:'remote_created_at']
102
108
  end
103
109
 
110
+ if attributes.key?(:'remote_updated_at')
111
+ self.remote_updated_at = attributes[:'remote_updated_at']
112
+ end
113
+
104
114
  if attributes.key?(:'payments')
105
115
  if (value = attributes[:'payments']).is_a?(Array)
106
116
  self.payments = value
@@ -137,6 +147,7 @@ module MergeAccountingClient
137
147
  remote_id == o.remote_id &&
138
148
  transaction_date == o.transaction_date &&
139
149
  remote_created_at == o.remote_created_at &&
150
+ remote_updated_at == o.remote_updated_at &&
140
151
  payments == o.payments &&
141
152
  memo == o.memo &&
142
153
  currency == o.currency
@@ -151,7 +162,7 @@ module MergeAccountingClient
151
162
  # Calculates hash code according to all attributes.
152
163
  # @return [Integer] Hash code
153
164
  def hash
154
- [remote_id, transaction_date, remote_created_at, payments, memo, currency].hash
165
+ [remote_id, transaction_date, remote_created_at, remote_updated_at, payments, memo, currency].hash
155
166
  end
156
167
 
157
168
  # Builds the object from hash
@@ -19,11 +19,14 @@ module MergeAccountingClient
19
19
 
20
20
  attr_accessor :integration_name
21
21
 
22
+ attr_accessor :magic_link_url
23
+
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
27
  :'link_token' => :'link_token',
26
- :'integration_name' => :'integration_name'
28
+ :'integration_name' => :'integration_name',
29
+ :'magic_link_url' => :'magic_link_url'
27
30
  }
28
31
  end
29
32
 
@@ -36,7 +39,8 @@ module MergeAccountingClient
36
39
  def self.openapi_types
37
40
  {
38
41
  :'link_token' => :'String',
39
- :'integration_name' => :'String'
42
+ :'integration_name' => :'String',
43
+ :'magic_link_url' => :'String'
40
44
  }
41
45
  end
42
46
 
@@ -68,6 +72,10 @@ module MergeAccountingClient
68
72
  if attributes.key?(:'integration_name')
69
73
  self.integration_name = attributes[:'integration_name']
70
74
  end
75
+
76
+ if attributes.key?(:'magic_link_url')
77
+ self.magic_link_url = attributes[:'magic_link_url']
78
+ end
71
79
  end
72
80
 
73
81
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,7 +107,8 @@ module MergeAccountingClient
99
107
  return true if self.equal?(o)
100
108
  self.class == o.class &&
101
109
  link_token == o.link_token &&
102
- integration_name == o.integration_name
110
+ integration_name == o.integration_name &&
111
+ magic_link_url == o.magic_link_url
103
112
  end
104
113
 
105
114
  # @see the `==` method
@@ -111,7 +120,7 @@ module MergeAccountingClient
111
120
  # Calculates hash code according to all attributes.
112
121
  # @return [Integer] Hash code
113
122
  def hash
114
- [link_token, integration_name].hash
123
+ [link_token, integration_name, magic_link_url].hash
115
124
  end
116
125
 
117
126
  # Builds the object from hash
@@ -23,18 +23,28 @@ module MergeAccountingClient
23
23
  PATCH = "PATCH".freeze
24
24
  DELETE = "DELETE".freeze
25
25
 
26
- # Builds the enum from string
27
- # @param [String] The enum value in the form of the string
28
- # @return [String] The enum value
29
- def self.build_from_hash(value)
30
- new.build_from_hash(value)
31
- end
26
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
27
+
28
+ attr_accessor :value
29
+ attr_accessor :raw_value
32
30
 
33
31
  # Builds the enum from string
34
32
  # @param [String] The enum value in the form of the string
35
33
  # @return [String] The enum value
36
34
  def build_from_hash(value)
37
- value
35
+ @raw_value = value
36
+ if ["GET", "OPTIONS", "HEAD", "POST", "PUT", "PATCH", "DELETE", ].include? value
37
+ @value = value
38
+ else
39
+ @value = MERGE_NONSTANDARD_VALUE
40
+ end
41
+
42
+ self
43
+ end
44
+
45
+ def self.build_from_hash(value)
46
+ IssueStatusEnum.new.build_from_hash(value)
38
47
  end
39
48
  end
49
+
40
50
  end
@@ -0,0 +1,240 @@
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 'date'
14
+ require 'time'
15
+
16
+ module MergeAccountingClient
17
+ class PaginatedTransactionList
18
+ attr_accessor :_next
19
+
20
+ attr_accessor :previous
21
+
22
+ attr_accessor :results
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'_next' => :'next',
28
+ :'previous' => :'previous',
29
+ :'results' => :'results'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<Transaction>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'_next',
51
+ :'previous',
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::PaginatedTransactionList` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::PaginatedTransactionList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'_next')
71
+ self._next = attributes[:'_next']
72
+ end
73
+
74
+ if attributes.key?(:'previous')
75
+ self.previous = attributes[:'previous']
76
+ end
77
+
78
+ if attributes.key?(:'results')
79
+ if (value = attributes[:'results']).is_a?(Array)
80
+ self.results = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ _next == o._next &&
104
+ previous == o.previous &&
105
+ results == o.results
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [_next, previous, results].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = MergeAccountingClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -36,7 +36,7 @@ module MergeAccountingClient
36
36
  # When the third party's payment entry was updated.
37
37
  attr_accessor :remote_updated_at
38
38
 
39
- # Indicates whether or not this object has been deleted on the third-party.
39
+ # Indicates whether or not this object has been deleted by third party webhooks.
40
40
  attr_accessor :remote_was_deleted
41
41
 
42
42
  # Attribute mapping from ruby-style variable name to JSON key.