merge_accounting_client 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/docs/Account.md +3 -1
- data/docs/AccountIntegration.md +4 -2
- data/docs/AccountingAttachment.md +3 -1
- data/docs/AccountingPeriod.md +30 -0
- data/docs/AccountingPeriodStatusEnum.md +15 -0
- data/docs/AccountingPeriodsApi.md +167 -0
- data/docs/AccountingPhoneNumber.md +2 -0
- data/docs/Address.md +2 -0
- data/docs/AddressRequest.md +34 -0
- data/docs/AuditLogEvent.md +32 -0
- data/docs/AuditTrailApi.md +91 -0
- data/docs/BalanceSheet.md +3 -1
- data/docs/CashFlowStatement.md +3 -1
- data/docs/CompanyInfo.md +3 -1
- data/docs/Contact.md +4 -2
- data/docs/ContactRequest.md +1 -1
- data/docs/ContactsApi.md +4 -0
- data/docs/CreditNote.md +8 -2
- data/docs/CreditNoteLineItem.md +6 -0
- data/docs/CreditNotesApi.md +2 -2
- data/docs/EndUserDetailsRequest.md +1 -1
- data/docs/EventTypeEnum.md +15 -0
- data/docs/Expense.md +10 -2
- data/docs/ExpenseLine.md +8 -0
- data/docs/ExpenseLineRequest.md +2 -0
- data/docs/ExpenseRequest.md +7 -1
- data/docs/IncomeStatement.md +3 -1
- data/docs/Invoice.md +11 -1
- data/docs/InvoiceLineItem.md +5 -1
- data/docs/InvoiceRequest.md +4 -0
- data/docs/InvoiceStatusEnum.md +15 -0
- data/docs/InvoicesApi.md +2 -2
- data/docs/Issue.md +1 -1
- data/docs/Item.md +3 -1
- data/docs/JournalEntriesApi.md +2 -2
- data/docs/JournalEntry.md +9 -1
- data/docs/JournalEntryRequest.md +4 -0
- data/docs/JournalLine.md +10 -0
- data/docs/JournalLineRequest.md +4 -0
- data/docs/LinkedAccountsApi.md +2 -2
- data/docs/MetaResponse.md +2 -2
- data/docs/PaginatedAccountingPeriodList.md +22 -0
- data/docs/PaginatedAuditLogEventList.md +22 -0
- data/docs/Payment.md +7 -1
- data/docs/PaymentLineItem.md +32 -0
- data/docs/PaymentLineItemRequest.md +30 -0
- data/docs/PaymentRequest.md +4 -0
- data/docs/PurchaseOrder.md +9 -3
- data/docs/PurchaseOrderLineItem.md +6 -0
- data/docs/PurchaseOrderRequest.md +2 -0
- data/docs/PurchaseOrdersApi.md +2 -2
- data/docs/ReportItem.md +2 -0
- data/docs/RoleEnum.md +15 -0
- data/docs/SyncStatusApi.md +1 -1
- data/docs/TaxRate.md +3 -1
- data/docs/TrackingCategory.md +3 -1
- data/docs/Transaction.md +7 -3
- data/docs/TransactionLineItem.md +6 -0
- data/docs/VendorCredit.md +6 -2
- data/docs/VendorCreditLine.md +6 -0
- data/docs/VendorCreditsApi.md +2 -2
- data/lib/merge_accounting_client/api/accounting_periods_api.rb +167 -0
- data/lib/merge_accounting_client/api/audit_trail_api.rb +95 -0
- data/lib/merge_accounting_client/api/contacts_api.rb +6 -0
- data/lib/merge_accounting_client/api/credit_notes_api.rb +2 -2
- data/lib/merge_accounting_client/api/expenses_api.rb +2 -2
- data/lib/merge_accounting_client/api/invoices_api.rb +2 -2
- data/lib/merge_accounting_client/api/journal_entries_api.rb +2 -2
- data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -3
- data/lib/merge_accounting_client/api/payments_api.rb +2 -2
- data/lib/merge_accounting_client/api/purchase_orders_api.rb +2 -2
- data/lib/merge_accounting_client/api/sync_status_api.rb +2 -2
- data/lib/merge_accounting_client/api/transactions_api.rb +2 -2
- data/lib/merge_accounting_client/api/vendor_credits_api.rb +2 -2
- data/lib/merge_accounting_client/configuration.rb +4 -0
- data/lib/merge_accounting_client/models/account.rb +12 -3
- data/lib/merge_accounting_client/models/account_integration.rb +15 -4
- data/lib/merge_accounting_client/models/account_request.rb +1 -1
- data/lib/merge_accounting_client/models/accounting_attachment.rb +11 -2
- data/lib/merge_accounting_client/models/accounting_period.rb +296 -0
- data/lib/merge_accounting_client/models/accounting_period_status_enum.rb +45 -0
- data/lib/merge_accounting_client/models/accounting_phone_number.rb +10 -1
- data/lib/merge_accounting_client/models/address.rb +10 -1
- data/lib/merge_accounting_client/models/address_request.rb +311 -0
- data/lib/merge_accounting_client/models/audit_log_event.rb +356 -0
- data/lib/merge_accounting_client/models/balance_sheet.rb +11 -2
- data/lib/merge_accounting_client/models/cash_flow_statement.rb +11 -2
- data/lib/merge_accounting_client/models/company_info.rb +12 -3
- data/lib/merge_accounting_client/models/contact.rb +13 -4
- data/lib/merge_accounting_client/models/contact_request.rb +2 -2
- data/lib/merge_accounting_client/models/credit_note.rb +35 -3
- data/lib/merge_accounting_client/models/credit_note_line_item.rb +29 -1
- data/lib/merge_accounting_client/models/end_user_details_request.rb +1 -1
- data/lib/merge_accounting_client/models/event_type_enum.rb +67 -0
- data/lib/merge_accounting_client/models/expense.rb +45 -3
- data/lib/merge_accounting_client/models/expense_line.rb +40 -1
- data/lib/merge_accounting_client/models/expense_line_request.rb +12 -1
- data/lib/merge_accounting_client/models/expense_request.rb +35 -2
- data/lib/merge_accounting_client/models/income_statement.rb +11 -2
- data/lib/merge_accounting_client/models/invoice.rb +55 -1
- data/lib/merge_accounting_client/models/invoice_line_item.rb +20 -1
- data/lib/merge_accounting_client/models/invoice_request.rb +23 -1
- data/lib/merge_accounting_client/models/invoice_status_enum.rb +49 -0
- data/lib/merge_accounting_client/models/item.rb +11 -2
- data/lib/merge_accounting_client/models/journal_entry.rb +60 -2
- data/lib/merge_accounting_client/models/journal_entry_request.rb +38 -1
- data/lib/merge_accounting_client/models/journal_line.rb +51 -1
- data/lib/merge_accounting_client/models/journal_line_request.rb +23 -1
- data/lib/merge_accounting_client/models/paginated_accounting_period_list.rb +240 -0
- data/lib/merge_accounting_client/models/paginated_audit_log_event_list.rb +240 -0
- data/lib/merge_accounting_client/models/payment.rb +34 -2
- data/lib/merge_accounting_client/models/payment_line_item.rb +308 -0
- data/lib/merge_accounting_client/models/payment_line_item_request.rb +319 -0
- data/lib/merge_accounting_client/models/payment_request.rb +24 -1
- data/lib/merge_accounting_client/models/purchase_order.rb +49 -3
- data/lib/merge_accounting_client/models/purchase_order_line_item.rb +29 -1
- data/lib/merge_accounting_client/models/purchase_order_request.rb +12 -1
- data/lib/merge_accounting_client/models/report_item.rb +10 -1
- data/lib/merge_accounting_client/models/role_enum.rb +49 -0
- data/lib/merge_accounting_client/models/tax_rate.rb +11 -2
- data/lib/merge_accounting_client/models/tracking_category.rb +12 -3
- data/lib/merge_accounting_client/models/transaction.rb +23 -3
- data/lib/merge_accounting_client/models/transaction_line_item.rb +29 -1
- data/lib/merge_accounting_client/models/vendor_credit.rb +23 -3
- data/lib/merge_accounting_client/models/vendor_credit_line.rb +29 -1
- data/lib/merge_accounting_client/version.rb +1 -1
- data/lib/merge_accounting_client.rb +13 -9
- data/spec/api/accounting_periods_api_spec.rb +63 -0
- data/spec/api/audit_trail_api_spec.rb +51 -0
- data/spec/api/contacts_api_spec.rb +2 -0
- data/spec/api/linked_accounts_api_spec.rb +1 -1
- data/spec/api/sync_status_api_spec.rb +1 -1
- data/spec/models/account_integration_spec.rb +6 -0
- data/spec/models/account_spec.rb +6 -0
- data/spec/models/accounting_attachment_spec.rb +6 -0
- data/spec/models/accounting_period_spec.rb +70 -0
- data/spec/models/accounting_period_status_enum_spec.rb +28 -0
- data/spec/models/accounting_phone_number_spec.rb +6 -0
- data/spec/models/address_request_spec.rb +82 -0
- data/spec/models/address_spec.rb +6 -0
- data/spec/models/audit_log_event_spec.rb +76 -0
- data/spec/models/balance_sheet_spec.rb +6 -0
- data/spec/models/cash_flow_statement_spec.rb +6 -0
- data/spec/models/company_info_spec.rb +6 -0
- data/spec/models/contact_spec.rb +6 -0
- data/spec/models/credit_note_line_item_spec.rb +18 -0
- data/spec/models/credit_note_spec.rb +18 -0
- data/spec/models/event_type_enum_spec.rb +28 -0
- data/spec/models/expense_line_request_spec.rb +6 -0
- data/spec/models/expense_line_spec.rb +24 -0
- data/spec/models/expense_request_spec.rb +18 -0
- data/spec/models/expense_spec.rb +24 -0
- data/spec/models/income_statement_spec.rb +6 -0
- data/spec/models/invoice_line_item_spec.rb +12 -0
- data/spec/models/invoice_request_spec.rb +12 -0
- data/spec/models/invoice_spec.rb +30 -0
- data/spec/models/invoice_status_enum_spec.rb +28 -0
- data/spec/models/item_spec.rb +6 -0
- data/spec/models/journal_entry_request_spec.rb +12 -0
- data/spec/models/journal_entry_spec.rb +24 -0
- data/spec/models/journal_line_request_spec.rb +12 -0
- data/spec/models/journal_line_spec.rb +30 -0
- data/spec/models/paginated_accounting_period_list_spec.rb +46 -0
- data/spec/models/paginated_audit_log_event_list_spec.rb +46 -0
- data/spec/models/payment_line_item_request_spec.rb +70 -0
- data/spec/models/payment_line_item_spec.rb +76 -0
- data/spec/models/payment_request_spec.rb +12 -0
- data/spec/models/payment_spec.rb +18 -0
- data/spec/models/purchase_order_line_item_spec.rb +18 -0
- data/spec/models/purchase_order_request_spec.rb +6 -0
- data/spec/models/purchase_order_spec.rb +18 -0
- data/spec/models/report_item_spec.rb +6 -0
- data/spec/models/role_enum_spec.rb +28 -0
- data/spec/models/tax_rate_spec.rb +6 -0
- data/spec/models/tracking_category_spec.rb +6 -0
- data/spec/models/transaction_line_item_spec.rb +18 -0
- data/spec/models/transaction_spec.rb +12 -0
- data/spec/models/vendor_credit_line_spec.rb +18 -0
- data/spec/models/vendor_credit_spec.rb +12 -0
- metadata +204 -152
@@ -38,6 +38,9 @@ module MergeAccountingClient
|
|
38
38
|
# Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}
|
39
39
|
attr_accessor :api_endpoints_to_documentation_urls
|
40
40
|
|
41
|
+
# Setup guide URL for third party webhook creation. Exposed in Merge Docs.
|
42
|
+
attr_accessor :webhook_setup_guide_url
|
43
|
+
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
45
|
def self.attribute_map
|
43
46
|
{
|
@@ -48,7 +51,8 @@ module MergeAccountingClient
|
|
48
51
|
:'color' => :'color',
|
49
52
|
:'slug' => :'slug',
|
50
53
|
:'is_in_beta' => :'is_in_beta',
|
51
|
-
:'api_endpoints_to_documentation_urls' => :'api_endpoints_to_documentation_urls'
|
54
|
+
:'api_endpoints_to_documentation_urls' => :'api_endpoints_to_documentation_urls',
|
55
|
+
:'webhook_setup_guide_url' => :'webhook_setup_guide_url'
|
52
56
|
}
|
53
57
|
end
|
54
58
|
|
@@ -67,7 +71,8 @@ module MergeAccountingClient
|
|
67
71
|
:'color' => :'String',
|
68
72
|
:'slug' => :'String',
|
69
73
|
:'is_in_beta' => :'Boolean',
|
70
|
-
:'api_endpoints_to_documentation_urls' => :'Hash<String, Object>'
|
74
|
+
:'api_endpoints_to_documentation_urls' => :'Hash<String, Object>',
|
75
|
+
:'webhook_setup_guide_url' => :'String'
|
71
76
|
}
|
72
77
|
end
|
73
78
|
|
@@ -76,6 +81,7 @@ module MergeAccountingClient
|
|
76
81
|
Set.new([
|
77
82
|
:'image',
|
78
83
|
:'square_image',
|
84
|
+
:'webhook_setup_guide_url'
|
79
85
|
])
|
80
86
|
end
|
81
87
|
|
@@ -129,6 +135,10 @@ module MergeAccountingClient
|
|
129
135
|
self.api_endpoints_to_documentation_urls = value
|
130
136
|
end
|
131
137
|
end
|
138
|
+
|
139
|
+
if attributes.key?(:'webhook_setup_guide_url')
|
140
|
+
self.webhook_setup_guide_url = attributes[:'webhook_setup_guide_url']
|
141
|
+
end
|
132
142
|
end
|
133
143
|
|
134
144
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -187,7 +197,8 @@ module MergeAccountingClient
|
|
187
197
|
color == o.color &&
|
188
198
|
slug == o.slug &&
|
189
199
|
is_in_beta == o.is_in_beta &&
|
190
|
-
api_endpoints_to_documentation_urls == o.api_endpoints_to_documentation_urls
|
200
|
+
api_endpoints_to_documentation_urls == o.api_endpoints_to_documentation_urls &&
|
201
|
+
webhook_setup_guide_url == o.webhook_setup_guide_url
|
191
202
|
end
|
192
203
|
|
193
204
|
# @see the `==` method
|
@@ -199,7 +210,7 @@ module MergeAccountingClient
|
|
199
210
|
# Calculates hash code according to all attributes.
|
200
211
|
# @return [Integer] Hash code
|
201
212
|
def hash
|
202
|
-
[name, categories, image, square_image, color, slug, is_in_beta, api_endpoints_to_documentation_urls].hash
|
213
|
+
[name, categories, image, square_image, color, slug, is_in_beta, api_endpoints_to_documentation_urls, webhook_setup_guide_url].hash
|
203
214
|
end
|
204
215
|
|
205
216
|
# Builds the object from hash
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeAccountingClient
|
17
|
-
# # The Account Object ### Description The `Account` object is
|
17
|
+
# # The Account Object ### Description An `Account` represents a category in a company’s ledger in which a financial transaction is recorded against. The aggregation of each `Account` object is often referred to as the **Chart of Accounts**. An `Account` can be classified into one of the following categories, determined through the `classification` field: * __Asset:__ Accounts Receivable and Bank Accounts * __Liability:__ Accounts Payable and Credit Card Accounts * __Equity:__ Treasury Accounts and Retained Earnings * __Revenue:__ Income and Other Income * __Expense:__ Cost of Goods Sold and Office Expenses ### Usage Example Fetch from the `LIST Accounts` endpoint and view a company's accounts.
|
18
18
|
class AccountRequest
|
19
19
|
# The account's name.
|
20
20
|
attr_accessor :name
|
@@ -30,9 +30,11 @@ module MergeAccountingClient
|
|
30
30
|
# The company the accounting attachment belongs to.
|
31
31
|
attr_accessor :company
|
32
32
|
|
33
|
-
# Indicates whether or not this object has been deleted
|
33
|
+
# Indicates whether or not this object has been deleted in the third party platform.
|
34
34
|
attr_accessor :remote_was_deleted
|
35
35
|
|
36
|
+
attr_accessor :created_at
|
37
|
+
|
36
38
|
# This is the datetime that this object was last updated by Merge
|
37
39
|
attr_accessor :modified_at
|
38
40
|
|
@@ -49,6 +51,7 @@ module MergeAccountingClient
|
|
49
51
|
:'file_url' => :'file_url',
|
50
52
|
:'company' => :'company',
|
51
53
|
:'remote_was_deleted' => :'remote_was_deleted',
|
54
|
+
:'created_at' => :'created_at',
|
52
55
|
:'modified_at' => :'modified_at',
|
53
56
|
:'field_mappings' => :'field_mappings',
|
54
57
|
:'remote_data' => :'remote_data'
|
@@ -69,6 +72,7 @@ module MergeAccountingClient
|
|
69
72
|
:'file_url' => :'String',
|
70
73
|
:'company' => :'String',
|
71
74
|
:'remote_was_deleted' => :'Boolean',
|
75
|
+
:'created_at' => :'Time',
|
72
76
|
:'modified_at' => :'Time',
|
73
77
|
:'field_mappings' => :'Hash<String, Object>',
|
74
78
|
:'remote_data' => :'Array<RemoteData>'
|
@@ -126,6 +130,10 @@ module MergeAccountingClient
|
|
126
130
|
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
127
131
|
end
|
128
132
|
|
133
|
+
if attributes.key?(:'created_at')
|
134
|
+
self.created_at = attributes[:'created_at']
|
135
|
+
end
|
136
|
+
|
129
137
|
if attributes.key?(:'modified_at')
|
130
138
|
self.modified_at = attributes[:'modified_at']
|
131
139
|
end
|
@@ -182,6 +190,7 @@ module MergeAccountingClient
|
|
182
190
|
file_url == o.file_url &&
|
183
191
|
company == o.company &&
|
184
192
|
remote_was_deleted == o.remote_was_deleted &&
|
193
|
+
created_at == o.created_at &&
|
185
194
|
modified_at == o.modified_at &&
|
186
195
|
field_mappings == o.field_mappings &&
|
187
196
|
remote_data == o.remote_data
|
@@ -196,7 +205,7 @@ module MergeAccountingClient
|
|
196
205
|
# Calculates hash code according to all attributes.
|
197
206
|
# @return [Integer] Hash code
|
198
207
|
def hash
|
199
|
-
[id, remote_id, file_name, file_url, company, remote_was_deleted, modified_at, field_mappings, remote_data].hash
|
208
|
+
[id, remote_id, file_name, file_url, company, remote_was_deleted, created_at, modified_at, field_mappings, remote_data].hash
|
200
209
|
end
|
201
210
|
|
202
211
|
# Builds the object from hash
|
@@ -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,6 +22,8 @@ module MergeAccountingClient
|
|
22
22
|
# The phone number's type.
|
23
23
|
attr_accessor :type
|
24
24
|
|
25
|
+
attr_accessor :created_at
|
26
|
+
|
25
27
|
# This is the datetime that this object was last updated by Merge
|
26
28
|
attr_accessor :modified_at
|
27
29
|
|
@@ -30,6 +32,7 @@ module MergeAccountingClient
|
|
30
32
|
{
|
31
33
|
:'number' => :'number',
|
32
34
|
:'type' => :'type',
|
35
|
+
:'created_at' => :'created_at',
|
33
36
|
:'modified_at' => :'modified_at'
|
34
37
|
}
|
35
38
|
end
|
@@ -44,6 +47,7 @@ module MergeAccountingClient
|
|
44
47
|
{
|
45
48
|
:'number' => :'String',
|
46
49
|
:'type' => :'String',
|
50
|
+
:'created_at' => :'Time',
|
47
51
|
:'modified_at' => :'Time'
|
48
52
|
}
|
49
53
|
end
|
@@ -79,6 +83,10 @@ module MergeAccountingClient
|
|
79
83
|
self.type = attributes[:'type']
|
80
84
|
end
|
81
85
|
|
86
|
+
if attributes.key?(:'created_at')
|
87
|
+
self.created_at = attributes[:'created_at']
|
88
|
+
end
|
89
|
+
|
82
90
|
if attributes.key?(:'modified_at')
|
83
91
|
self.modified_at = attributes[:'modified_at']
|
84
92
|
end
|
@@ -104,6 +112,7 @@ module MergeAccountingClient
|
|
104
112
|
self.class == o.class &&
|
105
113
|
number == o.number &&
|
106
114
|
type == o.type &&
|
115
|
+
created_at == o.created_at &&
|
107
116
|
modified_at == o.modified_at
|
108
117
|
end
|
109
118
|
|
@@ -116,7 +125,7 @@ module MergeAccountingClient
|
|
116
125
|
# Calculates hash code according to all attributes.
|
117
126
|
# @return [Integer] Hash code
|
118
127
|
def hash
|
119
|
-
[number, type, modified_at].hash
|
128
|
+
[number, type, created_at, modified_at].hash
|
120
129
|
end
|
121
130
|
|
122
131
|
# Builds the object from hash
|
@@ -40,6 +40,8 @@ module MergeAccountingClient
|
|
40
40
|
# The address's zip code.
|
41
41
|
attr_accessor :zip_code
|
42
42
|
|
43
|
+
attr_accessor :created_at
|
44
|
+
|
43
45
|
# This is the datetime that this object was last updated by Merge
|
44
46
|
attr_accessor :modified_at
|
45
47
|
|
@@ -54,6 +56,7 @@ module MergeAccountingClient
|
|
54
56
|
:'country_subdivision' => :'country_subdivision',
|
55
57
|
:'country' => :'country',
|
56
58
|
:'zip_code' => :'zip_code',
|
59
|
+
:'created_at' => :'created_at',
|
57
60
|
:'modified_at' => :'modified_at'
|
58
61
|
}
|
59
62
|
end
|
@@ -74,6 +77,7 @@ module MergeAccountingClient
|
|
74
77
|
:'country_subdivision' => :'String',
|
75
78
|
:'country' => :'CountryEnum',
|
76
79
|
:'zip_code' => :'String',
|
80
|
+
:'created_at' => :'Time',
|
77
81
|
:'modified_at' => :'Time'
|
78
82
|
}
|
79
83
|
end
|
@@ -139,6 +143,10 @@ module MergeAccountingClient
|
|
139
143
|
self.zip_code = attributes[:'zip_code']
|
140
144
|
end
|
141
145
|
|
146
|
+
if attributes.key?(:'created_at')
|
147
|
+
self.created_at = attributes[:'created_at']
|
148
|
+
end
|
149
|
+
|
142
150
|
if attributes.key?(:'modified_at')
|
143
151
|
self.modified_at = attributes[:'modified_at']
|
144
152
|
end
|
@@ -170,6 +178,7 @@ module MergeAccountingClient
|
|
170
178
|
country_subdivision == o.country_subdivision &&
|
171
179
|
country == o.country &&
|
172
180
|
zip_code == o.zip_code &&
|
181
|
+
created_at == o.created_at &&
|
173
182
|
modified_at == o.modified_at
|
174
183
|
end
|
175
184
|
|
@@ -182,7 +191,7 @@ module MergeAccountingClient
|
|
182
191
|
# Calculates hash code according to all attributes.
|
183
192
|
# @return [Integer] Hash code
|
184
193
|
def hash
|
185
|
-
[type, street_1, street_2, city, state, country_subdivision, country, zip_code, modified_at].hash
|
194
|
+
[type, street_1, street_2, city, state, country_subdivision, country, zip_code, created_at, modified_at].hash
|
186
195
|
end
|
187
196
|
|
188
197
|
# Builds the object from hash
|