merge_accounting_client 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +16 -0
  3. data/README.md +10 -5
  4. data/docs/Account.md +1 -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 +1 -1
  12. data/docs/BalanceSheetsApi.md +2 -2
  13. data/docs/CashFlowStatement.md +1 -1
  14. data/docs/CashFlowStatementsApi.md +2 -2
  15. data/docs/CompanyInfo.md +1 -1
  16. data/docs/CompanyInfoApi.md +2 -2
  17. data/docs/Contact.md +1 -1
  18. data/docs/ContactsApi.md +7 -3
  19. data/docs/CreditNote.md +7 -1
  20. data/docs/CreditNoteLineItem.md +38 -0
  21. data/docs/CreditNotesApi.md +7 -3
  22. data/docs/DataPassthroughRequest.md +3 -1
  23. data/docs/EndUserDetailsRequest.md +9 -7
  24. data/docs/Expense.md +1 -1
  25. data/docs/ExpensesApi.md +2 -2
  26. data/docs/IncomeStatement.md +1 -1
  27. data/docs/IncomeStatementsApi.md +2 -2
  28. data/docs/InvoiceLineItem.md +0 -2
  29. data/docs/InvoicesApi.md +8 -4
  30. data/docs/Item.md +1 -1
  31. data/docs/ItemsApi.md +7 -3
  32. data/docs/JournalEntriesApi.md +2 -2
  33. data/docs/LinkToken.md +3 -1
  34. data/docs/LinkedAccountsApi.md +2 -0
  35. data/docs/PaginatedTransactionList.md +22 -0
  36. data/docs/Payment.md +1 -1
  37. data/docs/PaymentsApi.md +2 -2
  38. data/docs/PurchaseOrder.md +8 -2
  39. data/docs/PurchaseOrderLineItem.md +9 -1
  40. data/docs/PurchaseOrdersApi.md +7 -3
  41. data/docs/RemoteResponse.md +2 -0
  42. data/docs/SyncStatusApi.md +1 -1
  43. data/docs/TaxRate.md +1 -1
  44. data/docs/TaxRatesApi.md +2 -2
  45. data/docs/TrackingCategoriesApi.md +7 -3
  46. data/docs/TrackingCategory.md +1 -1
  47. data/docs/Transaction.md +40 -0
  48. data/docs/TransactionLineItem.md +34 -0
  49. data/docs/TransactionsApi.md +181 -0
  50. data/docs/VendorCredit.md +1 -1
  51. data/docs/VendorCreditsApi.md +2 -2
  52. data/lib/merge_accounting_client/api/accounts_api.rb +16 -2
  53. data/lib/merge_accounting_client/api/addresses_api.rb +7 -0
  54. data/lib/merge_accounting_client/api/attachments_api.rb +2 -2
  55. data/lib/merge_accounting_client/api/balance_sheets_api.rb +2 -2
  56. data/lib/merge_accounting_client/api/cash_flow_statements_api.rb +2 -2
  57. data/lib/merge_accounting_client/api/company_info_api.rb +2 -2
  58. data/lib/merge_accounting_client/api/contacts_api.rb +16 -2
  59. data/lib/merge_accounting_client/api/credit_notes_api.rb +16 -2
  60. data/lib/merge_accounting_client/api/expenses_api.rb +2 -2
  61. data/lib/merge_accounting_client/api/income_statements_api.rb +2 -2
  62. data/lib/merge_accounting_client/api/invoices_api.rb +17 -3
  63. data/lib/merge_accounting_client/api/items_api.rb +16 -2
  64. data/lib/merge_accounting_client/api/journal_entries_api.rb +2 -2
  65. data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -0
  66. data/lib/merge_accounting_client/api/payments_api.rb +2 -2
  67. data/lib/merge_accounting_client/api/purchase_orders_api.rb +16 -2
  68. data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
  69. data/lib/merge_accounting_client/api/tax_rates_api.rb +2 -2
  70. data/lib/merge_accounting_client/api/tracking_categories_api.rb +16 -2
  71. data/lib/merge_accounting_client/api/transactions_api.rb +196 -0
  72. data/lib/merge_accounting_client/api/vendor_credits_api.rb +2 -2
  73. data/lib/merge_accounting_client/models/account.rb +1 -1
  74. data/lib/merge_accounting_client/models/account_details.rb +15 -4
  75. data/lib/merge_accounting_client/models/account_details_and_actions.rb +12 -1
  76. data/lib/merge_accounting_client/models/account_details_and_actions_status_enum.rb +17 -7
  77. data/lib/merge_accounting_client/models/account_status_enum.rb +17 -7
  78. data/lib/merge_accounting_client/models/accounting_attachment.rb +1 -1
  79. data/lib/merge_accounting_client/models/address_type_enum.rb +17 -7
  80. data/lib/merge_accounting_client/models/balance_sheet.rb +1 -1
  81. data/lib/merge_accounting_client/models/cash_flow_statement.rb +1 -1
  82. data/lib/merge_accounting_client/models/categories_enum.rb +17 -7
  83. data/lib/merge_accounting_client/models/category_enum.rb +17 -7
  84. data/lib/merge_accounting_client/models/classification_enum.rb +17 -7
  85. data/lib/merge_accounting_client/models/company_info.rb +1 -1
  86. data/lib/merge_accounting_client/models/contact.rb +1 -1
  87. data/lib/merge_accounting_client/models/country_enum.rb +17 -7
  88. data/lib/merge_accounting_client/models/credit_note.rb +35 -2
  89. data/lib/merge_accounting_client/models/credit_note_line_item.rb +380 -0
  90. data/lib/merge_accounting_client/models/credit_note_status_enum.rb +17 -7
  91. data/lib/merge_accounting_client/models/currency_enum.rb +17 -7
  92. data/lib/merge_accounting_client/models/data_passthrough_request.rb +14 -5
  93. data/lib/merge_accounting_client/models/encoding_enum.rb +18 -7
  94. data/lib/merge_accounting_client/models/end_user_details_request.rb +28 -11
  95. data/lib/merge_accounting_client/models/expense.rb +1 -1
  96. data/lib/merge_accounting_client/models/income_statement.rb +1 -1
  97. data/lib/merge_accounting_client/models/invoice_line_item.rb +1 -13
  98. data/lib/merge_accounting_client/models/invoice_type_enum.rb +17 -7
  99. data/lib/merge_accounting_client/models/issue_status_enum.rb +17 -7
  100. data/lib/merge_accounting_client/models/item.rb +1 -1
  101. data/lib/merge_accounting_client/models/link_token.rb +13 -4
  102. data/lib/merge_accounting_client/models/method_enum.rb +17 -7
  103. data/lib/merge_accounting_client/models/paginated_transaction_list.rb +240 -0
  104. data/lib/merge_accounting_client/models/payment.rb +1 -1
  105. data/lib/merge_accounting_client/models/purchase_order.rb +35 -2
  106. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +83 -5
  107. data/lib/merge_accounting_client/models/purchase_order_status_enum.rb +17 -7
  108. data/lib/merge_accounting_client/models/remote_response.rb +13 -2
  109. data/lib/merge_accounting_client/models/request_format_enum.rb +17 -7
  110. data/lib/merge_accounting_client/models/state_enum.rb +17 -7
  111. data/lib/merge_accounting_client/models/status7d1_enum.rb +17 -7
  112. data/lib/merge_accounting_client/models/sync_status_status_enum.rb +18 -7
  113. data/lib/merge_accounting_client/models/tax_rate.rb +1 -1
  114. data/lib/merge_accounting_client/models/tracking_category.rb +1 -1
  115. data/lib/merge_accounting_client/models/transaction.rb +356 -0
  116. data/lib/merge_accounting_client/models/transaction_line_item.rb +358 -0
  117. data/lib/merge_accounting_client/models/vendor_credit.rb +1 -1
  118. data/lib/merge_accounting_client/version.rb +1 -1
  119. data/lib/merge_accounting_client.rb +5 -1
  120. data/merge_accounting_client.gemspec +1 -1
  121. data/spec/api/accounts_api_spec.rb +3 -1
  122. data/spec/api/addresses_api_spec.rb +1 -0
  123. data/spec/api/attachments_api_spec.rb +1 -1
  124. data/spec/api/balance_sheets_api_spec.rb +1 -1
  125. data/spec/api/cash_flow_statements_api_spec.rb +1 -1
  126. data/spec/api/company_info_api_spec.rb +1 -1
  127. data/spec/api/contacts_api_spec.rb +3 -1
  128. data/spec/api/credit_notes_api_spec.rb +3 -1
  129. data/spec/api/expenses_api_spec.rb +1 -1
  130. data/spec/api/income_statements_api_spec.rb +1 -1
  131. data/spec/api/invoices_api_spec.rb +3 -1
  132. data/spec/api/items_api_spec.rb +3 -1
  133. data/spec/api/journal_entries_api_spec.rb +1 -1
  134. data/spec/api/linked_accounts_api_spec.rb +1 -0
  135. data/spec/api/payments_api_spec.rb +1 -1
  136. data/spec/api/purchase_orders_api_spec.rb +3 -1
  137. data/spec/api/sync_status_api_spec.rb +1 -1
  138. data/spec/api/tax_rates_api_spec.rb +1 -1
  139. data/spec/api/tracking_categories_api_spec.rb +3 -1
  140. data/spec/api/transactions_api_spec.rb +70 -0
  141. data/spec/api/vendor_credits_api_spec.rb +1 -1
  142. data/spec/models/account_details_and_actions_spec.rb +6 -0
  143. data/spec/models/account_details_spec.rb +6 -0
  144. data/spec/models/credit_note_line_item_spec.rb +94 -0
  145. data/spec/models/credit_note_spec.rb +18 -0
  146. data/spec/models/data_passthrough_request_spec.rb +6 -0
  147. data/spec/models/end_user_details_request_spec.rb +6 -0
  148. data/spec/models/invoice_line_item_spec.rb +0 -6
  149. data/spec/models/link_token_spec.rb +6 -0
  150. data/spec/models/paginated_transaction_list_spec.rb +46 -0
  151. data/spec/models/purchase_order_line_item_spec.rb +24 -0
  152. data/spec/models/purchase_order_spec.rb +18 -0
  153. data/spec/models/remote_response_spec.rb +6 -0
  154. data/spec/models/transaction_line_item_spec.rb +82 -0
  155. data/spec/models/transaction_spec.rb +100 -0
  156. metadata +132 -111
@@ -0,0 +1,380 @@
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 CreditNoteLineItem
18
+ attr_accessor :item
19
+
20
+ # The credit note line item's name.
21
+ attr_accessor :name
22
+
23
+ # The credit note line item's description.
24
+ attr_accessor :description
25
+
26
+ # The credit note line item's quantity.
27
+ attr_accessor :quantity
28
+
29
+ # The credit note line item's memo.
30
+ attr_accessor :memo
31
+
32
+ # The credit note line item's unit price.
33
+ attr_accessor :unit_price
34
+
35
+ # The credit note line item's tax rate.
36
+ attr_accessor :tax_rate
37
+
38
+ # The credit note line item's total.
39
+ attr_accessor :total_line_amount
40
+
41
+ # The purchase order line item's associated tracking category.
42
+ attr_accessor :tracking_category
43
+
44
+ # The credit note line item's account.
45
+ attr_accessor :account
46
+
47
+ # The third-party API ID of the matching object.
48
+ attr_accessor :remote_id
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'item' => :'item',
54
+ :'name' => :'name',
55
+ :'description' => :'description',
56
+ :'quantity' => :'quantity',
57
+ :'memo' => :'memo',
58
+ :'unit_price' => :'unit_price',
59
+ :'tax_rate' => :'tax_rate',
60
+ :'total_line_amount' => :'total_line_amount',
61
+ :'tracking_category' => :'tracking_category',
62
+ :'account' => :'account',
63
+ :'remote_id' => :'remote_id'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'item' => :'String',
76
+ :'name' => :'String',
77
+ :'description' => :'String',
78
+ :'quantity' => :'String',
79
+ :'memo' => :'String',
80
+ :'unit_price' => :'String',
81
+ :'tax_rate' => :'String',
82
+ :'total_line_amount' => :'String',
83
+ :'tracking_category' => :'String',
84
+ :'account' => :'String',
85
+ :'remote_id' => :'String'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ :'item',
93
+ :'name',
94
+ :'description',
95
+ :'quantity',
96
+ :'memo',
97
+ :'unit_price',
98
+ :'tax_rate',
99
+ :'total_line_amount',
100
+ :'tracking_category',
101
+ :'account',
102
+ :'remote_id'
103
+ ])
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ if (!attributes.is_a?(Hash))
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::CreditNoteLineItem` initialize method"
111
+ end
112
+
113
+ # check to see if the attribute exists and convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!self.class.attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::CreditNoteLineItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'item')
122
+ self.item = attributes[:'item']
123
+ end
124
+
125
+ if attributes.key?(:'name')
126
+ self.name = attributes[:'name']
127
+ end
128
+
129
+ if attributes.key?(:'description')
130
+ self.description = attributes[:'description']
131
+ end
132
+
133
+ if attributes.key?(:'quantity')
134
+ self.quantity = attributes[:'quantity']
135
+ end
136
+
137
+ if attributes.key?(:'memo')
138
+ self.memo = attributes[:'memo']
139
+ end
140
+
141
+ if attributes.key?(:'unit_price')
142
+ self.unit_price = attributes[:'unit_price']
143
+ end
144
+
145
+ if attributes.key?(:'tax_rate')
146
+ self.tax_rate = attributes[:'tax_rate']
147
+ end
148
+
149
+ if attributes.key?(:'total_line_amount')
150
+ self.total_line_amount = attributes[:'total_line_amount']
151
+ end
152
+
153
+ if attributes.key?(:'tracking_category')
154
+ self.tracking_category = attributes[:'tracking_category']
155
+ end
156
+
157
+ if attributes.key?(:'account')
158
+ self.account = attributes[:'account']
159
+ end
160
+
161
+ if attributes.key?(:'remote_id')
162
+ self.remote_id = attributes[:'remote_id']
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ invalid_properties = Array.new
170
+ pattern = Regexp.new(/^\d{0,24}(?:\.\d{0,8})?$/)
171
+ if !@quantity.nil? && @quantity !~ pattern
172
+ invalid_properties.push("invalid value for \"quantity\", must conform to the pattern #{pattern}.")
173
+ end
174
+
175
+ pattern = Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
176
+ if !@unit_price.nil? && @unit_price !~ pattern
177
+ invalid_properties.push("invalid value for \"unit_price\", must conform to the pattern #{pattern}.")
178
+ end
179
+
180
+ pattern = Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
181
+ if !@total_line_amount.nil? && @total_line_amount !~ pattern
182
+ invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
183
+ end
184
+
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ return false if !@quantity.nil? && @quantity !~ Regexp.new(/^\d{0,24}(?:\.\d{0,8})?$/)
192
+ return false if !@unit_price.nil? && @unit_price !~ Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
193
+ return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
194
+ true
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] quantity Value to be assigned
199
+ def quantity=(quantity)
200
+ pattern = Regexp.new(/^\d{0,24}(?:\.\d{0,8})?$/)
201
+ if !quantity.nil? && quantity !~ pattern
202
+ fail ArgumentError, "invalid value for \"quantity\", must conform to the pattern #{pattern}."
203
+ end
204
+
205
+ @quantity = quantity
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] unit_price Value to be assigned
210
+ def unit_price=(unit_price)
211
+ pattern = Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
212
+ if !unit_price.nil? && unit_price !~ pattern
213
+ fail ArgumentError, "invalid value for \"unit_price\", must conform to the pattern #{pattern}."
214
+ end
215
+
216
+ @unit_price = unit_price
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] total_line_amount Value to be assigned
221
+ def total_line_amount=(total_line_amount)
222
+ pattern = Regexp.new(/^\d{0,32}(?:\.\d{0,16})?$/)
223
+ if !total_line_amount.nil? && total_line_amount !~ pattern
224
+ fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
225
+ end
226
+
227
+ @total_line_amount = total_line_amount
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ item == o.item &&
236
+ name == o.name &&
237
+ description == o.description &&
238
+ quantity == o.quantity &&
239
+ memo == o.memo &&
240
+ unit_price == o.unit_price &&
241
+ tax_rate == o.tax_rate &&
242
+ total_line_amount == o.total_line_amount &&
243
+ tracking_category == o.tracking_category &&
244
+ account == o.account &&
245
+ remote_id == o.remote_id
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [item, name, description, quantity, memo, unit_price, tax_rate, total_line_amount, tracking_category, account, remote_id].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ new.build_from_hash(attributes)
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def build_from_hash(attributes)
271
+ return nil unless attributes.is_a?(Hash)
272
+ self.class.openapi_types.each_pair do |key, type|
273
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
274
+ self.send("#{key}=", nil)
275
+ elsif type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
279
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
280
+ end
281
+ elsif !attributes[self.class.attribute_map[key]].nil?
282
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
283
+ end
284
+ end
285
+
286
+ self
287
+ end
288
+
289
+ # Deserializes the data based on type
290
+ # @param string type Data type
291
+ # @param string value Value to be deserialized
292
+ # @return [Object] Deserialized data
293
+ def _deserialize(type, value)
294
+ case type.to_sym
295
+ when :Time
296
+ Time.parse(value)
297
+ when :Date
298
+ Date.parse(value)
299
+ when :String
300
+ value
301
+ when :Integer
302
+ value.to_i
303
+ when :Float
304
+ value.to_f
305
+ when :Boolean
306
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
307
+ true
308
+ else
309
+ false
310
+ end
311
+ when :Object
312
+ # generic object (usually a Hash), return directly
313
+ value
314
+ when /\AArray<(?<inner_type>.+)>\z/
315
+ inner_type = Regexp.last_match[:inner_type]
316
+ value.map { |v| _deserialize(inner_type, v) }
317
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
318
+ k_type = Regexp.last_match[:k_type]
319
+ v_type = Regexp.last_match[:v_type]
320
+ {}.tap do |hash|
321
+ value.each do |k, v|
322
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
323
+ end
324
+ end
325
+ else # model
326
+ # models (e.g. Pet) or oneOf
327
+ klass = MergeAccountingClient.const_get(type)
328
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
329
+ end
330
+ end
331
+
332
+ # Returns the string representation of the object
333
+ # @return [String] String presentation of the object
334
+ def to_s
335
+ to_hash.to_s
336
+ end
337
+
338
+ # to_body is an alias to to_hash (backward compatibility)
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_body
341
+ to_hash
342
+ end
343
+
344
+ # Returns the object in the form of hash
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_hash
347
+ hash = {}
348
+ self.class.attribute_map.each_pair do |attr, param|
349
+ value = self.send(attr)
350
+ if value.nil?
351
+ is_nullable = self.class.openapi_nullable.include?(attr)
352
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
353
+ end
354
+
355
+ hash[param] = _to_hash(value)
356
+ end
357
+ hash
358
+ end
359
+
360
+ # Outputs non-array value in the form of hash
361
+ # For object, use to_hash. Otherwise, just return the value
362
+ # @param [Object] value Any valid value
363
+ # @return [Hash] Returns the value in the form of hash
364
+ def _to_hash(value)
365
+ if value.is_a?(Array)
366
+ value.compact.map { |v| _to_hash(v) }
367
+ elsif value.is_a?(Hash)
368
+ {}.tap do |hash|
369
+ value.each { |k, v| hash[k] = _to_hash(v) }
370
+ end
371
+ elsif value.respond_to? :to_hash
372
+ value.to_hash
373
+ else
374
+ value
375
+ end
376
+ end
377
+
378
+ end
379
+
380
+ end
@@ -19,18 +19,28 @@ module MergeAccountingClient
19
19
  AUTHORIZED = "AUTHORIZED".freeze
20
20
  PAID = "PAID".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 ["SUBMITTED", "AUTHORIZED", "PAID", ].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
@@ -322,18 +322,28 @@ module MergeAccountingClient
322
322
  ZWR = "ZWR".freeze
323
323
  ZWL = "ZWL".freeze
324
324
 
325
- # Builds the enum from string
326
- # @param [String] The enum value in the form of the string
327
- # @return [String] The enum value
328
- def self.build_from_hash(value)
329
- new.build_from_hash(value)
330
- end
325
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
326
+
327
+ attr_accessor :value
328
+ attr_accessor :raw_value
331
329
 
332
330
  # Builds the enum from string
333
331
  # @param [String] The enum value in the form of the string
334
332
  # @return [String] The enum value
335
333
  def build_from_hash(value)
336
- value
334
+ @raw_value = value
335
+ if ["XUA", "AFN", "AFA", "ALL", "ALK", "DZD", "ADP", "AOA", "AOK", "AON", "AOR", "ARA", "ARS", "ARM", "ARP", "ARL", "AMD", "AWG", "AUD", "ATS", "AZN", "AZM", "BSD", "BHD", "BDT", "BBD", "BYN", "BYB", "BYR", "BEF", "BEC", "BEL", "BZD", "BMD", "BTN", "BOB", "BOL", "BOV", "BOP", "BAM", "BAD", "BAN", "BWP", "BRC", "BRZ", "BRE", "BRR", "BRN", "BRB", "BRL", "GBP", "BND", "BGL", "BGN", "BGO", "BGM", "BUK", "BIF", "XPF", "KHR", "CAD", "CVE", "KYD", "XAF", "CLE", "CLP", "CLF", "CNX", "CNY", "CNH", "COP", "COU", "KMF", "CDF", "CRC", "HRD", "HRK", "CUC", "CUP", "CYP", "CZK", "CSK", "DKK", "DJF", "DOP", "NLG", "XCD", "DDM", "ECS", "ECV", "EGP", "GQE", "ERN", "EEK", "ETB", "EUR", "XBA", "XEU", "XBB", "XBC", "XBD", "FKP", "FJD", "FIM", "FRF", "XFO", "XFU", "GMD", "GEK", "GEL", "DEM", "GHS", "GHC", "GIP", "XAU", "GRD", "GTQ", "GWP", "GNF", "GNS", "GYD", "HTG", "HNL", "HKD", "HUF", "IMP", "ISK", "ISJ", "INR", "IDR", "IRR", "IQD", "IEP", "ILS", "ILP", "ILR", "ITL", "JMD", "JPY", "JOD", "KZT", "KES", "KWD", "KGS", "LAK", "LVL", "LVR", "LBP", "LSL", "LRD", "LYD", "LTL", "LTT", "LUL", "LUC", "LUF", "MOP", "MKD", "MKN", "MGA", "MGF", "MWK", "MYR", "MVR", "MVP", "MLF", "MTL", "MTP", "MRU", "MRO", "MUR", "MXV", "MXN", "MXP", "MDC", "MDL", "MCF", "MNT", "MAD", "MAF", "MZE", "MZN", "MZM", "MMK", "NAD", "NPR", "ANG", "TWD", "NZD", "NIO", "NIC", "NGN", "KPW", "NOK", "OMR", "PKR", "XPD", "PAB", "PGK", "PYG", "PEI", "PEN", "PES", "PHP", "XPT", "PLN", "PLZ", "PTE", "GWE", "QAR", "XRE", "RHD", "RON", "ROL", "RUB", "RUR", "RWF", "SVC", "WST", "SAR", "RSD", "CSD", "SCR", "SLL", "XAG", "SGD", "SKK", "SIT", "SBD", "SOS", "ZAR", "ZAL", "KRH", "KRW", "KRO", "SSP", "SUR", "ESP", "ESA", "ESB", "XDR", "LKR", "SHP", "XSU", "SDD", "SDG", "SDP", "SRD", "SRG", "SZL", "SEK", "CHF", "SYP", "STN", "STD", "TVD", "TJR", "TJS", "TZS", "XTS", "THB", "XXX", "TPE", "TOP", "TTD", "TND", "TRY", "TRL", "TMT", "TMM", "USD", "USN", "USS", "UGX", "UGS", "UAH", "UAK", "AED", "UYW", "UYU", "UYP", "UYI", "UZS", "VUV", "VES", "VEB", "VEF", "VND", "VNN", "CHE", "CHW", "XOF", "YDD", "YER", "YUN", "YUD", "YUM", "YUR", "ZWN", "ZRN", "ZRZ", "ZMW", "ZMK", "ZWD", "ZWR", "ZWL", ].include? value
336
+ @value = value
337
+ else
338
+ @value = MERGE_NONSTANDARD_VALUE
339
+ end
340
+
341
+ self
342
+ end
343
+
344
+ def self.build_from_hash(value)
345
+ IssueStatusEnum.new.build_from_hash(value)
337
346
  end
338
347
  end
348
+
339
349
  end
@@ -32,6 +32,8 @@ module MergeAccountingClient
32
32
 
33
33
  attr_accessor :request_format
34
34
 
35
+ attr_accessor :normalize_response
36
+
35
37
  # Attribute mapping from ruby-style variable name to JSON key.
36
38
  def self.attribute_map
37
39
  {
@@ -41,7 +43,8 @@ module MergeAccountingClient
41
43
  :'data' => :'data',
42
44
  :'multipart_form_data' => :'multipart_form_data',
43
45
  :'headers' => :'headers',
44
- :'request_format' => :'request_format'
46
+ :'request_format' => :'request_format',
47
+ :'normalize_response' => :'normalize_response'
45
48
  }
46
49
  end
47
50
 
@@ -59,7 +62,8 @@ module MergeAccountingClient
59
62
  :'data' => :'String',
60
63
  :'multipart_form_data' => :'Array<MultipartFormFieldRequest>',
61
64
  :'headers' => :'Hash<String, AnyType>',
62
- :'request_format' => :'RequestFormatEnum'
65
+ :'request_format' => :'RequestFormatEnum',
66
+ :'normalize_response' => :'Boolean'
63
67
  }
64
68
  end
65
69
 
@@ -70,7 +74,7 @@ module MergeAccountingClient
70
74
  :'data',
71
75
  :'multipart_form_data',
72
76
  :'headers',
73
- :'request_format'
77
+ :'request_format',
74
78
  ])
75
79
  end
76
80
 
@@ -120,6 +124,10 @@ module MergeAccountingClient
120
124
  if attributes.key?(:'request_format')
121
125
  self.request_format = attributes[:'request_format']
122
126
  end
127
+
128
+ if attributes.key?(:'normalize_response')
129
+ self.normalize_response = attributes[:'normalize_response']
130
+ end
123
131
  end
124
132
 
125
133
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -205,7 +213,8 @@ module MergeAccountingClient
205
213
  data == o.data &&
206
214
  multipart_form_data == o.multipart_form_data &&
207
215
  headers == o.headers &&
208
- request_format == o.request_format
216
+ request_format == o.request_format &&
217
+ normalize_response == o.normalize_response
209
218
  end
210
219
 
211
220
  # @see the `==` method
@@ -217,7 +226,7 @@ module MergeAccountingClient
217
226
  # Calculates hash code according to all attributes.
218
227
  # @return [Integer] Hash code
219
228
  def hash
220
- [method, path, base_url_override, data, multipart_form_data, headers, request_format].hash
229
+ [method, path, base_url_override, data, multipart_form_data, headers, request_format, normalize_response].hash
221
230
  end
222
231
 
223
232
  # Builds the object from hash
@@ -17,19 +17,30 @@ module MergeAccountingClient
17
17
  class EncodingEnum
18
18
  RAW = "RAW".freeze
19
19
  BASE64 = "BASE64".freeze
20
+ GZIP_BASE64 = "GZIP_BASE64".freeze
20
21
 
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
22
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
23
+
24
+ attr_accessor :value
25
+ attr_accessor :raw_value
27
26
 
28
27
  # Builds the enum from string
29
28
  # @param [String] The enum value in the form of the string
30
29
  # @return [String] The enum value
31
30
  def build_from_hash(value)
32
- value
31
+ @raw_value = value
32
+ if ["RAW", "BASE64", "GZIP_BASE64", ].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)
33
43
  end
34
44
  end
45
+
35
46
  end
@@ -15,20 +15,27 @@ require 'time'
15
15
 
16
16
  module MergeAccountingClient
17
17
  class EndUserDetailsRequest
18
+ # Your end user's email address.
18
19
  attr_accessor :end_user_email_address
19
20
 
21
+ # Your end user's organization.
20
22
  attr_accessor :end_user_organization_name
21
23
 
24
+ # Unique ID for your end user.
22
25
  attr_accessor :end_user_origin_id
23
26
 
27
+ # The integration categories to show in Merge Link.
24
28
  attr_accessor :categories
25
29
 
26
- # The slug of a specific pre-selected integration for this linking flow token, for examples of slugs see https://www.merge.dev/docs/basics/integration-metadata
30
+ # The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://www.merge.dev/docs/basics/integration-metadata/.
27
31
  attr_accessor :integration
28
32
 
29
- # An integer number of minutes between [30, 720] for how long this token is valid. Defaults to 30
33
+ # An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.
30
34
  attr_accessor :link_expiry_mins
31
35
 
36
+ # Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/product/integrations,-fast.-say-hello-to-magic-link/.
37
+ attr_accessor :should_create_magic_link_url
38
+
32
39
  # Attribute mapping from ruby-style variable name to JSON key.
33
40
  def self.attribute_map
34
41
  {
@@ -37,7 +44,8 @@ module MergeAccountingClient
37
44
  :'end_user_origin_id' => :'end_user_origin_id',
38
45
  :'categories' => :'categories',
39
46
  :'integration' => :'integration',
40
- :'link_expiry_mins' => :'link_expiry_mins'
47
+ :'link_expiry_mins' => :'link_expiry_mins',
48
+ :'should_create_magic_link_url' => :'should_create_magic_link_url'
41
49
  }
42
50
  end
43
51
 
@@ -54,7 +62,8 @@ module MergeAccountingClient
54
62
  :'end_user_origin_id' => :'String',
55
63
  :'categories' => :'Array<CategoriesEnum>',
56
64
  :'integration' => :'String',
57
- :'link_expiry_mins' => :'Integer'
65
+ :'link_expiry_mins' => :'Integer',
66
+ :'should_create_magic_link_url' => :'Boolean'
58
67
  }
59
68
  end
60
69
 
@@ -62,6 +71,7 @@ module MergeAccountingClient
62
71
  def self.openapi_nullable
63
72
  Set.new([
64
73
  :'integration',
74
+ :'should_create_magic_link_url'
65
75
  ])
66
76
  end
67
77
 
@@ -107,6 +117,12 @@ module MergeAccountingClient
107
117
  else
108
118
  self.link_expiry_mins = 30
109
119
  end
120
+
121
+ if attributes.key?(:'should_create_magic_link_url')
122
+ self.should_create_magic_link_url = attributes[:'should_create_magic_link_url']
123
+ else
124
+ self.should_create_magic_link_url = false
125
+ end
110
126
  end
111
127
 
112
128
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -157,8 +173,8 @@ module MergeAccountingClient
157
173
  invalid_properties.push('invalid value for "integration", the character length must be great than or equal to 1.')
158
174
  end
159
175
 
160
- if !@link_expiry_mins.nil? && @link_expiry_mins > 720
161
- invalid_properties.push('invalid value for "link_expiry_mins", must be smaller than or equal to 720.')
176
+ if !@link_expiry_mins.nil? && @link_expiry_mins > 10080
177
+ invalid_properties.push('invalid value for "link_expiry_mins", must be smaller than or equal to 10080.')
162
178
  end
163
179
 
164
180
  if !@link_expiry_mins.nil? && @link_expiry_mins < 30
@@ -182,7 +198,7 @@ module MergeAccountingClient
182
198
  return false if @end_user_origin_id.to_s.length < 1
183
199
  return false if @categories.nil?
184
200
  return false if !@integration.nil? && @integration.to_s.length < 1
185
- return false if !@link_expiry_mins.nil? && @link_expiry_mins > 720
201
+ return false if !@link_expiry_mins.nil? && @link_expiry_mins > 10080
186
202
  return false if !@link_expiry_mins.nil? && @link_expiry_mins < 30
187
203
  true
188
204
  end
@@ -254,8 +270,8 @@ module MergeAccountingClient
254
270
  # Custom attribute writer method with validation
255
271
  # @param [Object] link_expiry_mins Value to be assigned
256
272
  def link_expiry_mins=(link_expiry_mins)
257
- if !link_expiry_mins.nil? && link_expiry_mins > 720
258
- fail ArgumentError, 'invalid value for "link_expiry_mins", must be smaller than or equal to 720.'
273
+ if !link_expiry_mins.nil? && link_expiry_mins > 10080
274
+ fail ArgumentError, 'invalid value for "link_expiry_mins", must be smaller than or equal to 10080.'
259
275
  end
260
276
 
261
277
  if !link_expiry_mins.nil? && link_expiry_mins < 30
@@ -275,7 +291,8 @@ module MergeAccountingClient
275
291
  end_user_origin_id == o.end_user_origin_id &&
276
292
  categories == o.categories &&
277
293
  integration == o.integration &&
278
- link_expiry_mins == o.link_expiry_mins
294
+ link_expiry_mins == o.link_expiry_mins &&
295
+ should_create_magic_link_url == o.should_create_magic_link_url
279
296
  end
280
297
 
281
298
  # @see the `==` method
@@ -287,7 +304,7 @@ module MergeAccountingClient
287
304
  # Calculates hash code according to all attributes.
288
305
  # @return [Integer] Hash code
289
306
  def hash
290
- [end_user_email_address, end_user_organization_name, end_user_origin_id, categories, integration, link_expiry_mins].hash
307
+ [end_user_email_address, end_user_organization_name, end_user_origin_id, categories, integration, link_expiry_mins, should_create_magic_link_url].hash
291
308
  end
292
309
 
293
310
  # Builds the object from hash