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.
- 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
@@ -0,0 +1,319 @@
|
|
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 PaymentLineItem Object ### Description The `PaymentLineItem` object is an applied-to-line on a `Payment` that can either be a `Invoice`, `CreditNote`, or `JournalEntry`. ### Usage Example `Payment` will have a field called `applied-to-lines` which will be an array of `PaymentLineItemInternalMappingSerializer` objects that can either be a `Invoice`, `CreditNote`, or `JournalEntry`.
|
18
|
+
class PaymentLineItemRequest
|
19
|
+
# The amount being applied to the transaction.
|
20
|
+
attr_accessor :applied_amount
|
21
|
+
|
22
|
+
# The date the payment portion is applied.
|
23
|
+
attr_accessor :applied_date
|
24
|
+
|
25
|
+
# The third-party API ID of the matching object.
|
26
|
+
attr_accessor :remote_id
|
27
|
+
|
28
|
+
# The Merge ID of the transaction the payment portion is being applied to.
|
29
|
+
attr_accessor :related_object_id
|
30
|
+
|
31
|
+
# The type of transaction the payment portion is being applied to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE.
|
32
|
+
attr_accessor :related_object_type
|
33
|
+
|
34
|
+
attr_accessor :integration_params
|
35
|
+
|
36
|
+
attr_accessor :linked_account_params
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'applied_amount' => :'applied_amount',
|
42
|
+
:'applied_date' => :'applied_date',
|
43
|
+
:'remote_id' => :'remote_id',
|
44
|
+
:'related_object_id' => :'related_object_id',
|
45
|
+
:'related_object_type' => :'related_object_type',
|
46
|
+
:'integration_params' => :'integration_params',
|
47
|
+
:'linked_account_params' => :'linked_account_params'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns all the JSON keys this model knows about
|
52
|
+
def self.acceptable_attributes
|
53
|
+
attribute_map.values
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'applied_amount' => :'String',
|
60
|
+
:'applied_date' => :'Time',
|
61
|
+
:'remote_id' => :'String',
|
62
|
+
:'related_object_id' => :'String',
|
63
|
+
:'related_object_type' => :'String',
|
64
|
+
:'integration_params' => :'Hash<String, Object>',
|
65
|
+
:'linked_account_params' => :'Hash<String, Object>'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# List of attributes with nullable: true
|
70
|
+
def self.openapi_nullable
|
71
|
+
Set.new([
|
72
|
+
:'applied_amount',
|
73
|
+
:'applied_date',
|
74
|
+
:'remote_id',
|
75
|
+
:'integration_params',
|
76
|
+
:'linked_account_params'
|
77
|
+
])
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initializes the object
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
def initialize(attributes = {})
|
83
|
+
if (!attributes.is_a?(Hash))
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::PaymentLineItemRequest` initialize method"
|
85
|
+
end
|
86
|
+
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
89
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::PaymentLineItemRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
91
|
+
end
|
92
|
+
h[k.to_sym] = v
|
93
|
+
}
|
94
|
+
|
95
|
+
if attributes.key?(:'applied_amount')
|
96
|
+
self.applied_amount = attributes[:'applied_amount']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'applied_date')
|
100
|
+
self.applied_date = attributes[:'applied_date']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'remote_id')
|
104
|
+
self.remote_id = attributes[:'remote_id']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'related_object_id')
|
108
|
+
self.related_object_id = attributes[:'related_object_id']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'related_object_type')
|
112
|
+
self.related_object_type = attributes[:'related_object_type']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'integration_params')
|
116
|
+
if (value = attributes[:'integration_params']).is_a?(Hash)
|
117
|
+
self.integration_params = value
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'linked_account_params')
|
122
|
+
if (value = attributes[:'linked_account_params']).is_a?(Hash)
|
123
|
+
self.linked_account_params = value
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
129
|
+
# @return Array for valid properties with the reasons
|
130
|
+
def list_invalid_properties
|
131
|
+
invalid_properties = Array.new
|
132
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
133
|
+
if !@applied_amount.nil? && @applied_amount.to_s !~ pattern
|
134
|
+
invalid_properties.push("invalid value for \"applied_amount\", must conform to the pattern #{pattern}.")
|
135
|
+
end
|
136
|
+
|
137
|
+
if !@related_object_type.nil? && @related_object_type.to_s.length < 1
|
138
|
+
invalid_properties.push('invalid value for "related_object_type", the character length must be great than or equal to 1.')
|
139
|
+
end
|
140
|
+
|
141
|
+
invalid_properties
|
142
|
+
end
|
143
|
+
|
144
|
+
# Check to see if the all the properties in the model are valid
|
145
|
+
# @return true if the model is valid
|
146
|
+
def valid?
|
147
|
+
return false if !@applied_amount.nil? && @applied_amount.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
148
|
+
return false if !@related_object_type.nil? && @related_object_type.to_s.length < 1
|
149
|
+
true
|
150
|
+
end
|
151
|
+
|
152
|
+
# Custom attribute writer method with validation
|
153
|
+
# @param [Object] applied_amount Value to be assigned
|
154
|
+
def applied_amount=(applied_amount)
|
155
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
156
|
+
if !applied_amount.nil? && applied_amount.to_s !~ pattern
|
157
|
+
fail ArgumentError, "invalid value for \"applied_amount\", must conform to the pattern #{pattern}."
|
158
|
+
end
|
159
|
+
|
160
|
+
@applied_amount = applied_amount
|
161
|
+
end
|
162
|
+
|
163
|
+
# Custom attribute writer method with validation
|
164
|
+
# @param [Object] related_object_type Value to be assigned
|
165
|
+
def related_object_type=(related_object_type)
|
166
|
+
if !related_object_type.nil? && related_object_type.to_s.length < 1
|
167
|
+
fail ArgumentError, 'invalid value for "related_object_type", the character length must be great than or equal to 1.'
|
168
|
+
end
|
169
|
+
|
170
|
+
@related_object_type = related_object_type
|
171
|
+
end
|
172
|
+
|
173
|
+
# Checks equality by comparing each attribute.
|
174
|
+
# @param [Object] Object to be compared
|
175
|
+
def ==(o)
|
176
|
+
return true if self.equal?(o)
|
177
|
+
self.class == o.class &&
|
178
|
+
applied_amount == o.applied_amount &&
|
179
|
+
applied_date == o.applied_date &&
|
180
|
+
remote_id == o.remote_id &&
|
181
|
+
related_object_id == o.related_object_id &&
|
182
|
+
related_object_type == o.related_object_type &&
|
183
|
+
integration_params == o.integration_params &&
|
184
|
+
linked_account_params == o.linked_account_params
|
185
|
+
end
|
186
|
+
|
187
|
+
# @see the `==` method
|
188
|
+
# @param [Object] Object to be compared
|
189
|
+
def eql?(o)
|
190
|
+
self == o
|
191
|
+
end
|
192
|
+
|
193
|
+
# Calculates hash code according to all attributes.
|
194
|
+
# @return [Integer] Hash code
|
195
|
+
def hash
|
196
|
+
[applied_amount, applied_date, remote_id, related_object_id, related_object_type, integration_params, linked_account_params].hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Builds the object from hash
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
201
|
+
# @return [Object] Returns the model itself
|
202
|
+
def self.build_from_hash(attributes)
|
203
|
+
new.build_from_hash(attributes)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Builds the object from hash
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
208
|
+
# @return [Object] Returns the model itself
|
209
|
+
def build_from_hash(attributes)
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
211
|
+
self.class.openapi_types.each_pair do |key, type|
|
212
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
213
|
+
self.send("#{key}=", nil)
|
214
|
+
elsif type =~ /\AArray<(.*)>/i
|
215
|
+
# check to ensure the input is an array given that the attribute
|
216
|
+
# is documented as an array but the input is not
|
217
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
218
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
219
|
+
end
|
220
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
221
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
self
|
226
|
+
end
|
227
|
+
|
228
|
+
# Deserializes the data based on type
|
229
|
+
# @param string type Data type
|
230
|
+
# @param string value Value to be deserialized
|
231
|
+
# @return [Object] Deserialized data
|
232
|
+
def _deserialize(type, value)
|
233
|
+
case type.to_sym
|
234
|
+
when :Time
|
235
|
+
Time.parse(value)
|
236
|
+
when :Date
|
237
|
+
Date.parse(value)
|
238
|
+
when :String
|
239
|
+
value
|
240
|
+
when :Integer
|
241
|
+
value.to_i
|
242
|
+
when :Float
|
243
|
+
value.to_f
|
244
|
+
when :Boolean
|
245
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
246
|
+
true
|
247
|
+
else
|
248
|
+
false
|
249
|
+
end
|
250
|
+
when :Object
|
251
|
+
# generic object (usually a Hash), return directly
|
252
|
+
value
|
253
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
254
|
+
inner_type = Regexp.last_match[:inner_type]
|
255
|
+
value.map { |v| _deserialize(inner_type, v) }
|
256
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
257
|
+
k_type = Regexp.last_match[:k_type]
|
258
|
+
v_type = Regexp.last_match[:v_type]
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each do |k, v|
|
261
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
262
|
+
end
|
263
|
+
end
|
264
|
+
else # model
|
265
|
+
# models (e.g. Pet) or oneOf
|
266
|
+
klass = MergeAccountingClient.const_get(type)
|
267
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
# Returns the string representation of the object
|
272
|
+
# @return [String] String presentation of the object
|
273
|
+
def to_s
|
274
|
+
to_hash.to_s
|
275
|
+
end
|
276
|
+
|
277
|
+
# to_body is an alias to to_hash (backward compatibility)
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
279
|
+
def to_body
|
280
|
+
to_hash
|
281
|
+
end
|
282
|
+
|
283
|
+
# Returns the object in the form of hash
|
284
|
+
# @return [Hash] Returns the object in the form of hash
|
285
|
+
def to_hash
|
286
|
+
hash = {}
|
287
|
+
self.class.attribute_map.each_pair do |attr, param|
|
288
|
+
value = self.send(attr)
|
289
|
+
if value.nil?
|
290
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
291
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
292
|
+
end
|
293
|
+
|
294
|
+
hash[param] = _to_hash(value)
|
295
|
+
end
|
296
|
+
hash
|
297
|
+
end
|
298
|
+
|
299
|
+
# Outputs non-array value in the form of hash
|
300
|
+
# For object, use to_hash. Otherwise, just return the value
|
301
|
+
# @param [Object] value Any valid value
|
302
|
+
# @return [Hash] Returns the value in the form of hash
|
303
|
+
def _to_hash(value)
|
304
|
+
if value.is_a?(Array)
|
305
|
+
value.compact.map { |v| _to_hash(v) }
|
306
|
+
elsif value.is_a?(Hash)
|
307
|
+
{}.tap do |hash|
|
308
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
309
|
+
end
|
310
|
+
elsif value.respond_to? :to_hash
|
311
|
+
value.to_hash
|
312
|
+
else
|
313
|
+
value
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
end
|
318
|
+
|
319
|
+
end
|
@@ -39,6 +39,12 @@ module MergeAccountingClient
|
|
39
39
|
|
40
40
|
attr_accessor :tracking_categories
|
41
41
|
|
42
|
+
# The accounting period that the Payment was generated in.
|
43
|
+
attr_accessor :accounting_period
|
44
|
+
|
45
|
+
# A list of “Payment Applied to Lines” objects.
|
46
|
+
attr_accessor :applied_to_lines
|
47
|
+
|
42
48
|
attr_accessor :integration_params
|
43
49
|
|
44
50
|
attr_accessor :linked_account_params
|
@@ -54,6 +60,8 @@ module MergeAccountingClient
|
|
54
60
|
:'company' => :'company',
|
55
61
|
:'total_amount' => :'total_amount',
|
56
62
|
:'tracking_categories' => :'tracking_categories',
|
63
|
+
:'accounting_period' => :'accounting_period',
|
64
|
+
:'applied_to_lines' => :'applied_to_lines',
|
57
65
|
:'integration_params' => :'integration_params',
|
58
66
|
:'linked_account_params' => :'linked_account_params'
|
59
67
|
}
|
@@ -75,6 +83,8 @@ module MergeAccountingClient
|
|
75
83
|
:'company' => :'String',
|
76
84
|
:'total_amount' => :'Float',
|
77
85
|
:'tracking_categories' => :'Array<String>',
|
86
|
+
:'accounting_period' => :'String',
|
87
|
+
:'applied_to_lines' => :'Array<PaymentLineItemRequest>',
|
78
88
|
:'integration_params' => :'Hash<String, Object>',
|
79
89
|
:'linked_account_params' => :'Hash<String, Object>'
|
80
90
|
}
|
@@ -90,6 +100,7 @@ module MergeAccountingClient
|
|
90
100
|
:'exchange_rate',
|
91
101
|
:'company',
|
92
102
|
:'total_amount',
|
103
|
+
:'accounting_period',
|
93
104
|
:'integration_params',
|
94
105
|
:'linked_account_params'
|
95
106
|
])
|
@@ -144,6 +155,16 @@ module MergeAccountingClient
|
|
144
155
|
end
|
145
156
|
end
|
146
157
|
|
158
|
+
if attributes.key?(:'accounting_period')
|
159
|
+
self.accounting_period = attributes[:'accounting_period']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'applied_to_lines')
|
163
|
+
if (value = attributes[:'applied_to_lines']).is_a?(Array)
|
164
|
+
self.applied_to_lines = value
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
147
168
|
if attributes.key?(:'integration_params')
|
148
169
|
if (value = attributes[:'integration_params']).is_a?(Hash)
|
149
170
|
self.integration_params = value
|
@@ -200,6 +221,8 @@ module MergeAccountingClient
|
|
200
221
|
company == o.company &&
|
201
222
|
total_amount == o.total_amount &&
|
202
223
|
tracking_categories == o.tracking_categories &&
|
224
|
+
accounting_period == o.accounting_period &&
|
225
|
+
applied_to_lines == o.applied_to_lines &&
|
203
226
|
integration_params == o.integration_params &&
|
204
227
|
linked_account_params == o.linked_account_params
|
205
228
|
end
|
@@ -213,7 +236,7 @@ module MergeAccountingClient
|
|
213
236
|
# Calculates hash code according to all attributes.
|
214
237
|
# @return [Integer] Hash code
|
215
238
|
def hash
|
216
|
-
[transaction_date, contact, account, currency, exchange_rate, company, total_amount, tracking_categories, integration_params, linked_account_params].hash
|
239
|
+
[transaction_date, contact, account, currency, exchange_rate, company, total_amount, tracking_categories, accounting_period, applied_to_lines, integration_params, linked_account_params].hash
|
217
240
|
end
|
218
241
|
|
219
242
|
# Builds the object from hash
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeAccountingClient
|
17
|
-
# # The PurchaseOrder Object ### Description
|
17
|
+
# # The PurchaseOrder Object ### Description A `PurchaseOrder` represents a request to purchase goods or services from a vendor. It outlines the details of the purchase, such as the items or services requested, quantities, prices, and delivery details. A `PurchaseOrder` is a crucial component of the procurement process, but does not typically result in any impact on the company’s general ledger. The general ledger is typically only affected when the `PurchaseOrder` is fulfilled as an *Accounts Payable* Invoice object. ### Usage Example Fetch from the `LIST PurchaseOrders` endpoint and view a company's purchase orders.
|
18
18
|
class PurchaseOrder
|
19
19
|
# The purchase order's status. * `DRAFT` - DRAFT * `SUBMITTED` - SUBMITTED * `AUTHORIZED` - AUTHORIZED * `BILLED` - BILLED * `DELETED` - DELETED
|
20
20
|
attr_accessor :status
|
@@ -22,6 +22,9 @@ module MergeAccountingClient
|
|
22
22
|
# The purchase order's issue date.
|
23
23
|
attr_accessor :issue_date
|
24
24
|
|
25
|
+
# The human-readable number of the purchase order.
|
26
|
+
attr_accessor :purchase_order_number
|
27
|
+
|
25
28
|
# The purchase order's delivery date.
|
26
29
|
attr_accessor :delivery_date
|
27
30
|
|
@@ -59,14 +62,19 @@ module MergeAccountingClient
|
|
59
62
|
# When the third party's purchase order note was updated.
|
60
63
|
attr_accessor :remote_updated_at
|
61
64
|
|
62
|
-
# Indicates whether or not this object has been deleted
|
65
|
+
# Indicates whether or not this object has been deleted in the third party platform.
|
63
66
|
attr_accessor :remote_was_deleted
|
64
67
|
|
68
|
+
# The accounting period that the PurchaseOrder was generated in.
|
69
|
+
attr_accessor :accounting_period
|
70
|
+
|
65
71
|
attr_accessor :id
|
66
72
|
|
67
73
|
# The third-party API ID of the matching object.
|
68
74
|
attr_accessor :remote_id
|
69
75
|
|
76
|
+
attr_accessor :created_at
|
77
|
+
|
70
78
|
# This is the datetime that this object was last updated by Merge
|
71
79
|
attr_accessor :modified_at
|
72
80
|
|
@@ -79,6 +87,7 @@ module MergeAccountingClient
|
|
79
87
|
{
|
80
88
|
:'status' => :'status',
|
81
89
|
:'issue_date' => :'issue_date',
|
90
|
+
:'purchase_order_number' => :'purchase_order_number',
|
82
91
|
:'delivery_date' => :'delivery_date',
|
83
92
|
:'delivery_address' => :'delivery_address',
|
84
93
|
:'customer' => :'customer',
|
@@ -93,8 +102,10 @@ module MergeAccountingClient
|
|
93
102
|
:'remote_created_at' => :'remote_created_at',
|
94
103
|
:'remote_updated_at' => :'remote_updated_at',
|
95
104
|
:'remote_was_deleted' => :'remote_was_deleted',
|
105
|
+
:'accounting_period' => :'accounting_period',
|
96
106
|
:'id' => :'id',
|
97
107
|
:'remote_id' => :'remote_id',
|
108
|
+
:'created_at' => :'created_at',
|
98
109
|
:'modified_at' => :'modified_at',
|
99
110
|
:'field_mappings' => :'field_mappings',
|
100
111
|
:'remote_data' => :'remote_data'
|
@@ -111,6 +122,7 @@ module MergeAccountingClient
|
|
111
122
|
{
|
112
123
|
:'status' => :'PurchaseOrderStatusEnum',
|
113
124
|
:'issue_date' => :'Time',
|
125
|
+
:'purchase_order_number' => :'String',
|
114
126
|
:'delivery_date' => :'Time',
|
115
127
|
:'delivery_address' => :'String',
|
116
128
|
:'customer' => :'String',
|
@@ -125,8 +137,10 @@ module MergeAccountingClient
|
|
125
137
|
:'remote_created_at' => :'Time',
|
126
138
|
:'remote_updated_at' => :'Time',
|
127
139
|
:'remote_was_deleted' => :'Boolean',
|
140
|
+
:'accounting_period' => :'String',
|
128
141
|
:'id' => :'String',
|
129
142
|
:'remote_id' => :'String',
|
143
|
+
:'created_at' => :'Time',
|
130
144
|
:'modified_at' => :'Time',
|
131
145
|
:'field_mappings' => :'Hash<String, Object>',
|
132
146
|
:'remote_data' => :'Array<RemoteData>'
|
@@ -138,6 +152,7 @@ module MergeAccountingClient
|
|
138
152
|
Set.new([
|
139
153
|
:'status',
|
140
154
|
:'issue_date',
|
155
|
+
:'purchase_order_number',
|
141
156
|
:'delivery_date',
|
142
157
|
:'delivery_address',
|
143
158
|
:'customer',
|
@@ -149,6 +164,7 @@ module MergeAccountingClient
|
|
149
164
|
:'exchange_rate',
|
150
165
|
:'remote_created_at',
|
151
166
|
:'remote_updated_at',
|
167
|
+
:'accounting_period',
|
152
168
|
:'remote_id',
|
153
169
|
:'field_mappings',
|
154
170
|
:'remote_data'
|
@@ -178,6 +194,10 @@ module MergeAccountingClient
|
|
178
194
|
self.issue_date = attributes[:'issue_date']
|
179
195
|
end
|
180
196
|
|
197
|
+
if attributes.key?(:'purchase_order_number')
|
198
|
+
self.purchase_order_number = attributes[:'purchase_order_number']
|
199
|
+
end
|
200
|
+
|
181
201
|
if attributes.key?(:'delivery_date')
|
182
202
|
self.delivery_date = attributes[:'delivery_date']
|
183
203
|
end
|
@@ -238,6 +258,10 @@ module MergeAccountingClient
|
|
238
258
|
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
239
259
|
end
|
240
260
|
|
261
|
+
if attributes.key?(:'accounting_period')
|
262
|
+
self.accounting_period = attributes[:'accounting_period']
|
263
|
+
end
|
264
|
+
|
241
265
|
if attributes.key?(:'id')
|
242
266
|
self.id = attributes[:'id']
|
243
267
|
end
|
@@ -246,6 +270,10 @@ module MergeAccountingClient
|
|
246
270
|
self.remote_id = attributes[:'remote_id']
|
247
271
|
end
|
248
272
|
|
273
|
+
if attributes.key?(:'created_at')
|
274
|
+
self.created_at = attributes[:'created_at']
|
275
|
+
end
|
276
|
+
|
249
277
|
if attributes.key?(:'modified_at')
|
250
278
|
self.modified_at = attributes[:'modified_at']
|
251
279
|
end
|
@@ -267,6 +295,10 @@ module MergeAccountingClient
|
|
267
295
|
# @return Array for valid properties with the reasons
|
268
296
|
def list_invalid_properties
|
269
297
|
invalid_properties = Array.new
|
298
|
+
if !@purchase_order_number.nil? && @purchase_order_number.to_s.length > 100
|
299
|
+
invalid_properties.push('invalid value for "purchase_order_number", the character length must be smaller than or equal to 100.')
|
300
|
+
end
|
301
|
+
|
270
302
|
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
271
303
|
if !@exchange_rate.nil? && @exchange_rate.to_s !~ pattern
|
272
304
|
invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
|
@@ -278,10 +310,21 @@ module MergeAccountingClient
|
|
278
310
|
# Check to see if the all the properties in the model are valid
|
279
311
|
# @return true if the model is valid
|
280
312
|
def valid?
|
313
|
+
return false if !@purchase_order_number.nil? && @purchase_order_number.to_s.length > 100
|
281
314
|
return false if !@exchange_rate.nil? && @exchange_rate.to_s !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
282
315
|
true
|
283
316
|
end
|
284
317
|
|
318
|
+
# Custom attribute writer method with validation
|
319
|
+
# @param [Object] purchase_order_number Value to be assigned
|
320
|
+
def purchase_order_number=(purchase_order_number)
|
321
|
+
if !purchase_order_number.nil? && purchase_order_number.to_s.length > 100
|
322
|
+
fail ArgumentError, 'invalid value for "purchase_order_number", the character length must be smaller than or equal to 100.'
|
323
|
+
end
|
324
|
+
|
325
|
+
@purchase_order_number = purchase_order_number
|
326
|
+
end
|
327
|
+
|
285
328
|
# Custom attribute writer method with validation
|
286
329
|
# @param [Object] exchange_rate Value to be assigned
|
287
330
|
def exchange_rate=(exchange_rate)
|
@@ -300,6 +343,7 @@ module MergeAccountingClient
|
|
300
343
|
self.class == o.class &&
|
301
344
|
status == o.status &&
|
302
345
|
issue_date == o.issue_date &&
|
346
|
+
purchase_order_number == o.purchase_order_number &&
|
303
347
|
delivery_date == o.delivery_date &&
|
304
348
|
delivery_address == o.delivery_address &&
|
305
349
|
customer == o.customer &&
|
@@ -314,8 +358,10 @@ module MergeAccountingClient
|
|
314
358
|
remote_created_at == o.remote_created_at &&
|
315
359
|
remote_updated_at == o.remote_updated_at &&
|
316
360
|
remote_was_deleted == o.remote_was_deleted &&
|
361
|
+
accounting_period == o.accounting_period &&
|
317
362
|
id == o.id &&
|
318
363
|
remote_id == o.remote_id &&
|
364
|
+
created_at == o.created_at &&
|
319
365
|
modified_at == o.modified_at &&
|
320
366
|
field_mappings == o.field_mappings &&
|
321
367
|
remote_data == o.remote_data
|
@@ -330,7 +376,7 @@ module MergeAccountingClient
|
|
330
376
|
# Calculates hash code according to all attributes.
|
331
377
|
# @return [Integer] Hash code
|
332
378
|
def hash
|
333
|
-
[status, issue_date, delivery_date, delivery_address, customer, vendor, memo, company, total_amount, currency, exchange_rate, line_items, tracking_categories, remote_created_at, remote_updated_at, remote_was_deleted, id, remote_id, modified_at, field_mappings, remote_data].hash
|
379
|
+
[status, issue_date, purchase_order_number, delivery_date, delivery_address, customer, vendor, memo, company, total_amount, currency, exchange_rate, line_items, tracking_categories, remote_created_at, remote_updated_at, remote_was_deleted, accounting_period, id, remote_id, created_at, modified_at, field_mappings, remote_data].hash
|
334
380
|
end
|
335
381
|
|
336
382
|
# Builds the object from hash
|
@@ -54,6 +54,13 @@ module MergeAccountingClient
|
|
54
54
|
# The company the purchase order line item belongs to.
|
55
55
|
attr_accessor :company
|
56
56
|
|
57
|
+
# Indicates whether or not this object has been deleted in the third party platform.
|
58
|
+
attr_accessor :remote_was_deleted
|
59
|
+
|
60
|
+
attr_accessor :id
|
61
|
+
|
62
|
+
attr_accessor :created_at
|
63
|
+
|
57
64
|
# This is the datetime that this object was last updated by Merge
|
58
65
|
attr_accessor :modified_at
|
59
66
|
|
@@ -73,6 +80,9 @@ module MergeAccountingClient
|
|
73
80
|
:'currency' => :'currency',
|
74
81
|
:'exchange_rate' => :'exchange_rate',
|
75
82
|
:'company' => :'company',
|
83
|
+
:'remote_was_deleted' => :'remote_was_deleted',
|
84
|
+
:'id' => :'id',
|
85
|
+
:'created_at' => :'created_at',
|
76
86
|
:'modified_at' => :'modified_at'
|
77
87
|
}
|
78
88
|
end
|
@@ -98,6 +108,9 @@ module MergeAccountingClient
|
|
98
108
|
:'currency' => :'CurrencyEnum',
|
99
109
|
:'exchange_rate' => :'String',
|
100
110
|
:'company' => :'String',
|
111
|
+
:'remote_was_deleted' => :'Boolean',
|
112
|
+
:'id' => :'String',
|
113
|
+
:'created_at' => :'Time',
|
101
114
|
:'modified_at' => :'Time'
|
102
115
|
}
|
103
116
|
end
|
@@ -189,6 +202,18 @@ module MergeAccountingClient
|
|
189
202
|
self.company = attributes[:'company']
|
190
203
|
end
|
191
204
|
|
205
|
+
if attributes.key?(:'remote_was_deleted')
|
206
|
+
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'id')
|
210
|
+
self.id = attributes[:'id']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'created_at')
|
214
|
+
self.created_at = attributes[:'created_at']
|
215
|
+
end
|
216
|
+
|
192
217
|
if attributes.key?(:'modified_at')
|
193
218
|
self.modified_at = attributes[:'modified_at']
|
194
219
|
end
|
@@ -281,6 +306,9 @@ module MergeAccountingClient
|
|
281
306
|
currency == o.currency &&
|
282
307
|
exchange_rate == o.exchange_rate &&
|
283
308
|
company == o.company &&
|
309
|
+
remote_was_deleted == o.remote_was_deleted &&
|
310
|
+
id == o.id &&
|
311
|
+
created_at == o.created_at &&
|
284
312
|
modified_at == o.modified_at
|
285
313
|
end
|
286
314
|
|
@@ -293,7 +321,7 @@ module MergeAccountingClient
|
|
293
321
|
# Calculates hash code according to all attributes.
|
294
322
|
# @return [Integer] Hash code
|
295
323
|
def hash
|
296
|
-
[remote_id, description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company, modified_at].hash
|
324
|
+
[remote_id, description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company, remote_was_deleted, id, created_at, modified_at].hash
|
297
325
|
end
|
298
326
|
|
299
327
|
# Builds the object from hash
|