merge_accounting_client 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -5
- data/docs/Account.md +12 -8
- data/docs/AccountEndpointRequest.md +18 -0
- data/docs/AccountIntegration.md +1 -1
- data/docs/AccountRequest.md +40 -0
- data/docs/AccountResponse.md +24 -0
- data/docs/AccountingAttachment.md +7 -3
- data/docs/AccountingAttachmentEndpointRequest.md +18 -0
- data/docs/AccountingAttachmentRequest.md +26 -0
- data/docs/AccountingAttachmentResponse.md +24 -0
- data/docs/AccountingPhoneNumberRequest.md +24 -0
- data/docs/AccountsApi.md +163 -5
- data/docs/Address.md +5 -3
- data/docs/AddressesApi.md +4 -2
- data/docs/AttachmentsApi.md +154 -0
- data/docs/BalanceSheet.md +11 -7
- data/docs/BalanceSheetsApi.md +2 -0
- data/docs/CashFlowStatement.md +11 -7
- data/docs/CashFlowStatementsApi.md +2 -0
- data/docs/CommonModelScopeData.md +20 -0
- data/docs/CommonModelScopes.md +20 -0
- data/docs/CommonModelScopesApi.md +157 -0
- data/docs/CommonModelScopesBodyRequest.md +22 -0
- data/docs/CommonModelScopesDisabledModels.md +26 -0
- data/docs/CommonModelScopesDisabledModelsEnabledActionsEnum.md +15 -0
- data/docs/CommonModelScopesPostInnerDeserializerRequest.md +22 -0
- data/docs/CommonModelScopesUpdateSerializer.md +18 -0
- data/docs/CompanyInfo.md +6 -4
- data/docs/CompanyInfoApi.md +0 -4
- data/docs/ConditionSchema.md +30 -0
- data/docs/ConditionTypeEnum.md +15 -0
- data/docs/Contact.md +8 -4
- data/docs/ContactEndpointRequest.md +18 -0
- data/docs/ContactRequest.md +40 -0
- data/docs/ContactResponse.md +24 -0
- data/docs/ContactsApi.md +163 -9
- data/docs/CreditNote.md +12 -8
- data/docs/CreditNoteLineItem.md +7 -3
- data/docs/CreditNotesApi.md +15 -9
- data/docs/DataPassthroughRequest.md +1 -1
- data/docs/EnabledActionsEnum.md +15 -0
- data/docs/EndUserDetailsRequest.md +5 -3
- data/docs/Expense.md +18 -12
- data/docs/ExpenseEndpointRequest.md +18 -0
- data/docs/ExpenseLine.md +11 -5
- data/docs/ExpenseLineRequest.md +38 -0
- data/docs/ExpenseRequest.md +38 -0
- data/docs/ExpenseResponse.md +24 -0
- data/docs/ExpensesApi.md +159 -5
- data/docs/IncomeStatement.md +15 -11
- data/docs/IncomeStatementsApi.md +2 -0
- data/docs/Invoice.md +21 -15
- data/docs/InvoiceLineItem.md +15 -5
- data/docs/InvoiceLineItemRequest.md +15 -3
- data/docs/InvoiceRequest.md +17 -11
- data/docs/InvoicesApi.md +16 -10
- data/docs/Issue.md +9 -7
- data/docs/IssuesApi.md +2 -2
- data/docs/Item.md +11 -7
- data/docs/ItemsApi.md +11 -9
- data/docs/JournalEntriesApi.md +7 -5
- data/docs/JournalEntry.md +18 -10
- data/docs/JournalEntryRequest.md +14 -8
- data/docs/JournalLine.md +6 -4
- data/docs/JournalLineRequest.md +10 -4
- data/docs/LinkToken.md +1 -1
- data/docs/LinkedAccountCondition.md +28 -0
- data/docs/LinkedAccountConditionRequest.md +22 -0
- data/docs/LinkedAccountSelectiveSyncConfiguration.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationListRequest.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationRequest.md +18 -0
- data/docs/LinkedAccountsApi.md +2 -2
- data/docs/MetaResponse.md +2 -0
- data/docs/MultipartFormFieldRequest.md +1 -1
- data/docs/OperatorSchema.md +20 -0
- data/docs/PaginatedConditionSchemaList.md +22 -0
- data/docs/Payment.md +14 -6
- data/docs/PaymentEndpointRequest.md +18 -0
- data/docs/PaymentRequest.md +34 -0
- data/docs/PaymentResponse.md +24 -0
- data/docs/PaymentsApi.md +159 -5
- data/docs/PostingStatusEnum.md +15 -0
- data/docs/PurchaseOrder.md +19 -13
- data/docs/PurchaseOrderEndpointRequest.md +18 -0
- data/docs/PurchaseOrderLineItem.md +10 -2
- data/docs/PurchaseOrderLineItemRequest.md +44 -0
- data/docs/PurchaseOrderRequest.md +44 -0
- data/docs/PurchaseOrderResponse.md +24 -0
- data/docs/PurchaseOrdersApi.md +167 -9
- data/docs/RemoteDataRequest.md +1 -1
- data/docs/ReportItem.md +3 -1
- data/docs/SelectiveSyncApi.md +233 -0
- data/docs/SelectiveSyncConfigurationsUsageEnum.md +15 -0
- data/docs/SyncStatus.md +5 -3
- data/docs/TaxRate.md +11 -7
- data/docs/TaxRatesApi.md +2 -0
- data/docs/TrackingCategoriesApi.md +11 -5
- data/docs/TrackingCategory.md +14 -8
- data/docs/Transaction.md +20 -14
- data/docs/TransactionLineItem.md +9 -3
- data/docs/TransactionsApi.md +7 -5
- data/docs/VendorCredit.md +13 -7
- data/docs/VendorCreditLine.md +6 -2
- data/docs/VendorCreditsApi.md +7 -5
- data/lib/merge_accounting_client/api/accounts_api.rb +159 -4
- data/lib/merge_accounting_client/api/addresses_api.rb +9 -2
- data/lib/merge_accounting_client/api/attachments_api.rb +141 -0
- data/lib/merge_accounting_client/api/balance_sheets_api.rb +3 -0
- data/lib/merge_accounting_client/api/cash_flow_statements_api.rb +3 -0
- data/lib/merge_accounting_client/api/common_model_scopes_api.rb +146 -0
- data/lib/merge_accounting_client/api/company_info_api.rb +0 -14
- data/lib/merge_accounting_client/api/contacts_api.rb +159 -18
- data/lib/merge_accounting_client/api/credit_notes_api.rb +27 -18
- data/lib/merge_accounting_client/api/expenses_api.rb +147 -14
- data/lib/merge_accounting_client/api/income_statements_api.rb +3 -0
- data/lib/merge_accounting_client/api/invoices_api.rb +29 -20
- data/lib/merge_accounting_client/api/issues_api.rb +2 -2
- data/lib/merge_accounting_client/api/items_api.rb +21 -18
- data/lib/merge_accounting_client/api/journal_entries_api.rb +9 -14
- data/lib/merge_accounting_client/api/linked_accounts_api.rb +3 -3
- data/lib/merge_accounting_client/api/payments_api.rb +147 -14
- data/lib/merge_accounting_client/api/purchase_orders_api.rb +165 -18
- data/lib/merge_accounting_client/api/selective_sync_api.rb +225 -0
- data/lib/merge_accounting_client/api/tax_rates_api.rb +3 -0
- data/lib/merge_accounting_client/api/tracking_categories_api.rb +21 -4
- data/lib/merge_accounting_client/api/transactions_api.rb +9 -14
- data/lib/merge_accounting_client/api/vendor_credits_api.rb +9 -14
- data/lib/merge_accounting_client/api_client.rb +0 -3
- data/lib/merge_accounting_client/models/account.rb +45 -21
- data/lib/merge_accounting_client/models/account_details_and_actions_status_enum.rb +1 -1
- data/lib/merge_accounting_client/models/account_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/account_integration.rb +1 -1
- data/lib/merge_accounting_client/models/account_request.rb +344 -0
- data/lib/merge_accounting_client/models/account_response.rb +266 -0
- data/lib/merge_accounting_client/models/account_status_enum.rb +1 -1
- data/lib/merge_accounting_client/models/accounting_attachment.rb +39 -16
- data/lib/merge_accounting_client/models/accounting_attachment_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/accounting_attachment_request.rb +282 -0
- data/lib/merge_accounting_client/models/accounting_attachment_response.rb +266 -0
- data/lib/merge_accounting_client/models/accounting_phone_number_request.rb +256 -0
- data/lib/merge_accounting_client/models/address.rb +16 -5
- data/lib/merge_accounting_client/models/address_type_enum.rb +1 -1
- data/lib/merge_accounting_client/models/balance_sheet.rb +41 -18
- data/lib/merge_accounting_client/models/cash_flow_statement.rb +41 -18
- data/lib/merge_accounting_client/models/categories_enum.rb +4 -2
- data/lib/merge_accounting_client/models/category_enum.rb +4 -2
- data/lib/merge_accounting_client/models/category_type_enum.rb +1 -1
- data/lib/merge_accounting_client/models/classification_enum.rb +1 -1
- data/lib/merge_accounting_client/models/common_model_scope_data.rb +234 -0
- data/lib/merge_accounting_client/models/common_model_scopes.rb +234 -0
- data/lib/merge_accounting_client/models/common_model_scopes_body_request.rb +274 -0
- data/lib/merge_accounting_client/models/common_model_scopes_disabled_models.rb +283 -0
- data/lib/merge_accounting_client/models/common_model_scopes_disabled_models_enabled_actions_enum.rb +45 -0
- data/lib/merge_accounting_client/models/common_model_scopes_post_inner_deserializer_request.rb +274 -0
- data/lib/merge_accounting_client/models/common_model_scopes_update_serializer.rb +226 -0
- data/lib/merge_accounting_client/models/company_info.rb +29 -17
- data/lib/merge_accounting_client/models/condition_schema.rb +298 -0
- data/lib/merge_accounting_client/models/condition_type_enum.rb +50 -0
- data/lib/merge_accounting_client/models/contact.rb +41 -18
- data/lib/merge_accounting_client/models/contact_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/contact_request.rb +346 -0
- data/lib/merge_accounting_client/models/contact_response.rb +266 -0
- data/lib/merge_accounting_client/models/country_enum.rb +1 -1
- data/lib/merge_accounting_client/models/credit_note.rb +43 -20
- data/lib/merge_accounting_client/models/credit_note_line_item.rb +40 -12
- data/lib/merge_accounting_client/models/credit_note_status_enum.rb +1 -1
- data/lib/merge_accounting_client/models/currency_enum.rb +1 -1
- data/lib/merge_accounting_client/models/data_passthrough_request.rb +2 -1
- data/lib/merge_accounting_client/models/enabled_actions_enum.rb +45 -0
- data/lib/merge_accounting_client/models/encoding_enum.rb +1 -1
- data/lib/merge_accounting_client/models/end_user_details_request.rb +20 -7
- data/lib/merge_accounting_client/models/expense.rb +91 -38
- data/lib/merge_accounting_client/models/expense_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/expense_line.rb +51 -17
- data/lib/merge_accounting_client/models/expense_line_request.rb +332 -0
- data/lib/merge_accounting_client/models/expense_request.rb +350 -0
- data/lib/merge_accounting_client/models/expense_response.rb +266 -0
- data/lib/merge_accounting_client/models/income_statement.rb +44 -21
- data/lib/merge_accounting_client/models/invoice.rb +94 -42
- data/lib/merge_accounting_client/models/invoice_line_item.rb +99 -26
- data/lib/merge_accounting_client/models/invoice_line_item_request.rb +102 -17
- data/lib/merge_accounting_client/models/invoice_request.rb +85 -32
- data/lib/merge_accounting_client/models/invoice_type_enum.rb +1 -1
- data/lib/merge_accounting_client/models/issue.rb +16 -5
- data/lib/merge_accounting_client/models/item.rb +44 -19
- data/lib/merge_accounting_client/models/journal_entry.rb +100 -38
- data/lib/merge_accounting_client/models/journal_entry_request.rb +92 -40
- data/lib/merge_accounting_client/models/journal_line.rb +28 -17
- data/lib/merge_accounting_client/models/journal_line_request.rb +52 -17
- data/lib/merge_accounting_client/models/link_token.rb +0 -5
- data/lib/merge_accounting_client/models/linked_account_condition.rb +282 -0
- data/lib/merge_accounting_client/models/linked_account_condition_request.rb +269 -0
- data/lib/merge_accounting_client/models/linked_account_selective_sync_configuration.rb +221 -0
- data/lib/merge_accounting_client/models/linked_account_selective_sync_configuration_list_request.rb +226 -0
- data/lib/merge_accounting_client/models/linked_account_selective_sync_configuration_request.rb +226 -0
- data/lib/merge_accounting_client/models/meta_response.rb +13 -2
- data/lib/merge_accounting_client/models/method_enum.rb +1 -1
- data/lib/merge_accounting_client/models/multipart_form_field_request.rb +1 -1
- data/lib/merge_accounting_client/models/operator_schema.rb +229 -0
- data/lib/merge_accounting_client/models/paginated_condition_schema_list.rb +240 -0
- data/lib/merge_accounting_client/models/payment.rb +82 -18
- data/lib/merge_accounting_client/models/payment_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/payment_request.rb +328 -0
- data/lib/merge_accounting_client/models/payment_response.rb +266 -0
- data/lib/merge_accounting_client/models/posting_status_enum.rb +45 -0
- data/lib/merge_accounting_client/models/purchase_order.rb +92 -41
- data/lib/merge_accounting_client/models/purchase_order_endpoint_request.rb +223 -0
- data/lib/merge_accounting_client/models/purchase_order_line_item.rb +79 -12
- data/lib/merge_accounting_client/models/purchase_order_line_item_request.rb +422 -0
- data/lib/merge_accounting_client/models/purchase_order_request.rb +383 -0
- data/lib/merge_accounting_client/models/purchase_order_response.rb +266 -0
- data/lib/merge_accounting_client/models/purchase_order_status_enum.rb +1 -1
- data/lib/merge_accounting_client/models/remote_data.rb +1 -1
- data/lib/merge_accounting_client/models/remote_data_request.rb +1 -1
- data/lib/merge_accounting_client/models/remote_response.rb +3 -6
- data/lib/merge_accounting_client/models/report_item.rb +15 -4
- data/lib/merge_accounting_client/models/request_format_enum.rb +1 -1
- data/lib/merge_accounting_client/models/response_type_enum.rb +1 -1
- data/lib/merge_accounting_client/models/selective_sync_configurations_usage_enum.rb +45 -0
- data/lib/merge_accounting_client/models/state_enum.rb +1 -1
- data/lib/merge_accounting_client/models/status7d1_enum.rb +1 -1
- data/lib/merge_accounting_client/models/sync_status.rb +13 -4
- data/lib/merge_accounting_client/models/sync_status_status_enum.rb +1 -1
- data/lib/merge_accounting_client/models/tax_rate.rb +59 -36
- data/lib/merge_accounting_client/models/tracking_category.rb +72 -38
- data/lib/merge_accounting_client/models/transaction.rb +97 -46
- data/lib/merge_accounting_client/models/transaction_line_item.rb +75 -19
- data/lib/merge_accounting_client/models/vendor_credit.rb +70 -18
- data/lib/merge_accounting_client/models/vendor_credit_line.rb +34 -6
- data/lib/merge_accounting_client/version.rb +1 -1
- data/lib/merge_accounting_client.rb +42 -1
- data/spec/api/accounts_api_spec.rb +30 -2
- data/spec/api/addresses_api_spec.rb +2 -1
- data/spec/api/attachments_api_spec.rb +26 -0
- data/spec/api/balance_sheets_api_spec.rb +1 -0
- data/spec/api/cash_flow_statements_api_spec.rb +1 -0
- data/spec/api/common_model_scopes_api_spec.rb +58 -0
- data/spec/api/company_info_api_spec.rb +0 -2
- data/spec/api/contacts_api_spec.rb +30 -4
- data/spec/api/credit_notes_api_spec.rb +7 -4
- data/spec/api/expenses_api_spec.rb +28 -2
- data/spec/api/income_statements_api_spec.rb +1 -0
- data/spec/api/invoices_api_spec.rb +8 -5
- data/spec/api/issues_api_spec.rb +1 -1
- data/spec/api/items_api_spec.rb +5 -4
- data/spec/api/journal_entries_api_spec.rb +3 -2
- data/spec/api/linked_accounts_api_spec.rb +1 -1
- data/spec/api/payments_api_spec.rb +28 -2
- data/spec/api/purchase_orders_api_spec.rb +32 -4
- data/spec/api/selective_sync_api_spec.rb +72 -0
- data/spec/api/tax_rates_api_spec.rb +1 -0
- data/spec/api/tracking_categories_api_spec.rb +5 -2
- data/spec/api/transactions_api_spec.rb +3 -2
- data/spec/api/vendor_credits_api_spec.rb +3 -2
- data/spec/models/account_endpoint_request_spec.rb +34 -0
- data/spec/models/account_request_spec.rb +100 -0
- data/spec/models/account_response_spec.rb +52 -0
- data/spec/models/account_spec.rb +18 -6
- data/spec/models/accounting_attachment_endpoint_request_spec.rb +34 -0
- data/spec/models/accounting_attachment_request_spec.rb +58 -0
- data/spec/models/accounting_attachment_response_spec.rb +52 -0
- data/spec/models/accounting_attachment_spec.rb +15 -3
- data/spec/models/accounting_phone_number_request_spec.rb +52 -0
- data/spec/models/address_spec.rb +6 -0
- data/spec/models/balance_sheet_spec.rb +15 -3
- data/spec/models/cash_flow_statement_spec.rb +15 -3
- data/spec/models/common_model_scope_data_spec.rb +40 -0
- data/spec/models/common_model_scopes_body_request_spec.rb +46 -0
- data/spec/models/common_model_scopes_disabled_models_enabled_actions_enum_spec.rb +28 -0
- data/spec/models/common_model_scopes_disabled_models_spec.rb +58 -0
- data/spec/models/common_model_scopes_post_inner_deserializer_request_spec.rb +46 -0
- data/spec/models/common_model_scopes_spec.rb +40 -0
- data/spec/models/common_model_scopes_update_serializer_spec.rb +34 -0
- data/spec/models/company_info_spec.rb +12 -6
- data/spec/models/condition_schema_spec.rb +70 -0
- data/spec/models/condition_type_enum_spec.rb +28 -0
- data/spec/models/contact_endpoint_request_spec.rb +34 -0
- data/spec/models/contact_request_spec.rb +100 -0
- data/spec/models/contact_response_spec.rb +52 -0
- data/spec/models/contact_spec.rb +18 -6
- data/spec/models/credit_note_line_item_spec.rb +12 -0
- data/spec/models/credit_note_spec.rb +17 -5
- data/spec/models/enabled_actions_enum_spec.rb +28 -0
- data/spec/models/end_user_details_request_spec.rb +6 -0
- data/spec/models/expense_endpoint_request_spec.rb +34 -0
- data/spec/models/expense_line_request_spec.rb +94 -0
- data/spec/models/expense_line_spec.rb +22 -4
- data/spec/models/expense_request_spec.rb +94 -0
- data/spec/models/expense_response_spec.rb +52 -0
- data/spec/models/expense_spec.rb +30 -12
- data/spec/models/income_statement_spec.rb +15 -3
- data/spec/models/invoice_line_item_request_spec.rb +41 -5
- data/spec/models/invoice_line_item_spec.rb +36 -6
- data/spec/models/invoice_request_spec.rb +26 -8
- data/spec/models/invoice_spec.rb +34 -16
- data/spec/models/issue_spec.rb +6 -0
- data/spec/models/item_spec.rb +18 -6
- data/spec/models/journal_entry_request_spec.rb +25 -7
- data/spec/models/journal_entry_spec.rb +35 -11
- data/spec/models/journal_line_request_spec.rb +22 -4
- data/spec/models/journal_line_spec.rb +10 -4
- data/spec/models/linked_account_condition_request_spec.rb +46 -0
- data/spec/models/linked_account_condition_spec.rb +64 -0
- data/spec/models/linked_account_selective_sync_configuration_list_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_spec.rb +34 -0
- data/spec/models/meta_response_spec.rb +6 -0
- data/spec/models/operator_schema_spec.rb +40 -0
- data/spec/models/paginated_condition_schema_list_spec.rb +46 -0
- data/spec/models/payment_endpoint_request_spec.rb +34 -0
- data/spec/models/payment_request_spec.rb +82 -0
- data/spec/models/payment_response_spec.rb +52 -0
- data/spec/models/payment_spec.rb +28 -4
- data/spec/models/posting_status_enum_spec.rb +28 -0
- data/spec/models/purchase_order_endpoint_request_spec.rb +34 -0
- data/spec/models/purchase_order_line_item_request_spec.rb +112 -0
- data/spec/models/purchase_order_line_item_spec.rb +24 -0
- data/spec/models/purchase_order_request_spec.rb +112 -0
- data/spec/models/purchase_order_response_spec.rb +52 -0
- data/spec/models/purchase_order_spec.rb +34 -16
- data/spec/models/report_item_spec.rb +6 -0
- data/spec/models/selective_sync_configurations_usage_enum_spec.rb +28 -0
- data/spec/models/sync_status_spec.rb +6 -0
- data/spec/models/tax_rate_spec.rb +19 -7
- data/spec/models/tracking_category_spec.rb +25 -7
- data/spec/models/transaction_line_item_spec.rb +19 -1
- data/spec/models/transaction_spec.rb +30 -12
- data/spec/models/vendor_credit_line_spec.rb +12 -0
- data/spec/models/vendor_credit_spec.rb +24 -6
- metadata +283 -115
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module MergeAccountingClient
|
17
17
|
# # The PurchaseOrderLineItem Object ### Description The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. ### Usage Example Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders.
|
18
18
|
class PurchaseOrderLineItem
|
19
|
-
#
|
19
|
+
# A description of the good being purchased.
|
20
20
|
attr_accessor :description
|
21
21
|
|
22
22
|
# The line item's unit price.
|
@@ -33,12 +33,24 @@ module MergeAccountingClient
|
|
33
33
|
# The purchase order line item's associated tracking category.
|
34
34
|
attr_accessor :tracking_category
|
35
35
|
|
36
|
+
# The purchase order line item's associated tracking categories.
|
37
|
+
attr_accessor :tracking_categories
|
38
|
+
|
36
39
|
# The purchase order line item's tax amount.
|
37
40
|
attr_accessor :tax_amount
|
38
41
|
|
39
42
|
# The purchase order line item's total amount.
|
40
43
|
attr_accessor :total_line_amount
|
41
44
|
|
45
|
+
# The purchase order line item's currency. * `XUA` - ADB Unit of Account * `AFN` - Afghan Afghani * `AFA` - Afghan Afghani (1927–2002) * `ALL` - Albanian Lek * `ALK` - Albanian Lek (1946–1965) * `DZD` - Algerian Dinar * `ADP` - Andorran Peseta * `AOA` - Angolan Kwanza * `AOK` - Angolan Kwanza (1977–1991) * `AON` - Angolan New Kwanza (1990–2000) * `AOR` - Angolan Readjusted Kwanza (1995–1999) * `ARA` - Argentine Austral * `ARS` - Argentine Peso * `ARM` - Argentine Peso (1881–1970) * `ARP` - Argentine Peso (1983–1985) * `ARL` - Argentine Peso Ley (1970–1983) * `AMD` - Armenian Dram * `AWG` - Aruban Florin * `AUD` - Australian Dollar * `ATS` - Austrian Schilling * `AZN` - Azerbaijani Manat * `AZM` - Azerbaijani Manat (1993–2006) * `BSD` - Bahamian Dollar * `BHD` - Bahraini Dinar * `BDT` - Bangladeshi Taka * `BBD` - Barbadian Dollar * `BYN` - Belarusian Ruble * `BYB` - Belarusian Ruble (1994–1999) * `BYR` - Belarusian Ruble (2000–2016) * `BEF` - Belgian Franc * `BEC` - Belgian Franc (convertible) * `BEL` - Belgian Franc (financial) * `BZD` - Belize Dollar * `BMD` - Bermudan Dollar * `BTN` - Bhutanese Ngultrum * `BOB` - Bolivian Boliviano * `BOL` - Bolivian Boliviano (1863–1963) * `BOV` - Bolivian Mvdol * `BOP` - Bolivian Peso * `BAM` - Bosnia-Herzegovina Convertible Mark * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) * `BWP` - Botswanan Pula * `BRC` - Brazilian Cruzado (1986–1989) * `BRZ` - Brazilian Cruzeiro (1942–1967) * `BRE` - Brazilian Cruzeiro (1990–1993) * `BRR` - Brazilian Cruzeiro (1993–1994) * `BRN` - Brazilian New Cruzado (1989–1990) * `BRB` - Brazilian New Cruzeiro (1967–1986) * `BRL` - Brazilian Real * `GBP` - British Pound * `BND` - Brunei Dollar * `BGL` - Bulgarian Hard Lev * `BGN` - Bulgarian Lev * `BGO` - Bulgarian Lev (1879–1952) * `BGM` - Bulgarian Socialist Lev * `BUK` - Burmese Kyat * `BIF` - Burundian Franc * `XPF` - CFP Franc * `KHR` - Cambodian Riel * `CAD` - Canadian Dollar * `CVE` - Cape Verdean Escudo * `KYD` - Cayman Islands Dollar * `XAF` - Central African CFA Franc * `CLE` - Chilean Escudo * `CLP` - Chilean Peso * `CLF` - Chilean Unit of Account (UF) * `CNX` - Chinese People’s Bank Dollar * `CNY` - Chinese Yuan * `CNH` - Chinese Yuan (offshore) * `COP` - Colombian Peso * `COU` - Colombian Real Value Unit * `KMF` - Comorian Franc * `CDF` - Congolese Franc * `CRC` - Costa Rican Colón * `HRD` - Croatian Dinar * `HRK` - Croatian Kuna * `CUC` - Cuban Convertible Peso * `CUP` - Cuban Peso * `CYP` - Cypriot Pound * `CZK` - Czech Koruna * `CSK` - Czechoslovak Hard Koruna * `DKK` - Danish Krone * `DJF` - Djiboutian Franc * `DOP` - Dominican Peso * `NLG` - Dutch Guilder * `XCD` - East Caribbean Dollar * `DDM` - East German Mark * `ECS` - Ecuadorian Sucre * `ECV` - Ecuadorian Unit of Constant Value * `EGP` - Egyptian Pound * `GQE` - Equatorial Guinean Ekwele * `ERN` - Eritrean Nakfa * `EEK` - Estonian Kroon * `ETB` - Ethiopian Birr * `EUR` - Euro * `XBA` - European Composite Unit * `XEU` - European Currency Unit * `XBB` - European Monetary Unit * `XBC` - European Unit of Account (XBC) * `XBD` - European Unit of Account (XBD) * `FKP` - Falkland Islands Pound * `FJD` - Fijian Dollar * `FIM` - Finnish Markka * `FRF` - French Franc * `XFO` - French Gold Franc * `XFU` - French UIC-Franc * `GMD` - Gambian Dalasi * `GEK` - Georgian Kupon Larit * `GEL` - Georgian Lari * `DEM` - German Mark * `GHS` - Ghanaian Cedi * `GHC` - Ghanaian Cedi (1979–2007) * `GIP` - Gibraltar Pound * `XAU` - Gold * `GRD` - Greek Drachma * `GTQ` - Guatemalan Quetzal * `GWP` - Guinea-Bissau Peso * `GNF` - Guinean Franc * `GNS` - Guinean Syli * `GYD` - Guyanaese Dollar * `HTG` - Haitian Gourde * `HNL` - Honduran Lempira * `HKD` - Hong Kong Dollar * `HUF` - Hungarian Forint * `IMP` - IMP * `ISK` - Icelandic Króna * `ISJ` - Icelandic Króna (1918–1981) * `INR` - Indian Rupee * `IDR` - Indonesian Rupiah * `IRR` - Iranian Rial * `IQD` - Iraqi Dinar * `IEP` - Irish Pound * `ILS` - Israeli New Shekel * `ILP` - Israeli Pound * `ILR` - Israeli Shekel (1980–1985) * `ITL` - Italian Lira * `JMD` - Jamaican Dollar * `JPY` - Japanese Yen * `JOD` - Jordanian Dinar * `KZT` - Kazakhstani Tenge * `KES` - Kenyan Shilling * `KWD` - Kuwaiti Dinar * `KGS` - Kyrgystani Som * `LAK` - Laotian Kip * `LVL` - Latvian Lats * `LVR` - Latvian Ruble * `LBP` - Lebanese Pound * `LSL` - Lesotho Loti * `LRD` - Liberian Dollar * `LYD` - Libyan Dinar * `LTL` - Lithuanian Litas * `LTT` - Lithuanian Talonas * `LUL` - Luxembourg Financial Franc * `LUC` - Luxembourgian Convertible Franc * `LUF` - Luxembourgian Franc * `MOP` - Macanese Pataca * `MKD` - Macedonian Denar * `MKN` - Macedonian Denar (1992–1993) * `MGA` - Malagasy Ariary * `MGF` - Malagasy Franc * `MWK` - Malawian Kwacha * `MYR` - Malaysian Ringgit * `MVR` - Maldivian Rufiyaa * `MVP` - Maldivian Rupee (1947–1981) * `MLF` - Malian Franc * `MTL` - Maltese Lira * `MTP` - Maltese Pound * `MRU` - Mauritanian Ouguiya * `MRO` - Mauritanian Ouguiya (1973–2017) * `MUR` - Mauritian Rupee * `MXV` - Mexican Investment Unit * `MXN` - Mexican Peso * `MXP` - Mexican Silver Peso (1861–1992) * `MDC` - Moldovan Cupon * `MDL` - Moldovan Leu * `MCF` - Monegasque Franc * `MNT` - Mongolian Tugrik * `MAD` - Moroccan Dirham * `MAF` - Moroccan Franc * `MZE` - Mozambican Escudo * `MZN` - Mozambican Metical * `MZM` - Mozambican Metical (1980–2006) * `MMK` - Myanmar Kyat * `NAD` - Namibian Dollar * `NPR` - Nepalese Rupee * `ANG` - Netherlands Antillean Guilder * `TWD` - New Taiwan Dollar * `NZD` - New Zealand Dollar * `NIO` - Nicaraguan Córdoba * `NIC` - Nicaraguan Córdoba (1988–1991) * `NGN` - Nigerian Naira * `KPW` - North Korean Won * `NOK` - Norwegian Krone * `OMR` - Omani Rial * `PKR` - Pakistani Rupee * `XPD` - Palladium * `PAB` - Panamanian Balboa * `PGK` - Papua New Guinean Kina * `PYG` - Paraguayan Guarani * `PEI` - Peruvian Inti * `PEN` - Peruvian Sol * `PES` - Peruvian Sol (1863–1965) * `PHP` - Philippine Peso * `XPT` - Platinum * `PLN` - Polish Zloty * `PLZ` - Polish Zloty (1950–1995) * `PTE` - Portuguese Escudo * `GWE` - Portuguese Guinea Escudo * `QAR` - Qatari Rial * `XRE` - RINET Funds * `RHD` - Rhodesian Dollar * `RON` - Romanian Leu * `ROL` - Romanian Leu (1952–2006) * `RUB` - Russian Ruble * `RUR` - Russian Ruble (1991–1998) * `RWF` - Rwandan Franc * `SVC` - Salvadoran Colón * `WST` - Samoan Tala * `SAR` - Saudi Riyal * `RSD` - Serbian Dinar * `CSD` - Serbian Dinar (2002–2006) * `SCR` - Seychellois Rupee * `SLL` - Sierra Leonean Leone * `XAG` - Silver * `SGD` - Singapore Dollar * `SKK` - Slovak Koruna * `SIT` - Slovenian Tolar * `SBD` - Solomon Islands Dollar * `SOS` - Somali Shilling * `ZAR` - South African Rand * `ZAL` - South African Rand (financial) * `KRH` - South Korean Hwan (1953–1962) * `KRW` - South Korean Won * `KRO` - South Korean Won (1945–1953) * `SSP` - South Sudanese Pound * `SUR` - Soviet Rouble * `ESP` - Spanish Peseta * `ESA` - Spanish Peseta (A account) * `ESB` - Spanish Peseta (convertible account) * `XDR` - Special Drawing Rights * `LKR` - Sri Lankan Rupee * `SHP` - St. Helena Pound * `XSU` - Sucre * `SDD` - Sudanese Dinar (1992–2007) * `SDG` - Sudanese Pound * `SDP` - Sudanese Pound (1957–1998) * `SRD` - Surinamese Dollar * `SRG` - Surinamese Guilder * `SZL` - Swazi Lilangeni * `SEK` - Swedish Krona * `CHF` - Swiss Franc * `SYP` - Syrian Pound * `STN` - São Tomé & Príncipe Dobra * `STD` - São Tomé & Príncipe Dobra (1977–2017) * `TVD` - TVD * `TJR` - Tajikistani Ruble * `TJS` - Tajikistani Somoni * `TZS` - Tanzanian Shilling * `XTS` - Testing Currency Code * `THB` - Thai Baht * `XXX` - The codes assigned for transactions where no currency is involved * `TPE` - Timorese Escudo * `TOP` - Tongan Paʻanga * `TTD` - Trinidad & Tobago Dollar * `TND` - Tunisian Dinar * `TRY` - Turkish Lira * `TRL` - Turkish Lira (1922–2005) * `TMT` - Turkmenistani Manat * `TMM` - Turkmenistani Manat (1993–2009) * `USD` - US Dollar * `USN` - US Dollar (Next day) * `USS` - US Dollar (Same day) * `UGX` - Ugandan Shilling * `UGS` - Ugandan Shilling (1966–1987) * `UAH` - Ukrainian Hryvnia * `UAK` - Ukrainian Karbovanets * `AED` - United Arab Emirates Dirham * `UYW` - Uruguayan Nominal Wage Index Unit * `UYU` - Uruguayan Peso * `UYP` - Uruguayan Peso (1975–1993) * `UYI` - Uruguayan Peso (Indexed Units) * `UZS` - Uzbekistani Som * `VUV` - Vanuatu Vatu * `VES` - Venezuelan Bolívar * `VEB` - Venezuelan Bolívar (1871–2008) * `VEF` - Venezuelan Bolívar (2008–2018) * `VND` - Vietnamese Dong * `VNN` - Vietnamese Dong (1978–1985) * `CHE` - WIR Euro * `CHW` - WIR Franc * `XOF` - West African CFA Franc * `YDD` - Yemeni Dinar * `YER` - Yemeni Rial * `YUN` - Yugoslavian Convertible Dinar (1990–1992) * `YUD` - Yugoslavian Hard Dinar (1966–1990) * `YUM` - Yugoslavian New Dinar (1994–2002) * `YUR` - Yugoslavian Reformed Dinar (1992–1993) * `ZWN` - ZWN * `ZRN` - Zairean New Zaire (1993–1998) * `ZRZ` - Zairean Zaire (1971–1993) * `ZMW` - Zambian Kwacha * `ZMK` - Zambian Kwacha (1968–2012) * `ZWD` - Zimbabwean Dollar (1980–2008) * `ZWR` - Zimbabwean Dollar (2008) * `ZWL` - Zimbabwean Dollar (2009)
|
46
|
+
attr_accessor :currency
|
47
|
+
|
48
|
+
# The purchase order line item's exchange rate.
|
49
|
+
attr_accessor :exchange_rate
|
50
|
+
|
51
|
+
# The company the purchase order line item belongs to.
|
52
|
+
attr_accessor :company
|
53
|
+
|
42
54
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
55
|
def self.attribute_map
|
44
56
|
{
|
@@ -48,8 +60,12 @@ module MergeAccountingClient
|
|
48
60
|
:'item' => :'item',
|
49
61
|
:'account' => :'account',
|
50
62
|
:'tracking_category' => :'tracking_category',
|
63
|
+
:'tracking_categories' => :'tracking_categories',
|
51
64
|
:'tax_amount' => :'tax_amount',
|
52
|
-
:'total_line_amount' => :'total_line_amount'
|
65
|
+
:'total_line_amount' => :'total_line_amount',
|
66
|
+
:'currency' => :'currency',
|
67
|
+
:'exchange_rate' => :'exchange_rate',
|
68
|
+
:'company' => :'company'
|
53
69
|
}
|
54
70
|
end
|
55
71
|
|
@@ -67,8 +83,12 @@ module MergeAccountingClient
|
|
67
83
|
:'item' => :'String',
|
68
84
|
:'account' => :'String',
|
69
85
|
:'tracking_category' => :'String',
|
86
|
+
:'tracking_categories' => :'Array<String>',
|
70
87
|
:'tax_amount' => :'String',
|
71
|
-
:'total_line_amount' => :'String'
|
88
|
+
:'total_line_amount' => :'String',
|
89
|
+
:'currency' => :'CurrencyEnum',
|
90
|
+
:'exchange_rate' => :'String',
|
91
|
+
:'company' => :'String'
|
72
92
|
}
|
73
93
|
end
|
74
94
|
|
@@ -82,7 +102,10 @@ module MergeAccountingClient
|
|
82
102
|
:'account',
|
83
103
|
:'tracking_category',
|
84
104
|
:'tax_amount',
|
85
|
-
:'total_line_amount'
|
105
|
+
:'total_line_amount',
|
106
|
+
:'currency',
|
107
|
+
:'exchange_rate',
|
108
|
+
:'company'
|
86
109
|
])
|
87
110
|
end
|
88
111
|
|
@@ -125,6 +148,12 @@ module MergeAccountingClient
|
|
125
148
|
self.tracking_category = attributes[:'tracking_category']
|
126
149
|
end
|
127
150
|
|
151
|
+
if attributes.key?(:'tracking_categories')
|
152
|
+
if (value = attributes[:'tracking_categories']).is_a?(Array)
|
153
|
+
self.tracking_categories = value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
128
157
|
if attributes.key?(:'tax_amount')
|
129
158
|
self.tax_amount = attributes[:'tax_amount']
|
130
159
|
end
|
@@ -132,37 +161,60 @@ module MergeAccountingClient
|
|
132
161
|
if attributes.key?(:'total_line_amount')
|
133
162
|
self.total_line_amount = attributes[:'total_line_amount']
|
134
163
|
end
|
164
|
+
|
165
|
+
if attributes.key?(:'currency')
|
166
|
+
self.currency = attributes[:'currency']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'exchange_rate')
|
170
|
+
self.exchange_rate = attributes[:'exchange_rate']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'company')
|
174
|
+
self.company = attributes[:'company']
|
175
|
+
end
|
135
176
|
end
|
136
177
|
|
137
178
|
# Show invalid properties with the reasons. Usually used together with valid?
|
138
179
|
# @return Array for valid properties with the reasons
|
139
180
|
def list_invalid_properties
|
140
181
|
invalid_properties = Array.new
|
141
|
-
|
182
|
+
if @tracking_categories.nil?
|
183
|
+
invalid_properties.push('invalid value for "tracking_categories", tracking_categories cannot be nil.')
|
184
|
+
end
|
185
|
+
|
186
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
142
187
|
if !@tax_amount.nil? && @tax_amount !~ pattern
|
143
188
|
invalid_properties.push("invalid value for \"tax_amount\", must conform to the pattern #{pattern}.")
|
144
189
|
end
|
145
190
|
|
146
|
-
pattern = Regexp.new(
|
191
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
147
192
|
if !@total_line_amount.nil? && @total_line_amount !~ pattern
|
148
193
|
invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
|
149
194
|
end
|
150
195
|
|
196
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
197
|
+
if !@exchange_rate.nil? && @exchange_rate !~ pattern
|
198
|
+
invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
|
199
|
+
end
|
200
|
+
|
151
201
|
invalid_properties
|
152
202
|
end
|
153
203
|
|
154
204
|
# Check to see if the all the properties in the model are valid
|
155
205
|
# @return true if the model is valid
|
156
206
|
def valid?
|
157
|
-
return false if
|
158
|
-
return false if !@
|
207
|
+
return false if @tracking_categories.nil?
|
208
|
+
return false if !@tax_amount.nil? && @tax_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
209
|
+
return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
210
|
+
return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
159
211
|
true
|
160
212
|
end
|
161
213
|
|
162
214
|
# Custom attribute writer method with validation
|
163
215
|
# @param [Object] tax_amount Value to be assigned
|
164
216
|
def tax_amount=(tax_amount)
|
165
|
-
pattern = Regexp.new(
|
217
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
166
218
|
if !tax_amount.nil? && tax_amount !~ pattern
|
167
219
|
fail ArgumentError, "invalid value for \"tax_amount\", must conform to the pattern #{pattern}."
|
168
220
|
end
|
@@ -173,7 +225,7 @@ module MergeAccountingClient
|
|
173
225
|
# Custom attribute writer method with validation
|
174
226
|
# @param [Object] total_line_amount Value to be assigned
|
175
227
|
def total_line_amount=(total_line_amount)
|
176
|
-
pattern = Regexp.new(
|
228
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
177
229
|
if !total_line_amount.nil? && total_line_amount !~ pattern
|
178
230
|
fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
|
179
231
|
end
|
@@ -181,6 +233,17 @@ module MergeAccountingClient
|
|
181
233
|
@total_line_amount = total_line_amount
|
182
234
|
end
|
183
235
|
|
236
|
+
# Custom attribute writer method with validation
|
237
|
+
# @param [Object] exchange_rate Value to be assigned
|
238
|
+
def exchange_rate=(exchange_rate)
|
239
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
240
|
+
if !exchange_rate.nil? && exchange_rate !~ pattern
|
241
|
+
fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
|
242
|
+
end
|
243
|
+
|
244
|
+
@exchange_rate = exchange_rate
|
245
|
+
end
|
246
|
+
|
184
247
|
# Checks equality by comparing each attribute.
|
185
248
|
# @param [Object] Object to be compared
|
186
249
|
def ==(o)
|
@@ -192,8 +255,12 @@ module MergeAccountingClient
|
|
192
255
|
item == o.item &&
|
193
256
|
account == o.account &&
|
194
257
|
tracking_category == o.tracking_category &&
|
258
|
+
tracking_categories == o.tracking_categories &&
|
195
259
|
tax_amount == o.tax_amount &&
|
196
|
-
total_line_amount == o.total_line_amount
|
260
|
+
total_line_amount == o.total_line_amount &&
|
261
|
+
currency == o.currency &&
|
262
|
+
exchange_rate == o.exchange_rate &&
|
263
|
+
company == o.company
|
197
264
|
end
|
198
265
|
|
199
266
|
# @see the `==` method
|
@@ -205,7 +272,7 @@ module MergeAccountingClient
|
|
205
272
|
# Calculates hash code according to all attributes.
|
206
273
|
# @return [Integer] Hash code
|
207
274
|
def hash
|
208
|
-
[description, unit_price, quantity, item, account, tracking_category, tax_amount, total_line_amount].hash
|
275
|
+
[description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company].hash
|
209
276
|
end
|
210
277
|
|
211
278
|
# Builds the object from hash
|
@@ -0,0 +1,422 @@
|
|
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 PurchaseOrderLineItem Object ### Description The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. ### Usage Example Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders.
|
18
|
+
class PurchaseOrderLineItemRequest
|
19
|
+
# A description of the good being purchased.
|
20
|
+
attr_accessor :description
|
21
|
+
|
22
|
+
# The line item's unit price.
|
23
|
+
attr_accessor :unit_price
|
24
|
+
|
25
|
+
# The line item's quantity.
|
26
|
+
attr_accessor :quantity
|
27
|
+
|
28
|
+
attr_accessor :item
|
29
|
+
|
30
|
+
# The purchase order line item's account.
|
31
|
+
attr_accessor :account
|
32
|
+
|
33
|
+
# The purchase order line item's associated tracking category.
|
34
|
+
attr_accessor :tracking_category
|
35
|
+
|
36
|
+
# The purchase order line item's associated tracking categories.
|
37
|
+
attr_accessor :tracking_categories
|
38
|
+
|
39
|
+
# The purchase order line item's tax amount.
|
40
|
+
attr_accessor :tax_amount
|
41
|
+
|
42
|
+
# The purchase order line item's total amount.
|
43
|
+
attr_accessor :total_line_amount
|
44
|
+
|
45
|
+
# The purchase order line item's currency. * `XUA` - ADB Unit of Account * `AFN` - Afghan Afghani * `AFA` - Afghan Afghani (1927–2002) * `ALL` - Albanian Lek * `ALK` - Albanian Lek (1946–1965) * `DZD` - Algerian Dinar * `ADP` - Andorran Peseta * `AOA` - Angolan Kwanza * `AOK` - Angolan Kwanza (1977–1991) * `AON` - Angolan New Kwanza (1990–2000) * `AOR` - Angolan Readjusted Kwanza (1995–1999) * `ARA` - Argentine Austral * `ARS` - Argentine Peso * `ARM` - Argentine Peso (1881–1970) * `ARP` - Argentine Peso (1983–1985) * `ARL` - Argentine Peso Ley (1970–1983) * `AMD` - Armenian Dram * `AWG` - Aruban Florin * `AUD` - Australian Dollar * `ATS` - Austrian Schilling * `AZN` - Azerbaijani Manat * `AZM` - Azerbaijani Manat (1993–2006) * `BSD` - Bahamian Dollar * `BHD` - Bahraini Dinar * `BDT` - Bangladeshi Taka * `BBD` - Barbadian Dollar * `BYN` - Belarusian Ruble * `BYB` - Belarusian Ruble (1994–1999) * `BYR` - Belarusian Ruble (2000–2016) * `BEF` - Belgian Franc * `BEC` - Belgian Franc (convertible) * `BEL` - Belgian Franc (financial) * `BZD` - Belize Dollar * `BMD` - Bermudan Dollar * `BTN` - Bhutanese Ngultrum * `BOB` - Bolivian Boliviano * `BOL` - Bolivian Boliviano (1863–1963) * `BOV` - Bolivian Mvdol * `BOP` - Bolivian Peso * `BAM` - Bosnia-Herzegovina Convertible Mark * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) * `BWP` - Botswanan Pula * `BRC` - Brazilian Cruzado (1986–1989) * `BRZ` - Brazilian Cruzeiro (1942–1967) * `BRE` - Brazilian Cruzeiro (1990–1993) * `BRR` - Brazilian Cruzeiro (1993–1994) * `BRN` - Brazilian New Cruzado (1989–1990) * `BRB` - Brazilian New Cruzeiro (1967–1986) * `BRL` - Brazilian Real * `GBP` - British Pound * `BND` - Brunei Dollar * `BGL` - Bulgarian Hard Lev * `BGN` - Bulgarian Lev * `BGO` - Bulgarian Lev (1879–1952) * `BGM` - Bulgarian Socialist Lev * `BUK` - Burmese Kyat * `BIF` - Burundian Franc * `XPF` - CFP Franc * `KHR` - Cambodian Riel * `CAD` - Canadian Dollar * `CVE` - Cape Verdean Escudo * `KYD` - Cayman Islands Dollar * `XAF` - Central African CFA Franc * `CLE` - Chilean Escudo * `CLP` - Chilean Peso * `CLF` - Chilean Unit of Account (UF) * `CNX` - Chinese People’s Bank Dollar * `CNY` - Chinese Yuan * `CNH` - Chinese Yuan (offshore) * `COP` - Colombian Peso * `COU` - Colombian Real Value Unit * `KMF` - Comorian Franc * `CDF` - Congolese Franc * `CRC` - Costa Rican Colón * `HRD` - Croatian Dinar * `HRK` - Croatian Kuna * `CUC` - Cuban Convertible Peso * `CUP` - Cuban Peso * `CYP` - Cypriot Pound * `CZK` - Czech Koruna * `CSK` - Czechoslovak Hard Koruna * `DKK` - Danish Krone * `DJF` - Djiboutian Franc * `DOP` - Dominican Peso * `NLG` - Dutch Guilder * `XCD` - East Caribbean Dollar * `DDM` - East German Mark * `ECS` - Ecuadorian Sucre * `ECV` - Ecuadorian Unit of Constant Value * `EGP` - Egyptian Pound * `GQE` - Equatorial Guinean Ekwele * `ERN` - Eritrean Nakfa * `EEK` - Estonian Kroon * `ETB` - Ethiopian Birr * `EUR` - Euro * `XBA` - European Composite Unit * `XEU` - European Currency Unit * `XBB` - European Monetary Unit * `XBC` - European Unit of Account (XBC) * `XBD` - European Unit of Account (XBD) * `FKP` - Falkland Islands Pound * `FJD` - Fijian Dollar * `FIM` - Finnish Markka * `FRF` - French Franc * `XFO` - French Gold Franc * `XFU` - French UIC-Franc * `GMD` - Gambian Dalasi * `GEK` - Georgian Kupon Larit * `GEL` - Georgian Lari * `DEM` - German Mark * `GHS` - Ghanaian Cedi * `GHC` - Ghanaian Cedi (1979–2007) * `GIP` - Gibraltar Pound * `XAU` - Gold * `GRD` - Greek Drachma * `GTQ` - Guatemalan Quetzal * `GWP` - Guinea-Bissau Peso * `GNF` - Guinean Franc * `GNS` - Guinean Syli * `GYD` - Guyanaese Dollar * `HTG` - Haitian Gourde * `HNL` - Honduran Lempira * `HKD` - Hong Kong Dollar * `HUF` - Hungarian Forint * `IMP` - IMP * `ISK` - Icelandic Króna * `ISJ` - Icelandic Króna (1918–1981) * `INR` - Indian Rupee * `IDR` - Indonesian Rupiah * `IRR` - Iranian Rial * `IQD` - Iraqi Dinar * `IEP` - Irish Pound * `ILS` - Israeli New Shekel * `ILP` - Israeli Pound * `ILR` - Israeli Shekel (1980–1985) * `ITL` - Italian Lira * `JMD` - Jamaican Dollar * `JPY` - Japanese Yen * `JOD` - Jordanian Dinar * `KZT` - Kazakhstani Tenge * `KES` - Kenyan Shilling * `KWD` - Kuwaiti Dinar * `KGS` - Kyrgystani Som * `LAK` - Laotian Kip * `LVL` - Latvian Lats * `LVR` - Latvian Ruble * `LBP` - Lebanese Pound * `LSL` - Lesotho Loti * `LRD` - Liberian Dollar * `LYD` - Libyan Dinar * `LTL` - Lithuanian Litas * `LTT` - Lithuanian Talonas * `LUL` - Luxembourg Financial Franc * `LUC` - Luxembourgian Convertible Franc * `LUF` - Luxembourgian Franc * `MOP` - Macanese Pataca * `MKD` - Macedonian Denar * `MKN` - Macedonian Denar (1992–1993) * `MGA` - Malagasy Ariary * `MGF` - Malagasy Franc * `MWK` - Malawian Kwacha * `MYR` - Malaysian Ringgit * `MVR` - Maldivian Rufiyaa * `MVP` - Maldivian Rupee (1947–1981) * `MLF` - Malian Franc * `MTL` - Maltese Lira * `MTP` - Maltese Pound * `MRU` - Mauritanian Ouguiya * `MRO` - Mauritanian Ouguiya (1973–2017) * `MUR` - Mauritian Rupee * `MXV` - Mexican Investment Unit * `MXN` - Mexican Peso * `MXP` - Mexican Silver Peso (1861–1992) * `MDC` - Moldovan Cupon * `MDL` - Moldovan Leu * `MCF` - Monegasque Franc * `MNT` - Mongolian Tugrik * `MAD` - Moroccan Dirham * `MAF` - Moroccan Franc * `MZE` - Mozambican Escudo * `MZN` - Mozambican Metical * `MZM` - Mozambican Metical (1980–2006) * `MMK` - Myanmar Kyat * `NAD` - Namibian Dollar * `NPR` - Nepalese Rupee * `ANG` - Netherlands Antillean Guilder * `TWD` - New Taiwan Dollar * `NZD` - New Zealand Dollar * `NIO` - Nicaraguan Córdoba * `NIC` - Nicaraguan Córdoba (1988–1991) * `NGN` - Nigerian Naira * `KPW` - North Korean Won * `NOK` - Norwegian Krone * `OMR` - Omani Rial * `PKR` - Pakistani Rupee * `XPD` - Palladium * `PAB` - Panamanian Balboa * `PGK` - Papua New Guinean Kina * `PYG` - Paraguayan Guarani * `PEI` - Peruvian Inti * `PEN` - Peruvian Sol * `PES` - Peruvian Sol (1863–1965) * `PHP` - Philippine Peso * `XPT` - Platinum * `PLN` - Polish Zloty * `PLZ` - Polish Zloty (1950–1995) * `PTE` - Portuguese Escudo * `GWE` - Portuguese Guinea Escudo * `QAR` - Qatari Rial * `XRE` - RINET Funds * `RHD` - Rhodesian Dollar * `RON` - Romanian Leu * `ROL` - Romanian Leu (1952–2006) * `RUB` - Russian Ruble * `RUR` - Russian Ruble (1991–1998) * `RWF` - Rwandan Franc * `SVC` - Salvadoran Colón * `WST` - Samoan Tala * `SAR` - Saudi Riyal * `RSD` - Serbian Dinar * `CSD` - Serbian Dinar (2002–2006) * `SCR` - Seychellois Rupee * `SLL` - Sierra Leonean Leone * `XAG` - Silver * `SGD` - Singapore Dollar * `SKK` - Slovak Koruna * `SIT` - Slovenian Tolar * `SBD` - Solomon Islands Dollar * `SOS` - Somali Shilling * `ZAR` - South African Rand * `ZAL` - South African Rand (financial) * `KRH` - South Korean Hwan (1953–1962) * `KRW` - South Korean Won * `KRO` - South Korean Won (1945–1953) * `SSP` - South Sudanese Pound * `SUR` - Soviet Rouble * `ESP` - Spanish Peseta * `ESA` - Spanish Peseta (A account) * `ESB` - Spanish Peseta (convertible account) * `XDR` - Special Drawing Rights * `LKR` - Sri Lankan Rupee * `SHP` - St. Helena Pound * `XSU` - Sucre * `SDD` - Sudanese Dinar (1992–2007) * `SDG` - Sudanese Pound * `SDP` - Sudanese Pound (1957–1998) * `SRD` - Surinamese Dollar * `SRG` - Surinamese Guilder * `SZL` - Swazi Lilangeni * `SEK` - Swedish Krona * `CHF` - Swiss Franc * `SYP` - Syrian Pound * `STN` - São Tomé & Príncipe Dobra * `STD` - São Tomé & Príncipe Dobra (1977–2017) * `TVD` - TVD * `TJR` - Tajikistani Ruble * `TJS` - Tajikistani Somoni * `TZS` - Tanzanian Shilling * `XTS` - Testing Currency Code * `THB` - Thai Baht * `XXX` - The codes assigned for transactions where no currency is involved * `TPE` - Timorese Escudo * `TOP` - Tongan Paʻanga * `TTD` - Trinidad & Tobago Dollar * `TND` - Tunisian Dinar * `TRY` - Turkish Lira * `TRL` - Turkish Lira (1922–2005) * `TMT` - Turkmenistani Manat * `TMM` - Turkmenistani Manat (1993–2009) * `USD` - US Dollar * `USN` - US Dollar (Next day) * `USS` - US Dollar (Same day) * `UGX` - Ugandan Shilling * `UGS` - Ugandan Shilling (1966–1987) * `UAH` - Ukrainian Hryvnia * `UAK` - Ukrainian Karbovanets * `AED` - United Arab Emirates Dirham * `UYW` - Uruguayan Nominal Wage Index Unit * `UYU` - Uruguayan Peso * `UYP` - Uruguayan Peso (1975–1993) * `UYI` - Uruguayan Peso (Indexed Units) * `UZS` - Uzbekistani Som * `VUV` - Vanuatu Vatu * `VES` - Venezuelan Bolívar * `VEB` - Venezuelan Bolívar (1871–2008) * `VEF` - Venezuelan Bolívar (2008–2018) * `VND` - Vietnamese Dong * `VNN` - Vietnamese Dong (1978–1985) * `CHE` - WIR Euro * `CHW` - WIR Franc * `XOF` - West African CFA Franc * `YDD` - Yemeni Dinar * `YER` - Yemeni Rial * `YUN` - Yugoslavian Convertible Dinar (1990–1992) * `YUD` - Yugoslavian Hard Dinar (1966–1990) * `YUM` - Yugoslavian New Dinar (1994–2002) * `YUR` - Yugoslavian Reformed Dinar (1992–1993) * `ZWN` - ZWN * `ZRN` - Zairean New Zaire (1993–1998) * `ZRZ` - Zairean Zaire (1971–1993) * `ZMW` - Zambian Kwacha * `ZMK` - Zambian Kwacha (1968–2012) * `ZWD` - Zimbabwean Dollar (1980–2008) * `ZWR` - Zimbabwean Dollar (2008) * `ZWL` - Zimbabwean Dollar (2009)
|
46
|
+
attr_accessor :currency
|
47
|
+
|
48
|
+
# The purchase order line item's exchange rate.
|
49
|
+
attr_accessor :exchange_rate
|
50
|
+
|
51
|
+
# The company the purchase order line item belongs to.
|
52
|
+
attr_accessor :company
|
53
|
+
|
54
|
+
attr_accessor :integration_params
|
55
|
+
|
56
|
+
attr_accessor :linked_account_params
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'description' => :'description',
|
62
|
+
:'unit_price' => :'unit_price',
|
63
|
+
:'quantity' => :'quantity',
|
64
|
+
:'item' => :'item',
|
65
|
+
:'account' => :'account',
|
66
|
+
:'tracking_category' => :'tracking_category',
|
67
|
+
:'tracking_categories' => :'tracking_categories',
|
68
|
+
:'tax_amount' => :'tax_amount',
|
69
|
+
:'total_line_amount' => :'total_line_amount',
|
70
|
+
:'currency' => :'currency',
|
71
|
+
:'exchange_rate' => :'exchange_rate',
|
72
|
+
:'company' => :'company',
|
73
|
+
:'integration_params' => :'integration_params',
|
74
|
+
:'linked_account_params' => :'linked_account_params'
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns all the JSON keys this model knows about
|
79
|
+
def self.acceptable_attributes
|
80
|
+
attribute_map.values
|
81
|
+
end
|
82
|
+
|
83
|
+
# Attribute type mapping.
|
84
|
+
def self.openapi_types
|
85
|
+
{
|
86
|
+
:'description' => :'String',
|
87
|
+
:'unit_price' => :'Float',
|
88
|
+
:'quantity' => :'Float',
|
89
|
+
:'item' => :'String',
|
90
|
+
:'account' => :'String',
|
91
|
+
:'tracking_category' => :'String',
|
92
|
+
:'tracking_categories' => :'Array<String>',
|
93
|
+
:'tax_amount' => :'String',
|
94
|
+
:'total_line_amount' => :'String',
|
95
|
+
:'currency' => :'CurrencyEnum',
|
96
|
+
:'exchange_rate' => :'String',
|
97
|
+
:'company' => :'String',
|
98
|
+
:'integration_params' => :'Hash<String, Object>',
|
99
|
+
:'linked_account_params' => :'Hash<String, Object>'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# List of attributes with nullable: true
|
104
|
+
def self.openapi_nullable
|
105
|
+
Set.new([
|
106
|
+
:'description',
|
107
|
+
:'unit_price',
|
108
|
+
:'quantity',
|
109
|
+
:'item',
|
110
|
+
:'account',
|
111
|
+
:'tracking_category',
|
112
|
+
:'tax_amount',
|
113
|
+
:'total_line_amount',
|
114
|
+
:'currency',
|
115
|
+
:'exchange_rate',
|
116
|
+
:'company',
|
117
|
+
:'integration_params',
|
118
|
+
:'linked_account_params'
|
119
|
+
])
|
120
|
+
end
|
121
|
+
|
122
|
+
# Initializes the object
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
def initialize(attributes = {})
|
125
|
+
if (!attributes.is_a?(Hash))
|
126
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeAccountingClient::PurchaseOrderLineItemRequest` initialize method"
|
127
|
+
end
|
128
|
+
|
129
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
130
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
131
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
132
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeAccountingClient::PurchaseOrderLineItemRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
133
|
+
end
|
134
|
+
h[k.to_sym] = v
|
135
|
+
}
|
136
|
+
|
137
|
+
if attributes.key?(:'description')
|
138
|
+
self.description = attributes[:'description']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'unit_price')
|
142
|
+
self.unit_price = attributes[:'unit_price']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'quantity')
|
146
|
+
self.quantity = attributes[:'quantity']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'item')
|
150
|
+
self.item = attributes[:'item']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'account')
|
154
|
+
self.account = attributes[:'account']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.key?(:'tracking_category')
|
158
|
+
self.tracking_category = attributes[:'tracking_category']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'tracking_categories')
|
162
|
+
if (value = attributes[:'tracking_categories']).is_a?(Array)
|
163
|
+
self.tracking_categories = value
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'tax_amount')
|
168
|
+
self.tax_amount = attributes[:'tax_amount']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'total_line_amount')
|
172
|
+
self.total_line_amount = attributes[:'total_line_amount']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'currency')
|
176
|
+
self.currency = attributes[:'currency']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'exchange_rate')
|
180
|
+
self.exchange_rate = attributes[:'exchange_rate']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'company')
|
184
|
+
self.company = attributes[:'company']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'integration_params')
|
188
|
+
if (value = attributes[:'integration_params']).is_a?(Hash)
|
189
|
+
self.integration_params = value
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'linked_account_params')
|
194
|
+
if (value = attributes[:'linked_account_params']).is_a?(Hash)
|
195
|
+
self.linked_account_params = value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
201
|
+
# @return Array for valid properties with the reasons
|
202
|
+
def list_invalid_properties
|
203
|
+
invalid_properties = Array.new
|
204
|
+
if @tracking_categories.nil?
|
205
|
+
invalid_properties.push('invalid value for "tracking_categories", tracking_categories cannot be nil.')
|
206
|
+
end
|
207
|
+
|
208
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
209
|
+
if !@tax_amount.nil? && @tax_amount !~ pattern
|
210
|
+
invalid_properties.push("invalid value for \"tax_amount\", must conform to the pattern #{pattern}.")
|
211
|
+
end
|
212
|
+
|
213
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
214
|
+
if !@total_line_amount.nil? && @total_line_amount !~ pattern
|
215
|
+
invalid_properties.push("invalid value for \"total_line_amount\", must conform to the pattern #{pattern}.")
|
216
|
+
end
|
217
|
+
|
218
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
219
|
+
if !@exchange_rate.nil? && @exchange_rate !~ pattern
|
220
|
+
invalid_properties.push("invalid value for \"exchange_rate\", must conform to the pattern #{pattern}.")
|
221
|
+
end
|
222
|
+
|
223
|
+
invalid_properties
|
224
|
+
end
|
225
|
+
|
226
|
+
# Check to see if the all the properties in the model are valid
|
227
|
+
# @return true if the model is valid
|
228
|
+
def valid?
|
229
|
+
return false if @tracking_categories.nil?
|
230
|
+
return false if !@tax_amount.nil? && @tax_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
231
|
+
return false if !@total_line_amount.nil? && @total_line_amount !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
232
|
+
return false if !@exchange_rate.nil? && @exchange_rate !~ Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
233
|
+
true
|
234
|
+
end
|
235
|
+
|
236
|
+
# Custom attribute writer method with validation
|
237
|
+
# @param [Object] tax_amount Value to be assigned
|
238
|
+
def tax_amount=(tax_amount)
|
239
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
240
|
+
if !tax_amount.nil? && tax_amount !~ pattern
|
241
|
+
fail ArgumentError, "invalid value for \"tax_amount\", must conform to the pattern #{pattern}."
|
242
|
+
end
|
243
|
+
|
244
|
+
@tax_amount = tax_amount
|
245
|
+
end
|
246
|
+
|
247
|
+
# Custom attribute writer method with validation
|
248
|
+
# @param [Object] total_line_amount Value to be assigned
|
249
|
+
def total_line_amount=(total_line_amount)
|
250
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
251
|
+
if !total_line_amount.nil? && total_line_amount !~ pattern
|
252
|
+
fail ArgumentError, "invalid value for \"total_line_amount\", must conform to the pattern #{pattern}."
|
253
|
+
end
|
254
|
+
|
255
|
+
@total_line_amount = total_line_amount
|
256
|
+
end
|
257
|
+
|
258
|
+
# Custom attribute writer method with validation
|
259
|
+
# @param [Object] exchange_rate Value to be assigned
|
260
|
+
def exchange_rate=(exchange_rate)
|
261
|
+
pattern = Regexp.new(/^-?\d{0,32}(?:\.\d{0,16})?$/)
|
262
|
+
if !exchange_rate.nil? && exchange_rate !~ pattern
|
263
|
+
fail ArgumentError, "invalid value for \"exchange_rate\", must conform to the pattern #{pattern}."
|
264
|
+
end
|
265
|
+
|
266
|
+
@exchange_rate = exchange_rate
|
267
|
+
end
|
268
|
+
|
269
|
+
# Checks equality by comparing each attribute.
|
270
|
+
# @param [Object] Object to be compared
|
271
|
+
def ==(o)
|
272
|
+
return true if self.equal?(o)
|
273
|
+
self.class == o.class &&
|
274
|
+
description == o.description &&
|
275
|
+
unit_price == o.unit_price &&
|
276
|
+
quantity == o.quantity &&
|
277
|
+
item == o.item &&
|
278
|
+
account == o.account &&
|
279
|
+
tracking_category == o.tracking_category &&
|
280
|
+
tracking_categories == o.tracking_categories &&
|
281
|
+
tax_amount == o.tax_amount &&
|
282
|
+
total_line_amount == o.total_line_amount &&
|
283
|
+
currency == o.currency &&
|
284
|
+
exchange_rate == o.exchange_rate &&
|
285
|
+
company == o.company &&
|
286
|
+
integration_params == o.integration_params &&
|
287
|
+
linked_account_params == o.linked_account_params
|
288
|
+
end
|
289
|
+
|
290
|
+
# @see the `==` method
|
291
|
+
# @param [Object] Object to be compared
|
292
|
+
def eql?(o)
|
293
|
+
self == o
|
294
|
+
end
|
295
|
+
|
296
|
+
# Calculates hash code according to all attributes.
|
297
|
+
# @return [Integer] Hash code
|
298
|
+
def hash
|
299
|
+
[description, unit_price, quantity, item, account, tracking_category, tracking_categories, tax_amount, total_line_amount, currency, exchange_rate, company, integration_params, linked_account_params].hash
|
300
|
+
end
|
301
|
+
|
302
|
+
# Builds the object from hash
|
303
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
304
|
+
# @return [Object] Returns the model itself
|
305
|
+
def self.build_from_hash(attributes)
|
306
|
+
new.build_from_hash(attributes)
|
307
|
+
end
|
308
|
+
|
309
|
+
# Builds the object from hash
|
310
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
311
|
+
# @return [Object] Returns the model itself
|
312
|
+
def build_from_hash(attributes)
|
313
|
+
return nil unless attributes.is_a?(Hash)
|
314
|
+
self.class.openapi_types.each_pair do |key, type|
|
315
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
316
|
+
self.send("#{key}=", nil)
|
317
|
+
elsif type =~ /\AArray<(.*)>/i
|
318
|
+
# check to ensure the input is an array given that the attribute
|
319
|
+
# is documented as an array but the input is not
|
320
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
321
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
322
|
+
end
|
323
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
324
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
self
|
329
|
+
end
|
330
|
+
|
331
|
+
# Deserializes the data based on type
|
332
|
+
# @param string type Data type
|
333
|
+
# @param string value Value to be deserialized
|
334
|
+
# @return [Object] Deserialized data
|
335
|
+
def _deserialize(type, value)
|
336
|
+
case type.to_sym
|
337
|
+
when :Time
|
338
|
+
Time.parse(value)
|
339
|
+
when :Date
|
340
|
+
Date.parse(value)
|
341
|
+
when :String
|
342
|
+
value
|
343
|
+
when :Integer
|
344
|
+
value.to_i
|
345
|
+
when :Float
|
346
|
+
value.to_f
|
347
|
+
when :Boolean
|
348
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
349
|
+
true
|
350
|
+
else
|
351
|
+
false
|
352
|
+
end
|
353
|
+
when :Object
|
354
|
+
# generic object (usually a Hash), return directly
|
355
|
+
value
|
356
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
357
|
+
inner_type = Regexp.last_match[:inner_type]
|
358
|
+
value.map { |v| _deserialize(inner_type, v) }
|
359
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
360
|
+
k_type = Regexp.last_match[:k_type]
|
361
|
+
v_type = Regexp.last_match[:v_type]
|
362
|
+
{}.tap do |hash|
|
363
|
+
value.each do |k, v|
|
364
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
365
|
+
end
|
366
|
+
end
|
367
|
+
else # model
|
368
|
+
# models (e.g. Pet) or oneOf
|
369
|
+
klass = MergeAccountingClient.const_get(type)
|
370
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
# Returns the string representation of the object
|
375
|
+
# @return [String] String presentation of the object
|
376
|
+
def to_s
|
377
|
+
to_hash.to_s
|
378
|
+
end
|
379
|
+
|
380
|
+
# to_body is an alias to to_hash (backward compatibility)
|
381
|
+
# @return [Hash] Returns the object in the form of hash
|
382
|
+
def to_body
|
383
|
+
to_hash
|
384
|
+
end
|
385
|
+
|
386
|
+
# Returns the object in the form of hash
|
387
|
+
# @return [Hash] Returns the object in the form of hash
|
388
|
+
def to_hash
|
389
|
+
hash = {}
|
390
|
+
self.class.attribute_map.each_pair do |attr, param|
|
391
|
+
value = self.send(attr)
|
392
|
+
if value.nil?
|
393
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
394
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
395
|
+
end
|
396
|
+
|
397
|
+
hash[param] = _to_hash(value)
|
398
|
+
end
|
399
|
+
hash
|
400
|
+
end
|
401
|
+
|
402
|
+
# Outputs non-array value in the form of hash
|
403
|
+
# For object, use to_hash. Otherwise, just return the value
|
404
|
+
# @param [Object] value Any valid value
|
405
|
+
# @return [Hash] Returns the value in the form of hash
|
406
|
+
def _to_hash(value)
|
407
|
+
if value.is_a?(Array)
|
408
|
+
value.compact.map { |v| _to_hash(v) }
|
409
|
+
elsif value.is_a?(Hash)
|
410
|
+
{}.tap do |hash|
|
411
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
412
|
+
end
|
413
|
+
elsif value.respond_to? :to_hash
|
414
|
+
value.to_hash
|
415
|
+
else
|
416
|
+
value
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
420
|
+
end
|
421
|
+
|
422
|
+
end
|