xero-apimatic-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +175 -0
- data/bin/console +15 -0
- data/lib/xero_ap_is/api_helper.rb +10 -0
- data/lib/xero_ap_is/apis/accounting_api.rb +8328 -0
- data/lib/xero_ap_is/apis/asset_api.rb +210 -0
- data/lib/xero_ap_is/apis/bank_feeds_api.rb +268 -0
- data/lib/xero_ap_is/apis/base_api.rb +67 -0
- data/lib/xero_ap_is/apis/identity_api.rb +51 -0
- data/lib/xero_ap_is/apis/oauth_authorization_api.rb +87 -0
- data/lib/xero_ap_is/apis/project_api.rb +662 -0
- data/lib/xero_ap_is/client.rb +110 -0
- data/lib/xero_ap_is/configuration.rb +196 -0
- data/lib/xero_ap_is/exceptions/api_exception.rb +21 -0
- data/lib/xero_ap_is/exceptions/asset_types400_error_exception.rb +72 -0
- data/lib/xero_ap_is/exceptions/assets400_error_exception.rb +72 -0
- data/lib/xero_ap_is/exceptions/error_error1_exception.rb +63 -0
- data/lib/xero_ap_is/exceptions/error_error2_exception.rb +51 -0
- data/lib/xero_ap_is/exceptions/error_exception.rb +72 -0
- data/lib/xero_ap_is/exceptions/feed_connections_error_exception.rb +60 -0
- data/lib/xero_ap_is/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/xero_ap_is/exceptions/statements_error_exception.rb +60 -0
- data/lib/xero_ap_is/http/api_response.rb +19 -0
- data/lib/xero_ap_is/http/auth/basic_auth.rb +62 -0
- data/lib/xero_ap_is/http/auth/oauth_2.rb +161 -0
- data/lib/xero_ap_is/http/http_call_back.rb +10 -0
- data/lib/xero_ap_is/http/http_method_enum.rb +10 -0
- data/lib/xero_ap_is/http/http_request.rb +10 -0
- data/lib/xero_ap_is/http/http_response.rb +10 -0
- data/lib/xero_ap_is/http/proxy_settings.rb +22 -0
- data/lib/xero_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/xero_ap_is/logging/sdk_logger.rb +17 -0
- data/lib/xero_ap_is/models/access_token.rb +116 -0
- data/lib/xero_ap_is/models/account.rb +300 -0
- data/lib/xero_ap_is/models/account_type.rb +100 -0
- data/lib/xero_ap_is/models/account_type1.rb +37 -0
- data/lib/xero_ap_is/models/accounts.rb +84 -0
- data/lib/xero_ap_is/models/accounts_payable.rb +85 -0
- data/lib/xero_ap_is/models/accounts_receivable.rb +85 -0
- data/lib/xero_ap_is/models/action.rb +85 -0
- data/lib/xero_ap_is/models/actions.rb +84 -0
- data/lib/xero_ap_is/models/address.rb +167 -0
- data/lib/xero_ap_is/models/address_for_organisation.rb +167 -0
- data/lib/xero_ap_is/models/address_type.rb +40 -0
- data/lib/xero_ap_is/models/address_type1.rb +36 -0
- data/lib/xero_ap_is/models/allocation.rb +174 -0
- data/lib/xero_ap_is/models/allocations.rb +85 -0
- data/lib/xero_ap_is/models/amount.rb +85 -0
- data/lib/xero_ap_is/models/asset.rb +249 -0
- data/lib/xero_ap_is/models/asset_status.rb +40 -0
- data/lib/xero_ap_is/models/asset_status_query_param.rb +40 -0
- data/lib/xero_ap_is/models/asset_type.rb +154 -0
- data/lib/xero_ap_is/models/assets.rb +94 -0
- data/lib/xero_ap_is/models/attachment.rb +126 -0
- data/lib/xero_ap_is/models/attachments.rb +85 -0
- data/lib/xero_ap_is/models/averaging_method.rb +36 -0
- data/lib/xero_ap_is/models/balance_details.rb +98 -0
- data/lib/xero_ap_is/models/balances.rb +89 -0
- data/lib/xero_ap_is/models/bank_account_type.rb +44 -0
- data/lib/xero_ap_is/models/bank_transaction.rb +319 -0
- data/lib/xero_ap_is/models/bank_transactions.rb +114 -0
- data/lib/xero_ap_is/models/bank_transfer.rb +224 -0
- data/lib/xero_ap_is/models/bank_transfers.rb +85 -0
- data/lib/xero_ap_is/models/base_model.rb +110 -0
- data/lib/xero_ap_is/models/batch_payment.rb +275 -0
- data/lib/xero_ap_is/models/batch_payment_delete.rb +84 -0
- data/lib/xero_ap_is/models/batch_payment_delete_by_url_param.rb +73 -0
- data/lib/xero_ap_is/models/batch_payment_details.rb +128 -0
- data/lib/xero_ap_is/models/batch_payments.rb +85 -0
- data/lib/xero_ap_is/models/bill.rb +85 -0
- data/lib/xero_ap_is/models/book_depreciation_detail.rb +243 -0
- data/lib/xero_ap_is/models/book_depreciation_setting.rb +170 -0
- data/lib/xero_ap_is/models/branding_theme.rb +129 -0
- data/lib/xero_ap_is/models/branding_themes.rb +85 -0
- data/lib/xero_ap_is/models/budget.rb +145 -0
- data/lib/xero_ap_is/models/budget_balance.rb +105 -0
- data/lib/xero_ap_is/models/budget_line.rb +105 -0
- data/lib/xero_ap_is/models/budgets.rb +84 -0
- data/lib/xero_ap_is/models/charge_type.rb +42 -0
- data/lib/xero_ap_is/models/cis_org_setting.rb +105 -0
- data/lib/xero_ap_is/models/cis_org_settings.rb +85 -0
- data/lib/xero_ap_is/models/cis_setting.rb +86 -0
- data/lib/xero_ap_is/models/cis_settings.rb +85 -0
- data/lib/xero_ap_is/models/class1.rb +113 -0
- data/lib/xero_ap_is/models/connection.rb +155 -0
- data/lib/xero_ap_is/models/contact.rb +661 -0
- data/lib/xero_ap_is/models/contact_group.rb +119 -0
- data/lib/xero_ap_is/models/contact_groups.rb +85 -0
- data/lib/xero_ap_is/models/contact_person.rb +108 -0
- data/lib/xero_ap_is/models/contact_status.rb +40 -0
- data/lib/xero_ap_is/models/contacts.rb +113 -0
- data/lib/xero_ap_is/models/conversion_balances.rb +108 -0
- data/lib/xero_ap_is/models/conversion_date.rb +87 -0
- data/lib/xero_ap_is/models/country_code.rb +990 -0
- data/lib/xero_ap_is/models/credit_debit_indicator.rb +37 -0
- data/lib/xero_ap_is/models/credit_note.rb +453 -0
- data/lib/xero_ap_is/models/credit_notes.rb +113 -0
- data/lib/xero_ap_is/models/currencies.rb +85 -0
- data/lib/xero_ap_is/models/currency.rb +85 -0
- data/lib/xero_ap_is/models/currency_code.rb +700 -0
- data/lib/xero_ap_is/models/currency_code1.rb +680 -0
- data/lib/xero_ap_is/models/depreciation_calculation_method.rb +40 -0
- data/lib/xero_ap_is/models/depreciation_method.rb +52 -0
- data/lib/xero_ap_is/models/due_date_type.rb +52 -0
- data/lib/xero_ap_is/models/edition.rb +38 -0
- data/lib/xero_ap_is/models/element.rb +160 -0
- data/lib/xero_ap_is/models/employee.rb +160 -0
- data/lib/xero_ap_is/models/employees.rb +85 -0
- data/lib/xero_ap_is/models/end_balance.rb +89 -0
- data/lib/xero_ap_is/models/error1.rb +138 -0
- data/lib/xero_ap_is/models/error2.rb +106 -0
- data/lib/xero_ap_is/models/error3.rb +85 -0
- data/lib/xero_ap_is/models/expense_claim.rb +209 -0
- data/lib/xero_ap_is/models/expense_claims.rb +85 -0
- data/lib/xero_ap_is/models/external_link.rb +95 -0
- data/lib/xero_ap_is/models/federal_tax_classification.rb +56 -0
- data/lib/xero_ap_is/models/feed_connection.rb +177 -0
- data/lib/xero_ap_is/models/feed_connections.rb +94 -0
- data/lib/xero_ap_is/models/field_validation_errors_element.rb +127 -0
- data/lib/xero_ap_is/models/history_record.rb +105 -0
- data/lib/xero_ap_is/models/history_records.rb +85 -0
- data/lib/xero_ap_is/models/import_summary.rb +87 -0
- data/lib/xero_ap_is/models/import_summary_accounts.rb +154 -0
- data/lib/xero_ap_is/models/import_summary_object.rb +76 -0
- data/lib/xero_ap_is/models/import_summary_organisation.rb +75 -0
- data/lib/xero_ap_is/models/invoice.rb +586 -0
- data/lib/xero_ap_is/models/invoice_address.rb +158 -0
- data/lib/xero_ap_is/models/invoice_address_type.rb +37 -0
- data/lib/xero_ap_is/models/invoice_reminder.rb +75 -0
- data/lib/xero_ap_is/models/invoice_reminders.rb +85 -0
- data/lib/xero_ap_is/models/invoices.rb +113 -0
- data/lib/xero_ap_is/models/item.rb +259 -0
- data/lib/xero_ap_is/models/items.rb +84 -0
- data/lib/xero_ap_is/models/journal.rb +157 -0
- data/lib/xero_ap_is/models/journal_line.rb +201 -0
- data/lib/xero_ap_is/models/journals.rb +103 -0
- data/lib/xero_ap_is/models/line_amount_types.rb +41 -0
- data/lib/xero_ap_is/models/line_item.rb +287 -0
- data/lib/xero_ap_is/models/line_item_item.rb +95 -0
- data/lib/xero_ap_is/models/line_item_tracking.rb +108 -0
- data/lib/xero_ap_is/models/link_type.rb +48 -0
- data/lib/xero_ap_is/models/linked_transaction.rb +215 -0
- data/lib/xero_ap_is/models/linked_transactions.rb +85 -0
- data/lib/xero_ap_is/models/manual_journal.rb +255 -0
- data/lib/xero_ap_is/models/manual_journal_line.rb +156 -0
- data/lib/xero_ap_is/models/manual_journals.rb +114 -0
- data/lib/xero_ap_is/models/mclass.rb +48 -0
- data/lib/xero_ap_is/models/oauth_provider_error.rb +62 -0
- data/lib/xero_ap_is/models/oauth_scope_oauth_2.rb +113 -0
- data/lib/xero_ap_is/models/oauth_token.rb +96 -0
- data/lib/xero_ap_is/models/online_invoice.rb +77 -0
- data/lib/xero_ap_is/models/online_invoices.rb +85 -0
- data/lib/xero_ap_is/models/order_by.rb +56 -0
- data/lib/xero_ap_is/models/organisation.rb +467 -0
- data/lib/xero_ap_is/models/organisation_entity_type.rb +80 -0
- data/lib/xero_ap_is/models/organisation_role.rb +61 -0
- data/lib/xero_ap_is/models/organisation_type.rb +80 -0
- data/lib/xero_ap_is/models/organisations.rb +85 -0
- data/lib/xero_ap_is/models/overpayment.rb +309 -0
- data/lib/xero_ap_is/models/overpayments.rb +113 -0
- data/lib/xero_ap_is/models/pagination.rb +105 -0
- data/lib/xero_ap_is/models/payment.rb +381 -0
- data/lib/xero_ap_is/models/payment_delete.rb +73 -0
- data/lib/xero_ap_is/models/payment_service.rb +143 -0
- data/lib/xero_ap_is/models/payment_services.rb +85 -0
- data/lib/xero_ap_is/models/payment_term.rb +85 -0
- data/lib/xero_ap_is/models/payment_term_type.rb +44 -0
- data/lib/xero_ap_is/models/payment_type.rb +60 -0
- data/lib/xero_ap_is/models/payments.rb +113 -0
- data/lib/xero_ap_is/models/phone.rb +108 -0
- data/lib/xero_ap_is/models/phone_type.rb +48 -0
- data/lib/xero_ap_is/models/prepayment.rb +309 -0
- data/lib/xero_ap_is/models/prepayments.rb +113 -0
- data/lib/xero_ap_is/models/project.rb +328 -0
- data/lib/xero_ap_is/models/project_create_or_update.rb +115 -0
- data/lib/xero_ap_is/models/project_patch.rb +73 -0
- data/lib/xero_ap_is/models/project_status.rb +36 -0
- data/lib/xero_ap_is/models/project_user.rb +95 -0
- data/lib/xero_ap_is/models/project_users.rb +94 -0
- data/lib/xero_ap_is/models/projects.rb +94 -0
- data/lib/xero_ap_is/models/purchase.rb +112 -0
- data/lib/xero_ap_is/models/purchase_order.rb +408 -0
- data/lib/xero_ap_is/models/purchase_orders.rb +114 -0
- data/lib/xero_ap_is/models/purchases_default_line_amount_type.rb +42 -0
- data/lib/xero_ap_is/models/quote.rb +338 -0
- data/lib/xero_ap_is/models/quote_line_amount_types.rb +41 -0
- data/lib/xero_ap_is/models/quote_status_codes.rb +52 -0
- data/lib/xero_ap_is/models/quotes.rb +84 -0
- data/lib/xero_ap_is/models/receipt.rb +287 -0
- data/lib/xero_ap_is/models/receipts.rb +84 -0
- data/lib/xero_ap_is/models/refresh_token.rb +106 -0
- data/lib/xero_ap_is/models/repeating_invoice.rb +290 -0
- data/lib/xero_ap_is/models/repeating_invoices.rb +85 -0
- data/lib/xero_ap_is/models/report.rb +136 -0
- data/lib/xero_ap_is/models/report_attribute.rb +85 -0
- data/lib/xero_ap_is/models/report_cell.rb +94 -0
- data/lib/xero_ap_is/models/report_fields.rb +95 -0
- data/lib/xero_ap_is/models/report_row.rb +104 -0
- data/lib/xero_ap_is/models/report_rows.rb +123 -0
- data/lib/xero_ap_is/models/report_tax_type.rb +424 -0
- data/lib/xero_ap_is/models/report_type.rb +26 -0
- data/lib/xero_ap_is/models/report_with_row.rb +176 -0
- data/lib/xero_ap_is/models/report_with_rows.rb +84 -0
- data/lib/xero_ap_is/models/reports.rb +84 -0
- data/lib/xero_ap_is/models/request_empty.rb +75 -0
- data/lib/xero_ap_is/models/resource_validation_errors_element.rb +116 -0
- data/lib/xero_ap_is/models/row_type.rb +44 -0
- data/lib/xero_ap_is/models/sales_default_line_amount_type.rb +42 -0
- data/lib/xero_ap_is/models/sales_tax_basis.rb +60 -0
- data/lib/xero_ap_is/models/sales_tax_period.rb +88 -0
- data/lib/xero_ap_is/models/sales_tracking_category.rb +89 -0
- data/lib/xero_ap_is/models/schedule.rb +140 -0
- data/lib/xero_ap_is/models/setting.rb +175 -0
- data/lib/xero_ap_is/models/setup.rb +117 -0
- data/lib/xero_ap_is/models/sort_direction.rb +36 -0
- data/lib/xero_ap_is/models/source_transaction_type_code.rb +38 -0
- data/lib/xero_ap_is/models/source_type.rb +128 -0
- data/lib/xero_ap_is/models/start_balance.rb +88 -0
- data/lib/xero_ap_is/models/statement.rb +194 -0
- data/lib/xero_ap_is/models/statement_line.rb +162 -0
- data/lib/xero_ap_is/models/statements.rb +94 -0
- data/lib/xero_ap_is/models/status.rb +41 -0
- data/lib/xero_ap_is/models/status1.rb +38 -0
- data/lib/xero_ap_is/models/status10.rb +40 -0
- data/lib/xero_ap_is/models/status11.rb +44 -0
- data/lib/xero_ap_is/models/status110.rb +40 -0
- data/lib/xero_ap_is/models/status111.rb +43 -0
- data/lib/xero_ap_is/models/status12.rb +48 -0
- data/lib/xero_ap_is/models/status13.rb +48 -0
- data/lib/xero_ap_is/models/status14.rb +52 -0
- data/lib/xero_ap_is/models/status15.rb +48 -0
- data/lib/xero_ap_is/models/status16.rb +36 -0
- data/lib/xero_ap_is/models/status17.rb +48 -0
- data/lib/xero_ap_is/models/status18.rb +40 -0
- data/lib/xero_ap_is/models/status19.rb +44 -0
- data/lib/xero_ap_is/models/status2.rb +40 -0
- data/lib/xero_ap_is/models/status20.rb +48 -0
- data/lib/xero_ap_is/models/status21.rb +36 -0
- data/lib/xero_ap_is/models/status22.rb +44 -0
- data/lib/xero_ap_is/models/status3.rb +52 -0
- data/lib/xero_ap_is/models/status4.rb +40 -0
- data/lib/xero_ap_is/models/status5.rb +40 -0
- data/lib/xero_ap_is/models/status6.rb +52 -0
- data/lib/xero_ap_is/models/status7.rb +36 -0
- data/lib/xero_ap_is/models/status8.rb +37 -0
- data/lib/xero_ap_is/models/status9.rb +40 -0
- data/lib/xero_ap_is/models/system_account.rb +110 -0
- data/lib/xero_ap_is/models/task.rb +234 -0
- data/lib/xero_ap_is/models/task_create_or_update.rb +105 -0
- data/lib/xero_ap_is/models/tasks.rb +94 -0
- data/lib/xero_ap_is/models/tax_breakdown_component.rb +172 -0
- data/lib/xero_ap_is/models/tax_component.rb +108 -0
- data/lib/xero_ap_is/models/tax_number_type.rb +45 -0
- data/lib/xero_ap_is/models/tax_rate.rb +213 -0
- data/lib/xero_ap_is/models/tax_rates.rb +85 -0
- data/lib/xero_ap_is/models/tax_type.rb +520 -0
- data/lib/xero_ap_is/models/taxability.rb +48 -0
- data/lib/xero_ap_is/models/ten_ninety_nine_contact.rb +318 -0
- data/lib/xero_ap_is/models/time_entries.rb +94 -0
- data/lib/xero_ap_is/models/time_entry.rb +179 -0
- data/lib/xero_ap_is/models/time_entry_create_or_update.rb +120 -0
- data/lib/xero_ap_is/models/time_zone.rb +592 -0
- data/lib/xero_ap_is/models/timeframe.rb +40 -0
- data/lib/xero_ap_is/models/tracking_categories.rb +85 -0
- data/lib/xero_ap_is/models/tracking_category.rb +140 -0
- data/lib/xero_ap_is/models/tracking_option.rb +109 -0
- data/lib/xero_ap_is/models/tracking_options.rb +84 -0
- data/lib/xero_ap_is/models/type.rb +60 -0
- data/lib/xero_ap_is/models/type1.rb +26 -0
- data/lib/xero_ap_is/models/type10.rb +36 -0
- data/lib/xero_ap_is/models/type11.rb +114 -0
- data/lib/xero_ap_is/models/type2.rb +48 -0
- data/lib/xero_ap_is/models/type3.rb +60 -0
- data/lib/xero_ap_is/models/type4.rb +44 -0
- data/lib/xero_ap_is/models/type5.rb +40 -0
- data/lib/xero_ap_is/models/type6.rb +36 -0
- data/lib/xero_ap_is/models/type7.rb +37 -0
- data/lib/xero_ap_is/models/type8.rb +36 -0
- data/lib/xero_ap_is/models/type9.rb +26 -0
- data/lib/xero_ap_is/models/unit.rb +36 -0
- data/lib/xero_ap_is/models/user.rb +139 -0
- data/lib/xero_ap_is/models/users.rb +84 -0
- data/lib/xero_ap_is/models/validation_error.rb +75 -0
- data/lib/xero_ap_is/models/version.rb +68 -0
- data/lib/xero_ap_is/utilities/date_time_helper.rb +11 -0
- data/lib/xero_ap_is/utilities/file_wrapper.rb +28 -0
- data/lib/xero_ap_is.rb +309 -0
- metadata +372 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
# xero_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module XeroApIs
|
|
7
|
+
# PurchaseOrder Model.
|
|
8
|
+
class PurchaseOrder < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Contact]
|
|
14
|
+
attr_accessor :contact
|
|
15
|
+
|
|
16
|
+
# See LineItems
|
|
17
|
+
# @return [Array[LineItem]]
|
|
18
|
+
attr_accessor :line_items
|
|
19
|
+
|
|
20
|
+
# Date purchase order was issued – YYYY-MM-DD. If the Date element is not
|
|
21
|
+
# specified then it will default to the current date based on the timezone
|
|
22
|
+
# setting of the organisation
|
|
23
|
+
# @return [String]
|
|
24
|
+
attr_accessor :date
|
|
25
|
+
|
|
26
|
+
# Date the goods are to be delivered – YYYY-MM-DD
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :delivery_date
|
|
29
|
+
|
|
30
|
+
# Line amounts are exclusive of tax by default if you don’t specify this
|
|
31
|
+
# element. See Line Amount Types
|
|
32
|
+
# @return [LineAmountTypes]
|
|
33
|
+
attr_accessor :line_amount_types
|
|
34
|
+
|
|
35
|
+
# Unique alpha numeric code identifying purchase order (when missing will
|
|
36
|
+
# auto-generate from your Organisation Invoice Settings)
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :purchase_order_number
|
|
39
|
+
|
|
40
|
+
# Additional reference number
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :reference
|
|
43
|
+
|
|
44
|
+
# See BrandingThemes
|
|
45
|
+
# @return [UUID | String]
|
|
46
|
+
attr_accessor :branding_theme_id
|
|
47
|
+
|
|
48
|
+
# 3 letter alpha code for the currency – see list of currency codes
|
|
49
|
+
# @return [CurrencyCode]
|
|
50
|
+
attr_accessor :currency_code
|
|
51
|
+
|
|
52
|
+
# See Purchase Order Status Codes
|
|
53
|
+
# @return [Status17]
|
|
54
|
+
attr_accessor :status
|
|
55
|
+
|
|
56
|
+
# Boolean to set whether the purchase order should be marked as “sent”. This
|
|
57
|
+
# can be set only on purchase orders that have been approved or billed
|
|
58
|
+
# @return [TrueClass | FalseClass]
|
|
59
|
+
attr_accessor :sent_to_contact
|
|
60
|
+
|
|
61
|
+
# The address the goods are to be delivered to
|
|
62
|
+
# @return [String]
|
|
63
|
+
attr_accessor :delivery_address
|
|
64
|
+
|
|
65
|
+
# The person that the delivery is going to
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :attention_to
|
|
68
|
+
|
|
69
|
+
# The phone number for the person accepting the delivery
|
|
70
|
+
# @return [String]
|
|
71
|
+
attr_accessor :telephone
|
|
72
|
+
|
|
73
|
+
# A free text feild for instructions (500 characters max)
|
|
74
|
+
# @return [String]
|
|
75
|
+
attr_accessor :delivery_instructions
|
|
76
|
+
|
|
77
|
+
# The date the goods are expected to arrive.
|
|
78
|
+
# @return [String]
|
|
79
|
+
attr_accessor :expected_arrival_date
|
|
80
|
+
|
|
81
|
+
# Xero generated unique identifier for purchase order
|
|
82
|
+
# @return [UUID | String]
|
|
83
|
+
attr_accessor :purchase_order_id
|
|
84
|
+
|
|
85
|
+
# The currency rate for a multicurrency purchase order. If no rate is
|
|
86
|
+
# specified, the XE.com day rate is used.
|
|
87
|
+
# @return [Float]
|
|
88
|
+
attr_accessor :currency_rate
|
|
89
|
+
|
|
90
|
+
# Total of purchase order excluding taxes
|
|
91
|
+
# @return [Float]
|
|
92
|
+
attr_accessor :sub_total
|
|
93
|
+
|
|
94
|
+
# Total tax on purchase order
|
|
95
|
+
# @return [Float]
|
|
96
|
+
attr_accessor :total_tax
|
|
97
|
+
|
|
98
|
+
# Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax)
|
|
99
|
+
# @return [Float]
|
|
100
|
+
attr_accessor :total
|
|
101
|
+
|
|
102
|
+
# Total of discounts applied on the purchase order line items
|
|
103
|
+
# @return [Float]
|
|
104
|
+
attr_accessor :total_discount
|
|
105
|
+
|
|
106
|
+
# boolean to indicate if a purchase order has an attachment
|
|
107
|
+
# @return [TrueClass | FalseClass]
|
|
108
|
+
attr_accessor :has_attachments
|
|
109
|
+
|
|
110
|
+
# Last modified date UTC format
|
|
111
|
+
# @return [String]
|
|
112
|
+
attr_accessor :updated_date_utc
|
|
113
|
+
|
|
114
|
+
# A string to indicate if a invoice status
|
|
115
|
+
# @return [String]
|
|
116
|
+
attr_accessor :status_attribute_string
|
|
117
|
+
|
|
118
|
+
# Displays array of validation error messages from the API
|
|
119
|
+
# @return [Array[ValidationError]]
|
|
120
|
+
attr_accessor :validation_errors
|
|
121
|
+
|
|
122
|
+
# Displays array of warning messages from the API
|
|
123
|
+
# @return [Array[ValidationError]]
|
|
124
|
+
attr_accessor :warnings
|
|
125
|
+
|
|
126
|
+
# Displays array of attachments from the API
|
|
127
|
+
# @return [Array[Attachment]]
|
|
128
|
+
attr_accessor :attachments
|
|
129
|
+
|
|
130
|
+
# A mapping from model property names to API property names.
|
|
131
|
+
def self.names
|
|
132
|
+
@_hash = {} if @_hash.nil?
|
|
133
|
+
@_hash['contact'] = 'Contact'
|
|
134
|
+
@_hash['line_items'] = 'LineItems'
|
|
135
|
+
@_hash['date'] = 'Date'
|
|
136
|
+
@_hash['delivery_date'] = 'DeliveryDate'
|
|
137
|
+
@_hash['line_amount_types'] = 'LineAmountTypes'
|
|
138
|
+
@_hash['purchase_order_number'] = 'PurchaseOrderNumber'
|
|
139
|
+
@_hash['reference'] = 'Reference'
|
|
140
|
+
@_hash['branding_theme_id'] = 'BrandingThemeID'
|
|
141
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
|
142
|
+
@_hash['status'] = 'Status'
|
|
143
|
+
@_hash['sent_to_contact'] = 'SentToContact'
|
|
144
|
+
@_hash['delivery_address'] = 'DeliveryAddress'
|
|
145
|
+
@_hash['attention_to'] = 'AttentionTo'
|
|
146
|
+
@_hash['telephone'] = 'Telephone'
|
|
147
|
+
@_hash['delivery_instructions'] = 'DeliveryInstructions'
|
|
148
|
+
@_hash['expected_arrival_date'] = 'ExpectedArrivalDate'
|
|
149
|
+
@_hash['purchase_order_id'] = 'PurchaseOrderID'
|
|
150
|
+
@_hash['currency_rate'] = 'CurrencyRate'
|
|
151
|
+
@_hash['sub_total'] = 'SubTotal'
|
|
152
|
+
@_hash['total_tax'] = 'TotalTax'
|
|
153
|
+
@_hash['total'] = 'Total'
|
|
154
|
+
@_hash['total_discount'] = 'TotalDiscount'
|
|
155
|
+
@_hash['has_attachments'] = 'HasAttachments'
|
|
156
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
157
|
+
@_hash['status_attribute_string'] = 'StatusAttributeString'
|
|
158
|
+
@_hash['validation_errors'] = 'ValidationErrors'
|
|
159
|
+
@_hash['warnings'] = 'Warnings'
|
|
160
|
+
@_hash['attachments'] = 'Attachments'
|
|
161
|
+
@_hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# An array for optional fields
|
|
165
|
+
def self.optionals
|
|
166
|
+
%w[
|
|
167
|
+
contact
|
|
168
|
+
line_items
|
|
169
|
+
date
|
|
170
|
+
delivery_date
|
|
171
|
+
line_amount_types
|
|
172
|
+
purchase_order_number
|
|
173
|
+
reference
|
|
174
|
+
branding_theme_id
|
|
175
|
+
currency_code
|
|
176
|
+
status
|
|
177
|
+
sent_to_contact
|
|
178
|
+
delivery_address
|
|
179
|
+
attention_to
|
|
180
|
+
telephone
|
|
181
|
+
delivery_instructions
|
|
182
|
+
expected_arrival_date
|
|
183
|
+
purchase_order_id
|
|
184
|
+
currency_rate
|
|
185
|
+
sub_total
|
|
186
|
+
total_tax
|
|
187
|
+
total
|
|
188
|
+
total_discount
|
|
189
|
+
has_attachments
|
|
190
|
+
updated_date_utc
|
|
191
|
+
status_attribute_string
|
|
192
|
+
validation_errors
|
|
193
|
+
warnings
|
|
194
|
+
attachments
|
|
195
|
+
]
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# An array for nullable fields
|
|
199
|
+
def self.nullables
|
|
200
|
+
[]
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def initialize(contact: SKIP, line_items: SKIP, date: SKIP,
|
|
204
|
+
delivery_date: SKIP, line_amount_types: SKIP,
|
|
205
|
+
purchase_order_number: SKIP, reference: SKIP,
|
|
206
|
+
branding_theme_id: SKIP, currency_code: SKIP, status: SKIP,
|
|
207
|
+
sent_to_contact: SKIP, delivery_address: SKIP,
|
|
208
|
+
attention_to: SKIP, telephone: SKIP,
|
|
209
|
+
delivery_instructions: SKIP, expected_arrival_date: SKIP,
|
|
210
|
+
purchase_order_id: SKIP, currency_rate: SKIP,
|
|
211
|
+
sub_total: SKIP, total_tax: SKIP, total: SKIP,
|
|
212
|
+
total_discount: SKIP, has_attachments: false,
|
|
213
|
+
updated_date_utc: SKIP, status_attribute_string: SKIP,
|
|
214
|
+
validation_errors: SKIP, warnings: SKIP, attachments: SKIP,
|
|
215
|
+
additional_properties: nil)
|
|
216
|
+
# Add additional model properties to the instance
|
|
217
|
+
additional_properties = {} if additional_properties.nil?
|
|
218
|
+
|
|
219
|
+
@contact = contact unless contact == SKIP
|
|
220
|
+
@line_items = line_items unless line_items == SKIP
|
|
221
|
+
@date = date unless date == SKIP
|
|
222
|
+
@delivery_date = delivery_date unless delivery_date == SKIP
|
|
223
|
+
@line_amount_types = line_amount_types unless line_amount_types == SKIP
|
|
224
|
+
@purchase_order_number = purchase_order_number unless purchase_order_number == SKIP
|
|
225
|
+
@reference = reference unless reference == SKIP
|
|
226
|
+
@branding_theme_id = branding_theme_id unless branding_theme_id == SKIP
|
|
227
|
+
@currency_code = currency_code unless currency_code == SKIP
|
|
228
|
+
@status = status unless status == SKIP
|
|
229
|
+
@sent_to_contact = sent_to_contact unless sent_to_contact == SKIP
|
|
230
|
+
@delivery_address = delivery_address unless delivery_address == SKIP
|
|
231
|
+
@attention_to = attention_to unless attention_to == SKIP
|
|
232
|
+
@telephone = telephone unless telephone == SKIP
|
|
233
|
+
@delivery_instructions = delivery_instructions unless delivery_instructions == SKIP
|
|
234
|
+
@expected_arrival_date = expected_arrival_date unless expected_arrival_date == SKIP
|
|
235
|
+
@purchase_order_id = purchase_order_id unless purchase_order_id == SKIP
|
|
236
|
+
@currency_rate = currency_rate unless currency_rate == SKIP
|
|
237
|
+
@sub_total = sub_total unless sub_total == SKIP
|
|
238
|
+
@total_tax = total_tax unless total_tax == SKIP
|
|
239
|
+
@total = total unless total == SKIP
|
|
240
|
+
@total_discount = total_discount unless total_discount == SKIP
|
|
241
|
+
@has_attachments = has_attachments unless has_attachments == SKIP
|
|
242
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
243
|
+
@status_attribute_string = status_attribute_string unless status_attribute_string == SKIP
|
|
244
|
+
@validation_errors = validation_errors unless validation_errors == SKIP
|
|
245
|
+
@warnings = warnings unless warnings == SKIP
|
|
246
|
+
@attachments = attachments unless attachments == SKIP
|
|
247
|
+
@additional_properties = additional_properties
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Creates an instance of the object from a hash.
|
|
251
|
+
def self.from_hash(hash)
|
|
252
|
+
return nil unless hash
|
|
253
|
+
|
|
254
|
+
# Extract variables from the hash.
|
|
255
|
+
contact = Contact.from_hash(hash['Contact']) if hash['Contact']
|
|
256
|
+
# Parameter is an array, so we need to iterate through it
|
|
257
|
+
line_items = nil
|
|
258
|
+
unless hash['LineItems'].nil?
|
|
259
|
+
line_items = []
|
|
260
|
+
hash['LineItems'].each do |structure|
|
|
261
|
+
line_items << (LineItem.from_hash(structure) if structure)
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
line_items = SKIP unless hash.key?('LineItems')
|
|
266
|
+
date = hash.key?('Date') ? hash['Date'] : SKIP
|
|
267
|
+
delivery_date = hash.key?('DeliveryDate') ? hash['DeliveryDate'] : SKIP
|
|
268
|
+
line_amount_types =
|
|
269
|
+
hash.key?('LineAmountTypes') ? hash['LineAmountTypes'] : SKIP
|
|
270
|
+
purchase_order_number =
|
|
271
|
+
hash.key?('PurchaseOrderNumber') ? hash['PurchaseOrderNumber'] : SKIP
|
|
272
|
+
reference = hash.key?('Reference') ? hash['Reference'] : SKIP
|
|
273
|
+
branding_theme_id =
|
|
274
|
+
hash.key?('BrandingThemeID') ? hash['BrandingThemeID'] : SKIP
|
|
275
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
|
276
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
|
277
|
+
sent_to_contact =
|
|
278
|
+
hash.key?('SentToContact') ? hash['SentToContact'] : SKIP
|
|
279
|
+
delivery_address =
|
|
280
|
+
hash.key?('DeliveryAddress') ? hash['DeliveryAddress'] : SKIP
|
|
281
|
+
attention_to = hash.key?('AttentionTo') ? hash['AttentionTo'] : SKIP
|
|
282
|
+
telephone = hash.key?('Telephone') ? hash['Telephone'] : SKIP
|
|
283
|
+
delivery_instructions =
|
|
284
|
+
hash.key?('DeliveryInstructions') ? hash['DeliveryInstructions'] : SKIP
|
|
285
|
+
expected_arrival_date =
|
|
286
|
+
hash.key?('ExpectedArrivalDate') ? hash['ExpectedArrivalDate'] : SKIP
|
|
287
|
+
purchase_order_id =
|
|
288
|
+
hash.key?('PurchaseOrderID') ? hash['PurchaseOrderID'] : SKIP
|
|
289
|
+
currency_rate = hash.key?('CurrencyRate') ? hash['CurrencyRate'] : SKIP
|
|
290
|
+
sub_total = hash.key?('SubTotal') ? hash['SubTotal'] : SKIP
|
|
291
|
+
total_tax = hash.key?('TotalTax') ? hash['TotalTax'] : SKIP
|
|
292
|
+
total = hash.key?('Total') ? hash['Total'] : SKIP
|
|
293
|
+
total_discount = hash.key?('TotalDiscount') ? hash['TotalDiscount'] : SKIP
|
|
294
|
+
has_attachments = hash['HasAttachments'] ||= false
|
|
295
|
+
updated_date_utc =
|
|
296
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
297
|
+
status_attribute_string =
|
|
298
|
+
hash.key?('StatusAttributeString') ? hash['StatusAttributeString'] : SKIP
|
|
299
|
+
# Parameter is an array, so we need to iterate through it
|
|
300
|
+
validation_errors = nil
|
|
301
|
+
unless hash['ValidationErrors'].nil?
|
|
302
|
+
validation_errors = []
|
|
303
|
+
hash['ValidationErrors'].each do |structure|
|
|
304
|
+
validation_errors << (ValidationError.from_hash(structure) if structure)
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
validation_errors = SKIP unless hash.key?('ValidationErrors')
|
|
309
|
+
# Parameter is an array, so we need to iterate through it
|
|
310
|
+
warnings = nil
|
|
311
|
+
unless hash['Warnings'].nil?
|
|
312
|
+
warnings = []
|
|
313
|
+
hash['Warnings'].each do |structure|
|
|
314
|
+
warnings << (ValidationError.from_hash(structure) if structure)
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
319
|
+
# Parameter is an array, so we need to iterate through it
|
|
320
|
+
attachments = nil
|
|
321
|
+
unless hash['Attachments'].nil?
|
|
322
|
+
attachments = []
|
|
323
|
+
hash['Attachments'].each do |structure|
|
|
324
|
+
attachments << (Attachment.from_hash(structure) if structure)
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
attachments = SKIP unless hash.key?('Attachments')
|
|
329
|
+
|
|
330
|
+
# Create a new hash for additional properties, removing known properties.
|
|
331
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
332
|
+
|
|
333
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
334
|
+
new_hash, proc { |value| value }
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
# Create object from extracted values.
|
|
338
|
+
PurchaseOrder.new(contact: contact,
|
|
339
|
+
line_items: line_items,
|
|
340
|
+
date: date,
|
|
341
|
+
delivery_date: delivery_date,
|
|
342
|
+
line_amount_types: line_amount_types,
|
|
343
|
+
purchase_order_number: purchase_order_number,
|
|
344
|
+
reference: reference,
|
|
345
|
+
branding_theme_id: branding_theme_id,
|
|
346
|
+
currency_code: currency_code,
|
|
347
|
+
status: status,
|
|
348
|
+
sent_to_contact: sent_to_contact,
|
|
349
|
+
delivery_address: delivery_address,
|
|
350
|
+
attention_to: attention_to,
|
|
351
|
+
telephone: telephone,
|
|
352
|
+
delivery_instructions: delivery_instructions,
|
|
353
|
+
expected_arrival_date: expected_arrival_date,
|
|
354
|
+
purchase_order_id: purchase_order_id,
|
|
355
|
+
currency_rate: currency_rate,
|
|
356
|
+
sub_total: sub_total,
|
|
357
|
+
total_tax: total_tax,
|
|
358
|
+
total: total,
|
|
359
|
+
total_discount: total_discount,
|
|
360
|
+
has_attachments: has_attachments,
|
|
361
|
+
updated_date_utc: updated_date_utc,
|
|
362
|
+
status_attribute_string: status_attribute_string,
|
|
363
|
+
validation_errors: validation_errors,
|
|
364
|
+
warnings: warnings,
|
|
365
|
+
attachments: attachments,
|
|
366
|
+
additional_properties: additional_properties)
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# Provides a human-readable string representation of the object.
|
|
370
|
+
def to_s
|
|
371
|
+
class_name = self.class.name.split('::').last
|
|
372
|
+
"<#{class_name} contact: #{@contact}, line_items: #{@line_items}, date: #{@date},"\
|
|
373
|
+
" delivery_date: #{@delivery_date}, line_amount_types: #{@line_amount_types},"\
|
|
374
|
+
" purchase_order_number: #{@purchase_order_number}, reference: #{@reference},"\
|
|
375
|
+
" branding_theme_id: #{@branding_theme_id}, currency_code: #{@currency_code}, status:"\
|
|
376
|
+
" #{@status}, sent_to_contact: #{@sent_to_contact}, delivery_address: #{@delivery_address},"\
|
|
377
|
+
" attention_to: #{@attention_to}, telephone: #{@telephone}, delivery_instructions:"\
|
|
378
|
+
" #{@delivery_instructions}, expected_arrival_date: #{@expected_arrival_date},"\
|
|
379
|
+
" purchase_order_id: #{@purchase_order_id}, currency_rate: #{@currency_rate}, sub_total:"\
|
|
380
|
+
" #{@sub_total}, total_tax: #{@total_tax}, total: #{@total}, total_discount:"\
|
|
381
|
+
" #{@total_discount}, has_attachments: #{@has_attachments}, updated_date_utc:"\
|
|
382
|
+
" #{@updated_date_utc}, status_attribute_string: #{@status_attribute_string},"\
|
|
383
|
+
" validation_errors: #{@validation_errors}, warnings: #{@warnings}, attachments:"\
|
|
384
|
+
" #{@attachments}, additional_properties: #{@additional_properties}>"
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
388
|
+
def inspect
|
|
389
|
+
class_name = self.class.name.split('::').last
|
|
390
|
+
"<#{class_name} contact: #{@contact.inspect}, line_items: #{@line_items.inspect}, date:"\
|
|
391
|
+
" #{@date.inspect}, delivery_date: #{@delivery_date.inspect}, line_amount_types:"\
|
|
392
|
+
" #{@line_amount_types.inspect}, purchase_order_number: #{@purchase_order_number.inspect},"\
|
|
393
|
+
" reference: #{@reference.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\
|
|
394
|
+
" currency_code: #{@currency_code.inspect}, status: #{@status.inspect}, sent_to_contact:"\
|
|
395
|
+
" #{@sent_to_contact.inspect}, delivery_address: #{@delivery_address.inspect}, attention_to:"\
|
|
396
|
+
" #{@attention_to.inspect}, telephone: #{@telephone.inspect}, delivery_instructions:"\
|
|
397
|
+
" #{@delivery_instructions.inspect}, expected_arrival_date:"\
|
|
398
|
+
" #{@expected_arrival_date.inspect}, purchase_order_id: #{@purchase_order_id.inspect},"\
|
|
399
|
+
" currency_rate: #{@currency_rate.inspect}, sub_total: #{@sub_total.inspect}, total_tax:"\
|
|
400
|
+
" #{@total_tax.inspect}, total: #{@total.inspect}, total_discount:"\
|
|
401
|
+
" #{@total_discount.inspect}, has_attachments: #{@has_attachments.inspect},"\
|
|
402
|
+
" updated_date_utc: #{@updated_date_utc.inspect}, status_attribute_string:"\
|
|
403
|
+
" #{@status_attribute_string.inspect}, validation_errors: #{@validation_errors.inspect},"\
|
|
404
|
+
" warnings: #{@warnings.inspect}, attachments: #{@attachments.inspect},"\
|
|
405
|
+
" additional_properties: #{@additional_properties}>"
|
|
406
|
+
end
|
|
407
|
+
end
|
|
408
|
+
end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# xero_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module XeroApIs
|
|
7
|
+
# PurchaseOrders Model.
|
|
8
|
+
class PurchaseOrders < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Pagination]
|
|
14
|
+
attr_accessor :pagination
|
|
15
|
+
|
|
16
|
+
# Displays array of warning messages from the API
|
|
17
|
+
# @return [Array[ValidationError]]
|
|
18
|
+
attr_accessor :warnings
|
|
19
|
+
|
|
20
|
+
# Displays array of warning messages from the API
|
|
21
|
+
# @return [Array[PurchaseOrder]]
|
|
22
|
+
attr_accessor :purchase_orders
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['pagination'] = 'pagination'
|
|
28
|
+
@_hash['warnings'] = 'Warnings'
|
|
29
|
+
@_hash['purchase_orders'] = 'PurchaseOrders'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
pagination
|
|
37
|
+
warnings
|
|
38
|
+
purchase_orders
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(pagination: SKIP, warnings: SKIP, purchase_orders: SKIP,
|
|
48
|
+
additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@pagination = pagination unless pagination == SKIP
|
|
53
|
+
@warnings = warnings unless warnings == SKIP
|
|
54
|
+
@purchase_orders = purchase_orders unless purchase_orders == SKIP
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
pagination = Pagination.from_hash(hash['pagination']) if hash['pagination']
|
|
64
|
+
# Parameter is an array, so we need to iterate through it
|
|
65
|
+
warnings = nil
|
|
66
|
+
unless hash['Warnings'].nil?
|
|
67
|
+
warnings = []
|
|
68
|
+
hash['Warnings'].each do |structure|
|
|
69
|
+
warnings << (ValidationError.from_hash(structure) if structure)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
74
|
+
# Parameter is an array, so we need to iterate through it
|
|
75
|
+
purchase_orders = nil
|
|
76
|
+
unless hash['PurchaseOrders'].nil?
|
|
77
|
+
purchase_orders = []
|
|
78
|
+
hash['PurchaseOrders'].each do |structure|
|
|
79
|
+
purchase_orders << (PurchaseOrder.from_hash(structure) if structure)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
purchase_orders = SKIP unless hash.key?('PurchaseOrders')
|
|
84
|
+
|
|
85
|
+
# Create a new hash for additional properties, removing known properties.
|
|
86
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
87
|
+
|
|
88
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
89
|
+
new_hash, proc { |value| value }
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Create object from extracted values.
|
|
93
|
+
PurchaseOrders.new(pagination: pagination,
|
|
94
|
+
warnings: warnings,
|
|
95
|
+
purchase_orders: purchase_orders,
|
|
96
|
+
additional_properties: additional_properties)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a human-readable string representation of the object.
|
|
100
|
+
def to_s
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} pagination: #{@pagination}, warnings: #{@warnings}, purchase_orders:"\
|
|
103
|
+
" #{@purchase_orders}, additional_properties: #{@additional_properties}>"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
107
|
+
def inspect
|
|
108
|
+
class_name = self.class.name.split('::').last
|
|
109
|
+
"<#{class_name} pagination: #{@pagination.inspect}, warnings: #{@warnings.inspect},"\
|
|
110
|
+
" purchase_orders: #{@purchase_orders.inspect}, additional_properties:"\
|
|
111
|
+
" #{@additional_properties}>"
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# xero_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module XeroApIs
|
|
7
|
+
# The default purchases line amount type for a contact Only available when
|
|
8
|
+
# summaryOnly parameter or paging is used, or when fetch by ContactId or
|
|
9
|
+
# ContactNumber.
|
|
10
|
+
class PurchasesDefaultLineAmountType
|
|
11
|
+
PURCHASES_DEFAULT_LINE_AMOUNT_TYPE = [
|
|
12
|
+
# TODO: Write general description for INCLUSIVE
|
|
13
|
+
INCLUSIVE = 'INCLUSIVE'.freeze,
|
|
14
|
+
|
|
15
|
+
# TODO: Write general description for EXCLUSIVE
|
|
16
|
+
EXCLUSIVE = 'EXCLUSIVE'.freeze,
|
|
17
|
+
|
|
18
|
+
# TODO: Write general description for NONE
|
|
19
|
+
NONE = 'NONE'.freeze
|
|
20
|
+
].freeze
|
|
21
|
+
|
|
22
|
+
def self.validate(value)
|
|
23
|
+
return false if value.nil?
|
|
24
|
+
|
|
25
|
+
PURCHASES_DEFAULT_LINE_AMOUNT_TYPE.include?(value)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.from_value(value, default_value = INCLUSIVE)
|
|
29
|
+
return default_value if value.nil?
|
|
30
|
+
|
|
31
|
+
str = value.to_s.strip
|
|
32
|
+
|
|
33
|
+
case str.downcase
|
|
34
|
+
when 'inclusive' then INCLUSIVE
|
|
35
|
+
when 'exclusive' then EXCLUSIVE
|
|
36
|
+
when 'none' then NONE
|
|
37
|
+
else
|
|
38
|
+
default_value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|