merge_accounting_client 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/Account.md +3 -1
  4. data/docs/AccountIntegration.md +4 -2
  5. data/docs/AccountingAttachment.md +3 -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 +2 -0
  10. data/docs/Address.md +2 -0
  11. data/docs/AddressRequest.md +34 -0
  12. data/docs/AuditLogEvent.md +32 -0
  13. data/docs/AuditTrailApi.md +91 -0
  14. data/docs/BalanceSheet.md +3 -1
  15. data/docs/CashFlowStatement.md +3 -1
  16. data/docs/CompanyInfo.md +3 -1
  17. data/docs/Contact.md +4 -2
  18. data/docs/ContactRequest.md +1 -1
  19. data/docs/ContactsApi.md +4 -0
  20. data/docs/CreditNote.md +8 -2
  21. data/docs/CreditNoteLineItem.md +6 -0
  22. data/docs/CreditNotesApi.md +2 -2
  23. data/docs/EndUserDetailsRequest.md +1 -1
  24. data/docs/EventTypeEnum.md +15 -0
  25. data/docs/Expense.md +10 -2
  26. data/docs/ExpenseLine.md +8 -0
  27. data/docs/ExpenseLineRequest.md +2 -0
  28. data/docs/ExpenseRequest.md +7 -1
  29. data/docs/IncomeStatement.md +3 -1
  30. data/docs/Invoice.md +11 -1
  31. data/docs/InvoiceLineItem.md +5 -1
  32. data/docs/InvoiceRequest.md +4 -0
  33. data/docs/InvoiceStatusEnum.md +15 -0
  34. data/docs/InvoicesApi.md +2 -2
  35. data/docs/Issue.md +1 -1
  36. data/docs/Item.md +3 -1
  37. data/docs/JournalEntriesApi.md +2 -2
  38. data/docs/JournalEntry.md +9 -1
  39. data/docs/JournalEntryRequest.md +4 -0
  40. data/docs/JournalLine.md +10 -0
  41. data/docs/JournalLineRequest.md +4 -0
  42. data/docs/LinkedAccountsApi.md +2 -2
  43. data/docs/MetaResponse.md +2 -2
  44. data/docs/PaginatedAccountingPeriodList.md +22 -0
  45. data/docs/PaginatedAuditLogEventList.md +22 -0
  46. data/docs/Payment.md +7 -1
  47. data/docs/PaymentLineItem.md +32 -0
  48. data/docs/PaymentLineItemRequest.md +30 -0
  49. data/docs/PaymentRequest.md +4 -0
  50. data/docs/PurchaseOrder.md +9 -3
  51. data/docs/PurchaseOrderLineItem.md +6 -0
  52. data/docs/PurchaseOrderRequest.md +2 -0
  53. data/docs/PurchaseOrdersApi.md +2 -2
  54. data/docs/ReportItem.md +2 -0
  55. data/docs/RoleEnum.md +15 -0
  56. data/docs/SyncStatusApi.md +1 -1
  57. data/docs/TaxRate.md +3 -1
  58. data/docs/TrackingCategory.md +3 -1
  59. data/docs/Transaction.md +7 -3
  60. data/docs/TransactionLineItem.md +6 -0
  61. data/docs/VendorCredit.md +6 -2
  62. data/docs/VendorCreditLine.md +6 -0
  63. data/docs/VendorCreditsApi.md +2 -2
  64. data/lib/merge_accounting_client/api/accounting_periods_api.rb +167 -0
  65. data/lib/merge_accounting_client/api/audit_trail_api.rb +95 -0
  66. data/lib/merge_accounting_client/api/contacts_api.rb +6 -0
  67. data/lib/merge_accounting_client/api/credit_notes_api.rb +2 -2
  68. data/lib/merge_accounting_client/api/expenses_api.rb +2 -2
  69. data/lib/merge_accounting_client/api/invoices_api.rb +2 -2
  70. data/lib/merge_accounting_client/api/journal_entries_api.rb +2 -2
  71. data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -3
  72. data/lib/merge_accounting_client/api/payments_api.rb +2 -2
  73. data/lib/merge_accounting_client/api/purchase_orders_api.rb +2 -2
  74. data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
  75. data/lib/merge_accounting_client/api/transactions_api.rb +2 -2
  76. data/lib/merge_accounting_client/api/vendor_credits_api.rb +2 -2
  77. data/lib/merge_accounting_client/configuration.rb +4 -0
  78. data/lib/merge_accounting_client/models/account.rb +12 -3
  79. data/lib/merge_accounting_client/models/account_integration.rb +15 -4
  80. data/lib/merge_accounting_client/models/account_request.rb +1 -1
  81. data/lib/merge_accounting_client/models/accounting_attachment.rb +11 -2
  82. data/lib/merge_accounting_client/models/accounting_period.rb +296 -0
  83. data/lib/merge_accounting_client/models/accounting_period_status_enum.rb +45 -0
  84. data/lib/merge_accounting_client/models/accounting_phone_number.rb +10 -1
  85. data/lib/merge_accounting_client/models/address.rb +10 -1
  86. data/lib/merge_accounting_client/models/address_request.rb +311 -0
  87. data/lib/merge_accounting_client/models/audit_log_event.rb +356 -0
  88. data/lib/merge_accounting_client/models/balance_sheet.rb +11 -2
  89. data/lib/merge_accounting_client/models/cash_flow_statement.rb +11 -2
  90. data/lib/merge_accounting_client/models/company_info.rb +12 -3
  91. data/lib/merge_accounting_client/models/contact.rb +13 -4
  92. data/lib/merge_accounting_client/models/contact_request.rb +2 -2
  93. data/lib/merge_accounting_client/models/credit_note.rb +35 -3
  94. data/lib/merge_accounting_client/models/credit_note_line_item.rb +29 -1
  95. data/lib/merge_accounting_client/models/end_user_details_request.rb +1 -1
  96. data/lib/merge_accounting_client/models/event_type_enum.rb +67 -0
  97. data/lib/merge_accounting_client/models/expense.rb +45 -3
  98. data/lib/merge_accounting_client/models/expense_line.rb +40 -1
  99. data/lib/merge_accounting_client/models/expense_line_request.rb +12 -1
  100. data/lib/merge_accounting_client/models/expense_request.rb +35 -2
  101. data/lib/merge_accounting_client/models/income_statement.rb +11 -2
  102. data/lib/merge_accounting_client/models/invoice.rb +55 -1
  103. data/lib/merge_accounting_client/models/invoice_line_item.rb +20 -1
  104. data/lib/merge_accounting_client/models/invoice_request.rb +23 -1
  105. data/lib/merge_accounting_client/models/invoice_status_enum.rb +49 -0
  106. data/lib/merge_accounting_client/models/item.rb +11 -2
  107. data/lib/merge_accounting_client/models/journal_entry.rb +60 -2
  108. data/lib/merge_accounting_client/models/journal_entry_request.rb +38 -1
  109. data/lib/merge_accounting_client/models/journal_line.rb +51 -1
  110. data/lib/merge_accounting_client/models/journal_line_request.rb +23 -1
  111. data/lib/merge_accounting_client/models/paginated_accounting_period_list.rb +240 -0
  112. data/lib/merge_accounting_client/models/paginated_audit_log_event_list.rb +240 -0
  113. data/lib/merge_accounting_client/models/payment.rb +34 -2
  114. data/lib/merge_accounting_client/models/payment_line_item.rb +308 -0
  115. data/lib/merge_accounting_client/models/payment_line_item_request.rb +319 -0
  116. data/lib/merge_accounting_client/models/payment_request.rb +24 -1
  117. data/lib/merge_accounting_client/models/purchase_order.rb +49 -3
  118. data/lib/merge_accounting_client/models/purchase_order_line_item.rb +29 -1
  119. data/lib/merge_accounting_client/models/purchase_order_request.rb +12 -1
  120. data/lib/merge_accounting_client/models/report_item.rb +10 -1
  121. data/lib/merge_accounting_client/models/role_enum.rb +49 -0
  122. data/lib/merge_accounting_client/models/tax_rate.rb +11 -2
  123. data/lib/merge_accounting_client/models/tracking_category.rb +12 -3
  124. data/lib/merge_accounting_client/models/transaction.rb +23 -3
  125. data/lib/merge_accounting_client/models/transaction_line_item.rb +29 -1
  126. data/lib/merge_accounting_client/models/vendor_credit.rb +23 -3
  127. data/lib/merge_accounting_client/models/vendor_credit_line.rb +29 -1
  128. data/lib/merge_accounting_client/version.rb +1 -1
  129. data/lib/merge_accounting_client.rb +13 -9
  130. data/spec/api/accounting_periods_api_spec.rb +63 -0
  131. data/spec/api/audit_trail_api_spec.rb +51 -0
  132. data/spec/api/contacts_api_spec.rb +2 -0
  133. data/spec/api/linked_accounts_api_spec.rb +1 -1
  134. data/spec/api/sync_status_api_spec.rb +1 -1
  135. data/spec/models/account_integration_spec.rb +6 -0
  136. data/spec/models/account_spec.rb +6 -0
  137. data/spec/models/accounting_attachment_spec.rb +6 -0
  138. data/spec/models/accounting_period_spec.rb +70 -0
  139. data/spec/models/accounting_period_status_enum_spec.rb +28 -0
  140. data/spec/models/accounting_phone_number_spec.rb +6 -0
  141. data/spec/models/address_request_spec.rb +82 -0
  142. data/spec/models/address_spec.rb +6 -0
  143. data/spec/models/audit_log_event_spec.rb +76 -0
  144. data/spec/models/balance_sheet_spec.rb +6 -0
  145. data/spec/models/cash_flow_statement_spec.rb +6 -0
  146. data/spec/models/company_info_spec.rb +6 -0
  147. data/spec/models/contact_spec.rb +6 -0
  148. data/spec/models/credit_note_line_item_spec.rb +18 -0
  149. data/spec/models/credit_note_spec.rb +18 -0
  150. data/spec/models/event_type_enum_spec.rb +28 -0
  151. data/spec/models/expense_line_request_spec.rb +6 -0
  152. data/spec/models/expense_line_spec.rb +24 -0
  153. data/spec/models/expense_request_spec.rb +18 -0
  154. data/spec/models/expense_spec.rb +24 -0
  155. data/spec/models/income_statement_spec.rb +6 -0
  156. data/spec/models/invoice_line_item_spec.rb +12 -0
  157. data/spec/models/invoice_request_spec.rb +12 -0
  158. data/spec/models/invoice_spec.rb +30 -0
  159. data/spec/models/invoice_status_enum_spec.rb +28 -0
  160. data/spec/models/item_spec.rb +6 -0
  161. data/spec/models/journal_entry_request_spec.rb +12 -0
  162. data/spec/models/journal_entry_spec.rb +24 -0
  163. data/spec/models/journal_line_request_spec.rb +12 -0
  164. data/spec/models/journal_line_spec.rb +30 -0
  165. data/spec/models/paginated_accounting_period_list_spec.rb +46 -0
  166. data/spec/models/paginated_audit_log_event_list_spec.rb +46 -0
  167. data/spec/models/payment_line_item_request_spec.rb +70 -0
  168. data/spec/models/payment_line_item_spec.rb +76 -0
  169. data/spec/models/payment_request_spec.rb +12 -0
  170. data/spec/models/payment_spec.rb +18 -0
  171. data/spec/models/purchase_order_line_item_spec.rb +18 -0
  172. data/spec/models/purchase_order_request_spec.rb +6 -0
  173. data/spec/models/purchase_order_spec.rb +18 -0
  174. data/spec/models/report_item_spec.rb +6 -0
  175. data/spec/models/role_enum_spec.rb +28 -0
  176. data/spec/models/tax_rate_spec.rb +6 -0
  177. data/spec/models/tracking_category_spec.rb +6 -0
  178. data/spec/models/transaction_line_item_spec.rb +18 -0
  179. data/spec/models/transaction_spec.rb +12 -0
  180. data/spec/models/vendor_credit_line_spec.rb +18 -0
  181. data/spec/models/vendor_credit_spec.rb +12 -0
  182. metadata +204 -152
@@ -0,0 +1,311 @@
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 Address Object ### Description The `Address` object is used to represent a contact's or company's address. ### Usage Example Fetch from the `GET CompanyInfo` endpoint and view the company's addresses.
18
+ class AddressRequest
19
+ # The address type. * `BILLING` - BILLING * `SHIPPING` - SHIPPING
20
+ attr_accessor :type
21
+
22
+ # Line 1 of the address's street.
23
+ attr_accessor :street_1
24
+
25
+ # Line 2 of the address's street.
26
+ attr_accessor :street_2
27
+
28
+ # The address's city.
29
+ attr_accessor :city
30
+
31
+ # The address's state or region.
32
+ attr_accessor :country_subdivision
33
+
34
+ # The address's country. * `AF` - Afghanistan * `AX` - Åland Islands * `AL` - Albania * `DZ` - Algeria * `AS` - American Samoa * `AD` - Andorra * `AO` - Angola * `AI` - Anguilla * `AQ` - Antarctica * `AG` - Antigua and Barbuda * `AR` - Argentina * `AM` - Armenia * `AW` - Aruba * `AU` - Australia * `AT` - Austria * `AZ` - Azerbaijan * `BS` - Bahamas * `BH` - Bahrain * `BD` - Bangladesh * `BB` - Barbados * `BY` - Belarus * `BE` - Belgium * `BZ` - Belize * `BJ` - Benin * `BM` - Bermuda * `BT` - Bhutan * `BO` - Bolivia * `BQ` - Bonaire, Sint Eustatius and Saba * `BA` - Bosnia and Herzegovina * `BW` - Botswana * `BV` - Bouvet Island * `BR` - Brazil * `IO` - British Indian Ocean Territory * `BN` - Brunei * `BG` - Bulgaria * `BF` - Burkina Faso * `BI` - Burundi * `CV` - Cabo Verde * `KH` - Cambodia * `CM` - Cameroon * `CA` - Canada * `KY` - Cayman Islands * `CF` - Central African Republic * `TD` - Chad * `CL` - Chile * `CN` - China * `CX` - Christmas Island * `CC` - Cocos (Keeling) Islands * `CO` - Colombia * `KM` - Comoros * `CG` - Congo * `CD` - Congo (the Democratic Republic of the) * `CK` - Cook Islands * `CR` - Costa Rica * `CI` - Côte d'Ivoire * `HR` - Croatia * `CU` - Cuba * `CW` - Curaçao * `CY` - Cyprus * `CZ` - Czechia * `DK` - Denmark * `DJ` - Djibouti * `DM` - Dominica * `DO` - Dominican Republic * `EC` - Ecuador * `EG` - Egypt * `SV` - El Salvador * `GQ` - Equatorial Guinea * `ER` - Eritrea * `EE` - Estonia * `SZ` - Eswatini * `ET` - Ethiopia * `FK` - Falkland Islands (Malvinas) * `FO` - Faroe Islands * `FJ` - Fiji * `FI` - Finland * `FR` - France * `GF` - French Guiana * `PF` - French Polynesia * `TF` - French Southern Territories * `GA` - Gabon * `GM` - Gambia * `GE` - Georgia * `DE` - Germany * `GH` - Ghana * `GI` - Gibraltar * `GR` - Greece * `GL` - Greenland * `GD` - Grenada * `GP` - Guadeloupe * `GU` - Guam * `GT` - Guatemala * `GG` - Guernsey * `GN` - Guinea * `GW` - Guinea-Bissau * `GY` - Guyana * `HT` - Haiti * `HM` - Heard Island and McDonald Islands * `VA` - Holy See * `HN` - Honduras * `HK` - Hong Kong * `HU` - Hungary * `IS` - Iceland * `IN` - India * `ID` - Indonesia * `IR` - Iran * `IQ` - Iraq * `IE` - Ireland * `IM` - Isle of Man * `IL` - Israel * `IT` - Italy * `JM` - Jamaica * `JP` - Japan * `JE` - Jersey * `JO` - Jordan * `KZ` - Kazakhstan * `KE` - Kenya * `KI` - Kiribati * `KW` - Kuwait * `KG` - Kyrgyzstan * `LA` - Laos * `LV` - Latvia * `LB` - Lebanon * `LS` - Lesotho * `LR` - Liberia * `LY` - Libya * `LI` - Liechtenstein * `LT` - Lithuania * `LU` - Luxembourg * `MO` - Macao * `MG` - Madagascar * `MW` - Malawi * `MY` - Malaysia * `MV` - Maldives * `ML` - Mali * `MT` - Malta * `MH` - Marshall Islands * `MQ` - Martinique * `MR` - Mauritania * `MU` - Mauritius * `YT` - Mayotte * `MX` - Mexico * `FM` - Micronesia (Federated States of) * `MD` - Moldova * `MC` - Monaco * `MN` - Mongolia * `ME` - Montenegro * `MS` - Montserrat * `MA` - Morocco * `MZ` - Mozambique * `MM` - Myanmar * `NA` - Namibia * `NR` - Nauru * `NP` - Nepal * `NL` - Netherlands * `NC` - New Caledonia * `NZ` - New Zealand * `NI` - Nicaragua * `NE` - Niger * `NG` - Nigeria * `NU` - Niue * `NF` - Norfolk Island * `KP` - North Korea * `MK` - North Macedonia * `MP` - Northern Mariana Islands * `NO` - Norway * `OM` - Oman * `PK` - Pakistan * `PW` - Palau * `PS` - Palestine, State of * `PA` - Panama * `PG` - Papua New Guinea * `PY` - Paraguay * `PE` - Peru * `PH` - Philippines * `PN` - Pitcairn * `PL` - Poland * `PT` - Portugal * `PR` - Puerto Rico * `QA` - Qatar * `RE` - Réunion * `RO` - Romania * `RU` - Russia * `RW` - Rwanda * `BL` - Saint Barthélemy * `SH` - Saint Helena, Ascension and Tristan da Cunha * `KN` - Saint Kitts and Nevis * `LC` - Saint Lucia * `MF` - Saint Martin (French part) * `PM` - Saint Pierre and Miquelon * `VC` - Saint Vincent and the Grenadines * `WS` - Samoa * `SM` - San Marino * `ST` - Sao Tome and Principe * `SA` - Saudi Arabia * `SN` - Senegal * `RS` - Serbia * `SC` - Seychelles * `SL` - Sierra Leone * `SG` - Singapore * `SX` - Sint Maarten (Dutch part) * `SK` - Slovakia * `SI` - Slovenia * `SB` - Solomon Islands * `SO` - Somalia * `ZA` - South Africa * `GS` - South Georgia and the South Sandwich Islands * `KR` - South Korea * `SS` - South Sudan * `ES` - Spain * `LK` - Sri Lanka * `SD` - Sudan * `SR` - Suriname * `SJ` - Svalbard and Jan Mayen * `SE` - Sweden * `CH` - Switzerland * `SY` - Syria * `TW` - Taiwan * `TJ` - Tajikistan * `TZ` - Tanzania * `TH` - Thailand * `TL` - Timor-Leste * `TG` - Togo * `TK` - Tokelau * `TO` - Tonga * `TT` - Trinidad and Tobago * `TN` - Tunisia * `TR` - Turkey * `TM` - Turkmenistan * `TC` - Turks and Caicos Islands * `TV` - Tuvalu * `UG` - Uganda * `UA` - Ukraine * `AE` - United Arab Emirates * `GB` - United Kingdom * `UM` - United States Minor Outlying Islands * `US` - United States of America * `UY` - Uruguay * `UZ` - Uzbekistan * `VU` - Vanuatu * `VE` - Venezuela * `VN` - Vietnam * `VG` - Virgin Islands (British) * `VI` - Virgin Islands (U.S.) * `WF` - Wallis and Futuna * `EH` - Western Sahara * `YE` - Yemen * `ZM` - Zambia * `ZW` - Zimbabwe
35
+ attr_accessor :country
36
+
37
+ # The address's zip code.
38
+ attr_accessor :zip_code
39
+
40
+ attr_accessor :integration_params
41
+
42
+ attr_accessor :linked_account_params
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'type' => :'type',
48
+ :'street_1' => :'street_1',
49
+ :'street_2' => :'street_2',
50
+ :'city' => :'city',
51
+ :'country_subdivision' => :'country_subdivision',
52
+ :'country' => :'country',
53
+ :'zip_code' => :'zip_code',
54
+ :'integration_params' => :'integration_params',
55
+ :'linked_account_params' => :'linked_account_params'
56
+ }
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'type' => :'AddressTypeEnum',
68
+ :'street_1' => :'String',
69
+ :'street_2' => :'String',
70
+ :'city' => :'String',
71
+ :'country_subdivision' => :'String',
72
+ :'country' => :'CountryEnum',
73
+ :'zip_code' => :'String',
74
+ :'integration_params' => :'Hash<String, Object>',
75
+ :'linked_account_params' => :'Hash<String, Object>'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ :'type',
83
+ :'street_1',
84
+ :'street_2',
85
+ :'city',
86
+ :'country_subdivision',
87
+ :'country',
88
+ :'zip_code',
89
+ :'integration_params',
90
+ :'linked_account_params'
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::AddressRequest` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::AddressRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'type')
110
+ self.type = attributes[:'type']
111
+ end
112
+
113
+ if attributes.key?(:'street_1')
114
+ self.street_1 = attributes[:'street_1']
115
+ end
116
+
117
+ if attributes.key?(:'street_2')
118
+ self.street_2 = attributes[:'street_2']
119
+ end
120
+
121
+ if attributes.key?(:'city')
122
+ self.city = attributes[:'city']
123
+ end
124
+
125
+ if attributes.key?(:'country_subdivision')
126
+ self.country_subdivision = attributes[:'country_subdivision']
127
+ end
128
+
129
+ if attributes.key?(:'country')
130
+ self.country = attributes[:'country']
131
+ end
132
+
133
+ if attributes.key?(:'zip_code')
134
+ self.zip_code = attributes[:'zip_code']
135
+ end
136
+
137
+ if attributes.key?(:'integration_params')
138
+ if (value = attributes[:'integration_params']).is_a?(Hash)
139
+ self.integration_params = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'linked_account_params')
144
+ if (value = attributes[:'linked_account_params']).is_a?(Hash)
145
+ self.linked_account_params = value
146
+ end
147
+ end
148
+ end
149
+
150
+ # Show invalid properties with the reasons. Usually used together with valid?
151
+ # @return Array for valid properties with the reasons
152
+ def list_invalid_properties
153
+ invalid_properties = Array.new
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ true
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ type == o.type &&
169
+ street_1 == o.street_1 &&
170
+ street_2 == o.street_2 &&
171
+ city == o.city &&
172
+ country_subdivision == o.country_subdivision &&
173
+ country == o.country &&
174
+ zip_code == o.zip_code &&
175
+ integration_params == o.integration_params &&
176
+ linked_account_params == o.linked_account_params
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Integer] Hash code
187
+ def hash
188
+ [type, street_1, street_2, city, country_subdivision, country, zip_code, integration_params, linked_account_params].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def self.build_from_hash(attributes)
195
+ new.build_from_hash(attributes)
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ self.class.openapi_types.each_pair do |key, type|
204
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
205
+ self.send("#{key}=", nil)
206
+ elsif type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
210
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ end
212
+ elsif !attributes[self.class.attribute_map[key]].nil?
213
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
+ end
215
+ end
216
+
217
+ self
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def _deserialize(type, value)
225
+ case type.to_sym
226
+ when :Time
227
+ Time.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ # models (e.g. Pet) or oneOf
258
+ klass = MergeAccountingClient.const_get(type)
259
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
260
+ end
261
+ end
262
+
263
+ # Returns the string representation of the object
264
+ # @return [String] String presentation of the object
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_hash (backward compatibility)
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_body
272
+ to_hash
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ # Outputs non-array value in the form of hash
292
+ # For object, use to_hash. Otherwise, just return the value
293
+ # @param [Object] value Any valid value
294
+ # @return [Hash] Returns the value in the form of hash
295
+ def _to_hash(value)
296
+ if value.is_a?(Array)
297
+ value.compact.map { |v| _to_hash(v) }
298
+ elsif value.is_a?(Hash)
299
+ {}.tap do |hash|
300
+ value.each { |k, v| hash[k] = _to_hash(v) }
301
+ end
302
+ elsif value.respond_to? :to_hash
303
+ value.to_hash
304
+ else
305
+ value
306
+ end
307
+ end
308
+
309
+ end
310
+
311
+ end
@@ -0,0 +1,356 @@
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 AuditLogEvent
18
+ attr_accessor :id
19
+
20
+ # The User's full name at the time of this Event occurring.
21
+ attr_accessor :user_name
22
+
23
+ # The User's email at the time of this Event occurring.
24
+ attr_accessor :user_email
25
+
26
+ # Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. * `ADMIN` - ADMIN * `DEVELOPER` - DEVELOPER * `MEMBER` - MEMBER * `API` - API * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM
27
+ attr_accessor :role
28
+
29
+ attr_accessor :ip_address
30
+
31
+ # Designates the type of event that occurred. * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY * `INVITED_USER` - INVITED_USER * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT * `CREATED_DESTINATION` - CREATED_DESTINATION * `DELETED_DESTINATION` - DELETED_DESTINATION * `CHANGED_SCOPES` - CHANGED_SCOPES * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION * `ENABLED_CATEGORY` - ENABLED_CATEGORY * `DISABLED_CATEGORY` - DISABLED_CATEGORY * `CHANGED_PASSWORD` - CHANGED_PASSWORD * `RESET_PASSWORD` - RESET_PASSWORD * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
32
+ attr_accessor :event_type
33
+
34
+ attr_accessor :event_description
35
+
36
+ attr_accessor :created_at
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'user_name' => :'user_name',
43
+ :'user_email' => :'user_email',
44
+ :'role' => :'role',
45
+ :'ip_address' => :'ip_address',
46
+ :'event_type' => :'event_type',
47
+ :'event_description' => :'event_description',
48
+ :'created_at' => :'created_at'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'id' => :'String',
61
+ :'user_name' => :'String',
62
+ :'user_email' => :'String',
63
+ :'role' => :'RoleEnum',
64
+ :'ip_address' => :'String',
65
+ :'event_type' => :'EventTypeEnum',
66
+ :'event_description' => :'String',
67
+ :'created_at' => :'Time'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'user_name',
75
+ :'user_email',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::AuditLogEvent` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::AuditLogEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'id')
95
+ self.id = attributes[:'id']
96
+ end
97
+
98
+ if attributes.key?(:'user_name')
99
+ self.user_name = attributes[:'user_name']
100
+ end
101
+
102
+ if attributes.key?(:'user_email')
103
+ self.user_email = attributes[:'user_email']
104
+ end
105
+
106
+ if attributes.key?(:'role')
107
+ self.role = attributes[:'role']
108
+ end
109
+
110
+ if attributes.key?(:'ip_address')
111
+ self.ip_address = attributes[:'ip_address']
112
+ end
113
+
114
+ if attributes.key?(:'event_type')
115
+ self.event_type = attributes[:'event_type']
116
+ end
117
+
118
+ if attributes.key?(:'event_description')
119
+ self.event_description = attributes[:'event_description']
120
+ end
121
+
122
+ if attributes.key?(:'created_at')
123
+ self.created_at = attributes[:'created_at']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ if !@user_name.nil? && @user_name.to_s.length > 200
132
+ invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 200.')
133
+ end
134
+
135
+ if !@user_email.nil? && @user_email.to_s.length > 254
136
+ invalid_properties.push('invalid value for "user_email", the character length must be smaller than or equal to 254.')
137
+ end
138
+
139
+ if @role.nil?
140
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
141
+ end
142
+
143
+ if @ip_address.nil?
144
+ invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.')
145
+ end
146
+
147
+ if @ip_address.to_s.length > 45
148
+ invalid_properties.push('invalid value for "ip_address", the character length must be smaller than or equal to 45.')
149
+ end
150
+
151
+ if @event_type.nil?
152
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
153
+ end
154
+
155
+ if @event_description.nil?
156
+ invalid_properties.push('invalid value for "event_description", event_description cannot be nil.')
157
+ end
158
+
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ return false if !@user_name.nil? && @user_name.to_s.length > 200
166
+ return false if !@user_email.nil? && @user_email.to_s.length > 254
167
+ return false if @role.nil?
168
+ return false if @ip_address.nil?
169
+ return false if @ip_address.to_s.length > 45
170
+ return false if @event_type.nil?
171
+ return false if @event_description.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] user_name Value to be assigned
177
+ def user_name=(user_name)
178
+ if !user_name.nil? && user_name.to_s.length > 200
179
+ fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 200.'
180
+ end
181
+
182
+ @user_name = user_name
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] user_email Value to be assigned
187
+ def user_email=(user_email)
188
+ if !user_email.nil? && user_email.to_s.length > 254
189
+ fail ArgumentError, 'invalid value for "user_email", the character length must be smaller than or equal to 254.'
190
+ end
191
+
192
+ @user_email = user_email
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] ip_address Value to be assigned
197
+ def ip_address=(ip_address)
198
+ if ip_address.nil?
199
+ fail ArgumentError, 'ip_address cannot be nil'
200
+ end
201
+
202
+ if ip_address.to_s.length > 45
203
+ fail ArgumentError, 'invalid value for "ip_address", the character length must be smaller than or equal to 45.'
204
+ end
205
+
206
+ @ip_address = ip_address
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ id == o.id &&
215
+ user_name == o.user_name &&
216
+ user_email == o.user_email &&
217
+ role == o.role &&
218
+ ip_address == o.ip_address &&
219
+ event_type == o.event_type &&
220
+ event_description == o.event_description &&
221
+ created_at == o.created_at
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [id, user_name, user_email, role, ip_address, event_type, event_description, created_at].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ new.build_from_hash(attributes)
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+ self.class.openapi_types.each_pair do |key, type|
249
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
250
+ self.send("#{key}=", nil)
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
255
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ end
257
+ elsif !attributes[self.class.attribute_map[key]].nil?
258
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
+ end
260
+ end
261
+
262
+ self
263
+ end
264
+
265
+ # Deserializes the data based on type
266
+ # @param string type Data type
267
+ # @param string value Value to be deserialized
268
+ # @return [Object] Deserialized data
269
+ def _deserialize(type, value)
270
+ case type.to_sym
271
+ when :Time
272
+ Time.parse(value)
273
+ when :Date
274
+ Date.parse(value)
275
+ when :String
276
+ value
277
+ when :Integer
278
+ value.to_i
279
+ when :Float
280
+ value.to_f
281
+ when :Boolean
282
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
283
+ true
284
+ else
285
+ false
286
+ end
287
+ when :Object
288
+ # generic object (usually a Hash), return directly
289
+ value
290
+ when /\AArray<(?<inner_type>.+)>\z/
291
+ inner_type = Regexp.last_match[:inner_type]
292
+ value.map { |v| _deserialize(inner_type, v) }
293
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
294
+ k_type = Regexp.last_match[:k_type]
295
+ v_type = Regexp.last_match[:v_type]
296
+ {}.tap do |hash|
297
+ value.each do |k, v|
298
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
299
+ end
300
+ end
301
+ else # model
302
+ # models (e.g. Pet) or oneOf
303
+ klass = MergeAccountingClient.const_get(type)
304
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
305
+ end
306
+ end
307
+
308
+ # Returns the string representation of the object
309
+ # @return [String] String presentation of the object
310
+ def to_s
311
+ to_hash.to_s
312
+ end
313
+
314
+ # to_body is an alias to to_hash (backward compatibility)
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_body
317
+ to_hash
318
+ end
319
+
320
+ # Returns the object in the form of hash
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_hash
323
+ hash = {}
324
+ self.class.attribute_map.each_pair do |attr, param|
325
+ value = self.send(attr)
326
+ if value.nil?
327
+ is_nullable = self.class.openapi_nullable.include?(attr)
328
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
329
+ end
330
+
331
+ hash[param] = _to_hash(value)
332
+ end
333
+ hash
334
+ end
335
+
336
+ # Outputs non-array value in the form of hash
337
+ # For object, use to_hash. Otherwise, just return the value
338
+ # @param [Object] value Any valid value
339
+ # @return [Hash] Returns the value in the form of hash
340
+ def _to_hash(value)
341
+ if value.is_a?(Array)
342
+ value.compact.map { |v| _to_hash(v) }
343
+ elsif value.is_a?(Hash)
344
+ {}.tap do |hash|
345
+ value.each { |k, v| hash[k] = _to_hash(v) }
346
+ end
347
+ elsif value.respond_to? :to_hash
348
+ value.to_hash
349
+ else
350
+ value
351
+ end
352
+ end
353
+
354
+ end
355
+
356
+ end