merge_accounting_client 1.0.8 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +238 -224
  3. data/docs/Account.md +5 -1
  4. data/docs/AccountIntegration.md +8 -2
  5. data/docs/AccountingAttachment.md +5 -1
  6. data/docs/AccountingPeriod.md +30 -0
  7. data/docs/AccountingPeriodStatusEnum.md +15 -0
  8. data/docs/AccountingPeriodsApi.md +167 -0
  9. data/docs/AccountingPhoneNumber.md +5 -1
  10. data/docs/AccountsApi.md +4 -4
  11. data/docs/Address.md +6 -2
  12. data/docs/AddressRequest.md +34 -0
  13. data/docs/AsyncPassthroughApi.md +155 -0
  14. data/docs/AsyncPassthroughReciept.md +18 -0
  15. data/docs/AttachmentsApi.md +4 -4
  16. data/docs/AuditLogEvent.md +32 -0
  17. data/docs/AuditTrailApi.md +91 -0
  18. data/docs/BalanceSheet.md +5 -1
  19. data/docs/BalanceSheetsApi.md +4 -4
  20. data/docs/CashFlowStatement.md +5 -1
  21. data/docs/CashFlowStatementsApi.md +4 -4
  22. data/docs/CompanyInfo.md +6 -2
  23. data/docs/CompanyInfoApi.md +4 -4
  24. data/docs/Contact.md +6 -2
  25. data/docs/ContactRequest.md +1 -1
  26. data/docs/ContactsApi.md +8 -4
  27. data/docs/CreditNote.md +14 -2
  28. data/docs/CreditNoteLineItem.md +9 -1
  29. data/docs/CreditNotesApi.md +6 -6
  30. data/docs/DeleteAccountApi.md +9 -9
  31. data/docs/EndUserDetailsRequest.md +2 -2
  32. data/docs/EventTypeEnum.md +15 -0
  33. data/docs/Expense.md +14 -2
  34. data/docs/ExpenseLine.md +11 -1
  35. data/docs/ExpenseLineRequest.md +2 -0
  36. data/docs/ExpenseRequest.md +9 -1
  37. data/docs/ExpensesApi.md +4 -4
  38. data/docs/ForceResyncApi.md +1 -1
  39. data/docs/IncomeStatement.md +5 -1
  40. data/docs/IncomeStatementsApi.md +4 -4
  41. data/docs/Invoice.md +18 -4
  42. data/docs/InvoiceLineItem.md +7 -1
  43. data/docs/InvoiceRequest.md +7 -1
  44. data/docs/InvoiceStatusEnum.md +15 -0
  45. data/docs/InvoicesApi.md +6 -6
  46. data/docs/Issue.md +2 -2
  47. data/docs/IssuesApi.md +6 -6
  48. data/docs/Item.md +5 -1
  49. data/docs/ItemsApi.md +4 -4
  50. data/docs/JournalEntriesApi.md +6 -6
  51. data/docs/JournalEntry.md +13 -1
  52. data/docs/JournalEntryRequest.md +4 -0
  53. data/docs/JournalLine.md +13 -1
  54. data/docs/JournalLineRequest.md +4 -0
  55. data/docs/LinkedAccountsApi.md +2 -2
  56. data/docs/MetaResponse.md +2 -2
  57. data/docs/PaginatedAccountingPeriodList.md +22 -0
  58. data/docs/PaginatedAuditLogEventList.md +22 -0
  59. data/docs/Payment.md +11 -1
  60. data/docs/PaymentLineItem.md +32 -0
  61. data/docs/PaymentLineItemRequest.md +30 -0
  62. data/docs/PaymentRequest.md +6 -0
  63. data/docs/PaymentsApi.md +4 -4
  64. data/docs/PurchaseOrder.md +13 -3
  65. data/docs/PurchaseOrderLineItem.md +9 -1
  66. data/docs/PurchaseOrderRequest.md +2 -0
  67. data/docs/PurchaseOrdersApi.md +6 -6
  68. data/docs/RemoteData.md +1 -1
  69. data/docs/ReportItem.md +5 -1
  70. data/docs/RoleEnum.md +15 -0
  71. data/docs/SyncStatus.md +1 -1
  72. data/docs/SyncStatusApi.md +15 -11
  73. data/docs/TaxRate.md +5 -1
  74. data/docs/TaxRatesApi.md +4 -4
  75. data/docs/TrackingCategoriesApi.md +4 -4
  76. data/docs/TrackingCategory.md +5 -1
  77. data/docs/Transaction.md +9 -3
  78. data/docs/TransactionLineItem.md +9 -1
  79. data/docs/TransactionsApi.md +4 -4
  80. data/docs/VendorCredit.md +10 -2
  81. data/docs/VendorCreditLine.md +9 -1
  82. data/docs/VendorCreditsApi.md +6 -6
  83. data/git_push.sh +58 -0
  84. data/lib/merge_accounting_client/api/accounting_periods_api.rb +167 -0
  85. data/lib/merge_accounting_client/api/accounts_api.rb +4 -4
  86. data/lib/merge_accounting_client/api/async_passthrough_api.rb +160 -0
  87. data/lib/merge_accounting_client/api/attachments_api.rb +4 -4
  88. data/lib/merge_accounting_client/api/audit_trail_api.rb +95 -0
  89. data/lib/merge_accounting_client/api/balance_sheets_api.rb +4 -4
  90. data/lib/merge_accounting_client/api/cash_flow_statements_api.rb +4 -4
  91. data/lib/merge_accounting_client/api/company_info_api.rb +4 -4
  92. data/lib/merge_accounting_client/api/contacts_api.rb +10 -4
  93. data/lib/merge_accounting_client/api/credit_notes_api.rb +6 -6
  94. data/lib/merge_accounting_client/api/delete_account_api.rb +7 -7
  95. data/lib/merge_accounting_client/api/expenses_api.rb +6 -6
  96. data/lib/merge_accounting_client/api/force_resync_api.rb +2 -2
  97. data/lib/merge_accounting_client/api/income_statements_api.rb +4 -4
  98. data/lib/merge_accounting_client/api/invoices_api.rb +6 -6
  99. data/lib/merge_accounting_client/api/issues_api.rb +6 -6
  100. data/lib/merge_accounting_client/api/items_api.rb +4 -4
  101. data/lib/merge_accounting_client/api/journal_entries_api.rb +6 -6
  102. data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -3
  103. data/lib/merge_accounting_client/api/payments_api.rb +6 -6
  104. data/lib/merge_accounting_client/api/purchase_orders_api.rb +6 -6
  105. data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
  106. data/lib/merge_accounting_client/api/tax_rates_api.rb +4 -4
  107. data/lib/merge_accounting_client/api/tracking_categories_api.rb +4 -4
  108. data/lib/merge_accounting_client/api/transactions_api.rb +6 -6
  109. data/lib/merge_accounting_client/api/vendor_credits_api.rb +6 -6
  110. data/lib/merge_accounting_client/configuration.rb +4 -0
  111. data/lib/merge_accounting_client/models/account.rb +22 -3
  112. data/lib/merge_accounting_client/models/account_integration.rb +37 -4
  113. data/lib/merge_accounting_client/models/account_request.rb +1 -1
  114. data/lib/merge_accounting_client/models/accounting_attachment.rb +21 -2
  115. data/lib/merge_accounting_client/models/accounting_period.rb +296 -0
  116. data/lib/merge_accounting_client/models/accounting_period_status_enum.rb +45 -0
  117. data/lib/merge_accounting_client/models/accounting_phone_number.rb +24 -5
  118. data/lib/merge_accounting_client/models/address.rb +24 -5
  119. data/lib/merge_accounting_client/models/address_request.rb +311 -0
  120. data/lib/merge_accounting_client/models/async_passthrough_reciept.rb +223 -0
  121. data/lib/merge_accounting_client/models/audit_log_event.rb +356 -0
  122. data/lib/merge_accounting_client/models/balance_sheet.rb +21 -2
  123. data/lib/merge_accounting_client/models/cash_flow_statement.rb +21 -2
  124. data/lib/merge_accounting_client/models/company_info.rb +22 -3
  125. data/lib/merge_accounting_client/models/contact.rb +23 -4
  126. data/lib/merge_accounting_client/models/contact_request.rb +2 -2
  127. data/lib/merge_accounting_client/models/credit_note.rb +84 -3
  128. data/lib/merge_accounting_client/models/credit_note_line_item.rb +43 -5
  129. data/lib/merge_accounting_client/models/end_user_details_request.rb +2 -2
  130. data/lib/merge_accounting_client/models/event_type_enum.rb +67 -0
  131. data/lib/merge_accounting_client/models/expense.rb +66 -3
  132. data/lib/merge_accounting_client/models/expense_line.rb +54 -5
  133. data/lib/merge_accounting_client/models/expense_line_request.rb +12 -1
  134. data/lib/merge_accounting_client/models/expense_request.rb +46 -2
  135. data/lib/merge_accounting_client/models/income_statement.rb +21 -2
  136. data/lib/merge_accounting_client/models/invoice.rb +84 -9
  137. data/lib/merge_accounting_client/models/invoice_line_item.rb +31 -2
  138. data/lib/merge_accounting_client/models/invoice_line_item_request.rb +1 -1
  139. data/lib/merge_accounting_client/models/invoice_request.rb +35 -2
  140. data/lib/merge_accounting_client/models/invoice_status_enum.rb +49 -0
  141. data/lib/merge_accounting_client/models/issue.rb +1 -0
  142. data/lib/merge_accounting_client/models/item.rb +21 -2
  143. data/lib/merge_accounting_client/models/journal_entry.rb +81 -2
  144. data/lib/merge_accounting_client/models/journal_entry_request.rb +38 -1
  145. data/lib/merge_accounting_client/models/journal_line.rb +65 -5
  146. data/lib/merge_accounting_client/models/journal_line_request.rb +23 -1
  147. data/lib/merge_accounting_client/models/paginated_accounting_period_list.rb +240 -0
  148. data/lib/merge_accounting_client/models/paginated_audit_log_event_list.rb +240 -0
  149. data/lib/merge_accounting_client/models/payment.rb +55 -2
  150. data/lib/merge_accounting_client/models/payment_line_item.rb +308 -0
  151. data/lib/merge_accounting_client/models/payment_line_item_request.rb +319 -0
  152. data/lib/merge_accounting_client/models/payment_request.rb +35 -1
  153. data/lib/merge_accounting_client/models/purchase_order.rb +70 -3
  154. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +43 -5
  155. data/lib/merge_accounting_client/models/purchase_order_request.rb +12 -1
  156. data/lib/merge_accounting_client/models/remote_data.rb +3 -4
  157. data/lib/merge_accounting_client/models/report_item.rb +24 -5
  158. data/lib/merge_accounting_client/models/role_enum.rb +49 -0
  159. data/lib/merge_accounting_client/models/sync_status_status_enum.rb +1 -1
  160. data/lib/merge_accounting_client/models/tax_rate.rb +21 -2
  161. data/lib/merge_accounting_client/models/tracking_category.rb +22 -3
  162. data/lib/merge_accounting_client/models/transaction.rb +33 -3
  163. data/lib/merge_accounting_client/models/transaction_line_item.rb +43 -5
  164. data/lib/merge_accounting_client/models/vendor_credit.rb +44 -3
  165. data/lib/merge_accounting_client/models/vendor_credit_line.rb +43 -5
  166. data/lib/merge_accounting_client/version.rb +1 -1
  167. data/lib/merge_accounting_client.rb +15 -7
  168. data/spec/api/accounting_periods_api_spec.rb +63 -0
  169. data/spec/api/accounts_api_spec.rb +2 -2
  170. data/spec/api/async_passthrough_api_spec.rb +59 -0
  171. data/spec/api/attachments_api_spec.rb +2 -2
  172. data/spec/api/audit_trail_api_spec.rb +51 -0
  173. data/spec/api/balance_sheets_api_spec.rb +2 -2
  174. data/spec/api/cash_flow_statements_api_spec.rb +2 -2
  175. data/spec/api/company_info_api_spec.rb +2 -2
  176. data/spec/api/contacts_api_spec.rb +4 -2
  177. data/spec/api/credit_notes_api_spec.rb +2 -2
  178. data/spec/api/delete_account_api_spec.rb +2 -2
  179. data/spec/api/expenses_api_spec.rb +2 -2
  180. data/spec/api/force_resync_api_spec.rb +1 -1
  181. data/spec/api/income_statements_api_spec.rb +2 -2
  182. data/spec/api/invoices_api_spec.rb +2 -2
  183. data/spec/api/issues_api_spec.rb +3 -3
  184. data/spec/api/items_api_spec.rb +2 -2
  185. data/spec/api/journal_entries_api_spec.rb +2 -2
  186. data/spec/api/linked_accounts_api_spec.rb +1 -1
  187. data/spec/api/payments_api_spec.rb +2 -2
  188. data/spec/api/purchase_orders_api_spec.rb +2 -2
  189. data/spec/api/sync_status_api_spec.rb +1 -1
  190. data/spec/api/tax_rates_api_spec.rb +2 -2
  191. data/spec/api/tracking_categories_api_spec.rb +2 -2
  192. data/spec/api/transactions_api_spec.rb +2 -2
  193. data/spec/api/vendor_credits_api_spec.rb +2 -2
  194. data/spec/models/account_integration_spec.rb +18 -0
  195. data/spec/models/account_spec.rb +12 -0
  196. data/spec/models/accounting_attachment_spec.rb +12 -0
  197. data/spec/models/accounting_period_spec.rb +70 -0
  198. data/spec/models/accounting_period_status_enum_spec.rb +28 -0
  199. data/spec/models/accounting_phone_number_spec.rb +12 -0
  200. data/spec/models/address_request_spec.rb +82 -0
  201. data/spec/models/address_spec.rb +12 -0
  202. data/spec/models/async_passthrough_reciept_spec.rb +34 -0
  203. data/spec/models/audit_log_event_spec.rb +76 -0
  204. data/spec/models/balance_sheet_spec.rb +12 -0
  205. data/spec/models/cash_flow_statement_spec.rb +12 -0
  206. data/spec/models/company_info_spec.rb +12 -0
  207. data/spec/models/contact_spec.rb +12 -0
  208. data/spec/models/credit_note_line_item_spec.rb +24 -0
  209. data/spec/models/credit_note_spec.rb +36 -0
  210. data/spec/models/event_type_enum_spec.rb +28 -0
  211. data/spec/models/expense_line_request_spec.rb +6 -0
  212. data/spec/models/expense_line_spec.rb +30 -0
  213. data/spec/models/expense_request_spec.rb +24 -0
  214. data/spec/models/expense_spec.rb +36 -0
  215. data/spec/models/income_statement_spec.rb +12 -0
  216. data/spec/models/invoice_line_item_spec.rb +18 -0
  217. data/spec/models/invoice_request_spec.rb +18 -0
  218. data/spec/models/invoice_spec.rb +43 -1
  219. data/spec/models/invoice_status_enum_spec.rb +28 -0
  220. data/spec/models/item_spec.rb +12 -0
  221. data/spec/models/journal_entry_request_spec.rb +12 -0
  222. data/spec/models/journal_entry_spec.rb +36 -0
  223. data/spec/models/journal_line_request_spec.rb +12 -0
  224. data/spec/models/journal_line_spec.rb +36 -0
  225. data/spec/models/paginated_accounting_period_list_spec.rb +46 -0
  226. data/spec/models/paginated_audit_log_event_list_spec.rb +46 -0
  227. data/spec/models/payment_line_item_request_spec.rb +70 -0
  228. data/spec/models/payment_line_item_spec.rb +76 -0
  229. data/spec/models/payment_request_spec.rb +18 -0
  230. data/spec/models/payment_spec.rb +30 -0
  231. data/spec/models/purchase_order_line_item_spec.rb +24 -0
  232. data/spec/models/purchase_order_request_spec.rb +6 -0
  233. data/spec/models/purchase_order_spec.rb +30 -0
  234. data/spec/models/report_item_spec.rb +12 -0
  235. data/spec/models/role_enum_spec.rb +28 -0
  236. data/spec/models/tax_rate_spec.rb +12 -0
  237. data/spec/models/tracking_category_spec.rb +12 -0
  238. data/spec/models/transaction_line_item_spec.rb +24 -0
  239. data/spec/models/transaction_spec.rb +18 -0
  240. data/spec/models/vendor_credit_line_spec.rb +24 -0
  241. data/spec/models/vendor_credit_spec.rb +24 -0
  242. metadata +211 -150
@@ -0,0 +1,296 @@
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
+ # # The AccountingPeriod Object ### Description The `AccountingPeriod` object is used to define a period of time in which events occurred. ### Usage Example Common models like `Invoice` and `Transaction` will have `AccountingPeriod` objects which will denote when they occurred.
18
+ class AccountingPeriod
19
+ # Beginning date of the period
20
+ attr_accessor :start_date
21
+
22
+ # End date of the period
23
+ attr_accessor :end_date
24
+
25
+ attr_accessor :status
26
+
27
+ # Name of the accounting period.
28
+ attr_accessor :name
29
+
30
+ attr_accessor :id
31
+
32
+ attr_accessor :created_at
33
+
34
+ # This is the datetime that this object was last updated by Merge
35
+ attr_accessor :modified_at
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'start_date' => :'start_date',
41
+ :'end_date' => :'end_date',
42
+ :'status' => :'status',
43
+ :'name' => :'name',
44
+ :'id' => :'id',
45
+ :'created_at' => :'created_at',
46
+ :'modified_at' => :'modified_at'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'start_date' => :'Time',
59
+ :'end_date' => :'Time',
60
+ :'status' => :'AccountingPeriodStatusEnum',
61
+ :'name' => :'String',
62
+ :'id' => :'String',
63
+ :'created_at' => :'Time',
64
+ :'modified_at' => :'Time'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'start_date',
72
+ :'end_date',
73
+ :'status',
74
+ :'name',
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::AccountingPeriod` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::AccountingPeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'start_date')
94
+ self.start_date = attributes[:'start_date']
95
+ end
96
+
97
+ if attributes.key?(:'end_date')
98
+ self.end_date = attributes[:'end_date']
99
+ end
100
+
101
+ if attributes.key?(:'status')
102
+ self.status = attributes[:'status']
103
+ end
104
+
105
+ if attributes.key?(:'name')
106
+ self.name = attributes[:'name']
107
+ end
108
+
109
+ if attributes.key?(:'id')
110
+ self.id = attributes[:'id']
111
+ end
112
+
113
+ if attributes.key?(:'created_at')
114
+ self.created_at = attributes[:'created_at']
115
+ end
116
+
117
+ if attributes.key?(:'modified_at')
118
+ self.modified_at = attributes[:'modified_at']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ if !@name.nil? && @name.to_s.length > 100
127
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ return false if !@name.nil? && @name.to_s.length > 100
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] name Value to be assigned
142
+ def name=(name)
143
+ if !name.nil? && name.to_s.length > 100
144
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
145
+ end
146
+
147
+ @name = name
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ start_date == o.start_date &&
156
+ end_date == o.end_date &&
157
+ status == o.status &&
158
+ name == o.name &&
159
+ id == o.id &&
160
+ created_at == o.created_at &&
161
+ modified_at == o.modified_at
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [start_date, end_date, status, name, id, created_at, modified_at].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ new.build_from_hash(attributes)
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.openapi_types.each_pair do |key, type|
189
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
190
+ self.send("#{key}=", nil)
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ end
200
+ end
201
+
202
+ self
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def _deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = MergeAccountingClient.const_get(type)
244
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end
@@ -0,0 +1,45 @@
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 AccountingPeriodStatusEnum
18
+ ACTIVE = "ACTIVE".freeze
19
+ INACTIVE = "INACTIVE".freeze
20
+
21
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
22
+
23
+ attr_accessor :value
24
+ attr_accessor :raw_value
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 build_from_hash(value)
30
+ @raw_value = value
31
+ if ["ACTIVE", "INACTIVE", ].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
+ AccountingPeriodStatusEnum.new.build_from_hash(value)
42
+ end
43
+ end
44
+
45
+ end
@@ -22,11 +22,18 @@ module MergeAccountingClient
22
22
  # The phone number's type.
23
23
  attr_accessor :type
24
24
 
25
+ attr_accessor :created_at
26
+
27
+ # This is the datetime that this object was last updated by Merge
28
+ attr_accessor :modified_at
29
+
25
30
  # Attribute mapping from ruby-style variable name to JSON key.
26
31
  def self.attribute_map
27
32
  {
28
33
  :'number' => :'number',
29
- :'type' => :'type'
34
+ :'type' => :'type',
35
+ :'created_at' => :'created_at',
36
+ :'modified_at' => :'modified_at'
30
37
  }
31
38
  end
32
39
 
@@ -39,7 +46,9 @@ module MergeAccountingClient
39
46
  def self.openapi_types
40
47
  {
41
48
  :'number' => :'String',
42
- :'type' => :'String'
49
+ :'type' => :'String',
50
+ :'created_at' => :'Time',
51
+ :'modified_at' => :'Time'
43
52
  }
44
53
  end
45
54
 
@@ -47,7 +56,7 @@ module MergeAccountingClient
47
56
  def self.openapi_nullable
48
57
  Set.new([
49
58
  :'number',
50
- :'type'
59
+ :'type',
51
60
  ])
52
61
  end
53
62
 
@@ -73,6 +82,14 @@ module MergeAccountingClient
73
82
  if attributes.key?(:'type')
74
83
  self.type = attributes[:'type']
75
84
  end
85
+
86
+ if attributes.key?(:'created_at')
87
+ self.created_at = attributes[:'created_at']
88
+ end
89
+
90
+ if attributes.key?(:'modified_at')
91
+ self.modified_at = attributes[:'modified_at']
92
+ end
76
93
  end
77
94
 
78
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -94,7 +111,9 @@ module MergeAccountingClient
94
111
  return true if self.equal?(o)
95
112
  self.class == o.class &&
96
113
  number == o.number &&
97
- type == o.type
114
+ type == o.type &&
115
+ created_at == o.created_at &&
116
+ modified_at == o.modified_at
98
117
  end
99
118
 
100
119
  # @see the `==` method
@@ -106,7 +125,7 @@ module MergeAccountingClient
106
125
  # Calculates hash code according to all attributes.
107
126
  # @return [Integer] Hash code
108
127
  def hash
109
- [number, type].hash
128
+ [number, type, created_at, modified_at].hash
110
129
  end
111
130
 
112
131
  # Builds the object from hash
@@ -40,6 +40,11 @@ module MergeAccountingClient
40
40
  # The address's zip code.
41
41
  attr_accessor :zip_code
42
42
 
43
+ attr_accessor :created_at
44
+
45
+ # This is the datetime that this object was last updated by Merge
46
+ attr_accessor :modified_at
47
+
43
48
  # Attribute mapping from ruby-style variable name to JSON key.
44
49
  def self.attribute_map
45
50
  {
@@ -50,7 +55,9 @@ module MergeAccountingClient
50
55
  :'state' => :'state',
51
56
  :'country_subdivision' => :'country_subdivision',
52
57
  :'country' => :'country',
53
- :'zip_code' => :'zip_code'
58
+ :'zip_code' => :'zip_code',
59
+ :'created_at' => :'created_at',
60
+ :'modified_at' => :'modified_at'
54
61
  }
55
62
  end
56
63
 
@@ -69,7 +76,9 @@ module MergeAccountingClient
69
76
  :'state' => :'Object',
70
77
  :'country_subdivision' => :'String',
71
78
  :'country' => :'CountryEnum',
72
- :'zip_code' => :'String'
79
+ :'zip_code' => :'String',
80
+ :'created_at' => :'Time',
81
+ :'modified_at' => :'Time'
73
82
  }
74
83
  end
75
84
 
@@ -83,7 +92,7 @@ module MergeAccountingClient
83
92
  :'state',
84
93
  :'country_subdivision',
85
94
  :'country',
86
- :'zip_code'
95
+ :'zip_code',
87
96
  ])
88
97
  end
89
98
 
@@ -133,6 +142,14 @@ module MergeAccountingClient
133
142
  if attributes.key?(:'zip_code')
134
143
  self.zip_code = attributes[:'zip_code']
135
144
  end
145
+
146
+ if attributes.key?(:'created_at')
147
+ self.created_at = attributes[:'created_at']
148
+ end
149
+
150
+ if attributes.key?(:'modified_at')
151
+ self.modified_at = attributes[:'modified_at']
152
+ end
136
153
  end
137
154
 
138
155
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -160,7 +177,9 @@ module MergeAccountingClient
160
177
  state == o.state &&
161
178
  country_subdivision == o.country_subdivision &&
162
179
  country == o.country &&
163
- zip_code == o.zip_code
180
+ zip_code == o.zip_code &&
181
+ created_at == o.created_at &&
182
+ modified_at == o.modified_at
164
183
  end
165
184
 
166
185
  # @see the `==` method
@@ -172,7 +191,7 @@ module MergeAccountingClient
172
191
  # Calculates hash code according to all attributes.
173
192
  # @return [Integer] Hash code
174
193
  def hash
175
- [type, street_1, street_2, city, state, country_subdivision, country, zip_code].hash
194
+ [type, street_1, street_2, city, state, country_subdivision, country, zip_code, created_at, modified_at].hash
176
195
  end
177
196
 
178
197
  # Builds the object from hash