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,40 @@
|
|
|
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
|
+
# See Asset Status Codes.
|
|
8
|
+
class AssetStatus
|
|
9
|
+
ASSET_STATUS = [
|
|
10
|
+
# TODO: Write general description for DRAFT
|
|
11
|
+
DRAFT = 'Draft'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for REGISTERED
|
|
14
|
+
REGISTERED = 'Registered'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DISPOSED
|
|
17
|
+
DISPOSED = 'Disposed'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
ASSET_STATUS.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = DRAFT)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'draft' then DRAFT
|
|
33
|
+
when 'registered' then REGISTERED
|
|
34
|
+
when 'disposed' then DISPOSED
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
# See Asset Status Codes.
|
|
8
|
+
class AssetStatusQueryParam
|
|
9
|
+
ASSET_STATUS_QUERY_PARAM = [
|
|
10
|
+
# TODO: Write general description for DRAFT
|
|
11
|
+
DRAFT = 'DRAFT'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for REGISTERED
|
|
14
|
+
REGISTERED = 'REGISTERED'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DISPOSED
|
|
17
|
+
DISPOSED = 'DISPOSED'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
ASSET_STATUS_QUERY_PARAM.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = DRAFT)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'draft' then DRAFT
|
|
33
|
+
when 'registered' then REGISTERED
|
|
34
|
+
when 'disposed' then DISPOSED
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
# AssetType Model.
|
|
8
|
+
class AssetType < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Xero generated unique identifier for asset types
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :asset_type_id
|
|
15
|
+
|
|
16
|
+
# The name of the asset type
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :asset_type_name
|
|
19
|
+
|
|
20
|
+
# The asset account for fixed assets of this type
|
|
21
|
+
# @return [UUID | String]
|
|
22
|
+
attr_accessor :fixed_asset_account_id
|
|
23
|
+
|
|
24
|
+
# The expense account for the depreciation of fixed assets of this type
|
|
25
|
+
# @return [UUID | String]
|
|
26
|
+
attr_accessor :depreciation_expense_account_id
|
|
27
|
+
|
|
28
|
+
# The account for accumulated depreciation of fixed assets of this type
|
|
29
|
+
# @return [UUID | String]
|
|
30
|
+
attr_accessor :accumulated_depreciation_account_id
|
|
31
|
+
|
|
32
|
+
# The account for accumulated depreciation of fixed assets of this type
|
|
33
|
+
# @return [BookDepreciationSetting]
|
|
34
|
+
attr_accessor :book_depreciation_setting
|
|
35
|
+
|
|
36
|
+
# All asset types that have accumulated depreciation for any assets that use
|
|
37
|
+
# them are deemed ‘locked’ and cannot be removed.
|
|
38
|
+
# @return [Integer]
|
|
39
|
+
attr_accessor :locks
|
|
40
|
+
|
|
41
|
+
# A mapping from model property names to API property names.
|
|
42
|
+
def self.names
|
|
43
|
+
@_hash = {} if @_hash.nil?
|
|
44
|
+
@_hash['asset_type_id'] = 'assetTypeId'
|
|
45
|
+
@_hash['asset_type_name'] = 'assetTypeName'
|
|
46
|
+
@_hash['fixed_asset_account_id'] = 'fixedAssetAccountId'
|
|
47
|
+
@_hash['depreciation_expense_account_id'] =
|
|
48
|
+
'depreciationExpenseAccountId'
|
|
49
|
+
@_hash['accumulated_depreciation_account_id'] =
|
|
50
|
+
'accumulatedDepreciationAccountId'
|
|
51
|
+
@_hash['book_depreciation_setting'] = 'bookDepreciationSetting'
|
|
52
|
+
@_hash['locks'] = 'locks'
|
|
53
|
+
@_hash
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# An array for optional fields
|
|
57
|
+
def self.optionals
|
|
58
|
+
%w[
|
|
59
|
+
asset_type_id
|
|
60
|
+
fixed_asset_account_id
|
|
61
|
+
depreciation_expense_account_id
|
|
62
|
+
accumulated_depreciation_account_id
|
|
63
|
+
locks
|
|
64
|
+
]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# An array for nullable fields
|
|
68
|
+
def self.nullables
|
|
69
|
+
[]
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def initialize(asset_type_name:, book_depreciation_setting:,
|
|
73
|
+
asset_type_id: SKIP, fixed_asset_account_id: SKIP,
|
|
74
|
+
depreciation_expense_account_id: SKIP,
|
|
75
|
+
accumulated_depreciation_account_id: SKIP, locks: SKIP,
|
|
76
|
+
additional_properties: nil)
|
|
77
|
+
# Add additional model properties to the instance
|
|
78
|
+
additional_properties = {} if additional_properties.nil?
|
|
79
|
+
|
|
80
|
+
@asset_type_id = asset_type_id unless asset_type_id == SKIP
|
|
81
|
+
@asset_type_name = asset_type_name
|
|
82
|
+
@fixed_asset_account_id = fixed_asset_account_id unless fixed_asset_account_id == SKIP
|
|
83
|
+
unless depreciation_expense_account_id == SKIP
|
|
84
|
+
@depreciation_expense_account_id =
|
|
85
|
+
depreciation_expense_account_id
|
|
86
|
+
end
|
|
87
|
+
unless accumulated_depreciation_account_id == SKIP
|
|
88
|
+
@accumulated_depreciation_account_id =
|
|
89
|
+
accumulated_depreciation_account_id
|
|
90
|
+
end
|
|
91
|
+
@book_depreciation_setting = book_depreciation_setting
|
|
92
|
+
@locks = locks unless locks == SKIP
|
|
93
|
+
@additional_properties = additional_properties
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Creates an instance of the object from a hash.
|
|
97
|
+
def self.from_hash(hash)
|
|
98
|
+
return nil unless hash
|
|
99
|
+
|
|
100
|
+
# Extract variables from the hash.
|
|
101
|
+
asset_type_name = hash.key?('assetTypeName') ? hash['assetTypeName'] : nil
|
|
102
|
+
if hash['bookDepreciationSetting']
|
|
103
|
+
book_depreciation_setting = BookDepreciationSetting.from_hash(hash['bookDepreciationSetting'])
|
|
104
|
+
end
|
|
105
|
+
asset_type_id = hash.key?('assetTypeId') ? hash['assetTypeId'] : SKIP
|
|
106
|
+
fixed_asset_account_id =
|
|
107
|
+
hash.key?('fixedAssetAccountId') ? hash['fixedAssetAccountId'] : SKIP
|
|
108
|
+
depreciation_expense_account_id =
|
|
109
|
+
hash.key?('depreciationExpenseAccountId') ? hash['depreciationExpenseAccountId'] : SKIP
|
|
110
|
+
accumulated_depreciation_account_id =
|
|
111
|
+
hash.key?('accumulatedDepreciationAccountId') ? hash['accumulatedDepreciationAccountId'] : SKIP
|
|
112
|
+
locks = hash.key?('locks') ? hash['locks'] : SKIP
|
|
113
|
+
|
|
114
|
+
# Create a new hash for additional properties, removing known properties.
|
|
115
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
116
|
+
|
|
117
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
118
|
+
new_hash, proc { |value| value }
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
# Create object from extracted values.
|
|
122
|
+
AssetType.new(asset_type_name: asset_type_name,
|
|
123
|
+
book_depreciation_setting: book_depreciation_setting,
|
|
124
|
+
asset_type_id: asset_type_id,
|
|
125
|
+
fixed_asset_account_id: fixed_asset_account_id,
|
|
126
|
+
depreciation_expense_account_id: depreciation_expense_account_id,
|
|
127
|
+
accumulated_depreciation_account_id: accumulated_depreciation_account_id,
|
|
128
|
+
locks: locks,
|
|
129
|
+
additional_properties: additional_properties)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Provides a human-readable string representation of the object.
|
|
133
|
+
def to_s
|
|
134
|
+
class_name = self.class.name.split('::').last
|
|
135
|
+
"<#{class_name} asset_type_id: #{@asset_type_id}, asset_type_name: #{@asset_type_name},"\
|
|
136
|
+
" fixed_asset_account_id: #{@fixed_asset_account_id}, depreciation_expense_account_id:"\
|
|
137
|
+
" #{@depreciation_expense_account_id}, accumulated_depreciation_account_id:"\
|
|
138
|
+
" #{@accumulated_depreciation_account_id}, book_depreciation_setting:"\
|
|
139
|
+
" #{@book_depreciation_setting}, locks: #{@locks}, additional_properties:"\
|
|
140
|
+
" #{@additional_properties}>"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
144
|
+
def inspect
|
|
145
|
+
class_name = self.class.name.split('::').last
|
|
146
|
+
"<#{class_name} asset_type_id: #{@asset_type_id.inspect}, asset_type_name:"\
|
|
147
|
+
" #{@asset_type_name.inspect}, fixed_asset_account_id: #{@fixed_asset_account_id.inspect},"\
|
|
148
|
+
" depreciation_expense_account_id: #{@depreciation_expense_account_id.inspect},"\
|
|
149
|
+
" accumulated_depreciation_account_id: #{@accumulated_depreciation_account_id.inspect},"\
|
|
150
|
+
" book_depreciation_setting: #{@book_depreciation_setting.inspect}, locks:"\
|
|
151
|
+
" #{@locks.inspect}, additional_properties: #{@additional_properties}>"
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
# Assets Model.
|
|
8
|
+
class Assets < 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
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Array[Asset]]
|
|
18
|
+
attr_accessor :items
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['pagination'] = 'pagination'
|
|
24
|
+
@_hash['items'] = 'items'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
pagination
|
|
32
|
+
items
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(pagination: SKIP, items: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@pagination = pagination unless pagination == SKIP
|
|
46
|
+
@items = items unless items == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
pagination = Pagination.from_hash(hash['pagination']) if hash['pagination']
|
|
56
|
+
# Parameter is an array, so we need to iterate through it
|
|
57
|
+
items = nil
|
|
58
|
+
unless hash['items'].nil?
|
|
59
|
+
items = []
|
|
60
|
+
hash['items'].each do |structure|
|
|
61
|
+
items << (Asset.from_hash(structure) if structure)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
items = SKIP unless hash.key?('items')
|
|
66
|
+
|
|
67
|
+
# Create a new hash for additional properties, removing known properties.
|
|
68
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
69
|
+
|
|
70
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
71
|
+
new_hash, proc { |value| value }
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
# Create object from extracted values.
|
|
75
|
+
Assets.new(pagination: pagination,
|
|
76
|
+
items: items,
|
|
77
|
+
additional_properties: additional_properties)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Provides a human-readable string representation of the object.
|
|
81
|
+
def to_s
|
|
82
|
+
class_name = self.class.name.split('::').last
|
|
83
|
+
"<#{class_name} pagination: #{@pagination}, items: #{@items}, additional_properties:"\
|
|
84
|
+
" #{@additional_properties}>"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
88
|
+
def inspect
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} pagination: #{@pagination.inspect}, items: #{@items.inspect},"\
|
|
91
|
+
" additional_properties: #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
# Attachment Model.
|
|
8
|
+
class Attachment < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Unique ID for the file
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :attachment_id
|
|
15
|
+
|
|
16
|
+
# Name of the file
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :file_name
|
|
19
|
+
|
|
20
|
+
# URL to the file on xero.com
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
# Type of file
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :mime_type
|
|
27
|
+
|
|
28
|
+
# Length of the file content
|
|
29
|
+
# @return [Integer]
|
|
30
|
+
attr_accessor :content_length
|
|
31
|
+
|
|
32
|
+
# Include the file with the online invoice
|
|
33
|
+
# @return [TrueClass | FalseClass]
|
|
34
|
+
attr_accessor :include_online
|
|
35
|
+
|
|
36
|
+
# A mapping from model property names to API property names.
|
|
37
|
+
def self.names
|
|
38
|
+
@_hash = {} if @_hash.nil?
|
|
39
|
+
@_hash['attachment_id'] = 'AttachmentID'
|
|
40
|
+
@_hash['file_name'] = 'FileName'
|
|
41
|
+
@_hash['url'] = 'Url'
|
|
42
|
+
@_hash['mime_type'] = 'MimeType'
|
|
43
|
+
@_hash['content_length'] = 'ContentLength'
|
|
44
|
+
@_hash['include_online'] = 'IncludeOnline'
|
|
45
|
+
@_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def self.optionals
|
|
50
|
+
%w[
|
|
51
|
+
attachment_id
|
|
52
|
+
file_name
|
|
53
|
+
url
|
|
54
|
+
mime_type
|
|
55
|
+
content_length
|
|
56
|
+
include_online
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# An array for nullable fields
|
|
61
|
+
def self.nullables
|
|
62
|
+
[]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def initialize(attachment_id: SKIP, file_name: SKIP, url: SKIP,
|
|
66
|
+
mime_type: SKIP, content_length: SKIP, include_online: SKIP,
|
|
67
|
+
additional_properties: nil)
|
|
68
|
+
# Add additional model properties to the instance
|
|
69
|
+
additional_properties = {} if additional_properties.nil?
|
|
70
|
+
|
|
71
|
+
@attachment_id = attachment_id unless attachment_id == SKIP
|
|
72
|
+
@file_name = file_name unless file_name == SKIP
|
|
73
|
+
@url = url unless url == SKIP
|
|
74
|
+
@mime_type = mime_type unless mime_type == SKIP
|
|
75
|
+
@content_length = content_length unless content_length == SKIP
|
|
76
|
+
@include_online = include_online unless include_online == SKIP
|
|
77
|
+
@additional_properties = additional_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Creates an instance of the object from a hash.
|
|
81
|
+
def self.from_hash(hash)
|
|
82
|
+
return nil unless hash
|
|
83
|
+
|
|
84
|
+
# Extract variables from the hash.
|
|
85
|
+
attachment_id = hash.key?('AttachmentID') ? hash['AttachmentID'] : SKIP
|
|
86
|
+
file_name = hash.key?('FileName') ? hash['FileName'] : SKIP
|
|
87
|
+
url = hash.key?('Url') ? hash['Url'] : SKIP
|
|
88
|
+
mime_type = hash.key?('MimeType') ? hash['MimeType'] : SKIP
|
|
89
|
+
content_length = hash.key?('ContentLength') ? hash['ContentLength'] : SKIP
|
|
90
|
+
include_online = hash.key?('IncludeOnline') ? hash['IncludeOnline'] : SKIP
|
|
91
|
+
|
|
92
|
+
# Create a new hash for additional properties, removing known properties.
|
|
93
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
94
|
+
|
|
95
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
96
|
+
new_hash, proc { |value| value }
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# Create object from extracted values.
|
|
100
|
+
Attachment.new(attachment_id: attachment_id,
|
|
101
|
+
file_name: file_name,
|
|
102
|
+
url: url,
|
|
103
|
+
mime_type: mime_type,
|
|
104
|
+
content_length: content_length,
|
|
105
|
+
include_online: include_online,
|
|
106
|
+
additional_properties: additional_properties)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a human-readable string representation of the object.
|
|
110
|
+
def to_s
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} attachment_id: #{@attachment_id}, file_name: #{@file_name}, url: #{@url},"\
|
|
113
|
+
" mime_type: #{@mime_type}, content_length: #{@content_length}, include_online:"\
|
|
114
|
+
" #{@include_online}, additional_properties: #{@additional_properties}>"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
118
|
+
def inspect
|
|
119
|
+
class_name = self.class.name.split('::').last
|
|
120
|
+
"<#{class_name} attachment_id: #{@attachment_id.inspect}, file_name: #{@file_name.inspect},"\
|
|
121
|
+
" url: #{@url.inspect}, mime_type: #{@mime_type.inspect}, content_length:"\
|
|
122
|
+
" #{@content_length.inspect}, include_online: #{@include_online.inspect},"\
|
|
123
|
+
" additional_properties: #{@additional_properties}>"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# Attachments Model.
|
|
8
|
+
class Attachments < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Attachment]]
|
|
14
|
+
attr_accessor :attachments
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['attachments'] = 'Attachments'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
attachments
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(attachments: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@attachments = attachments unless attachments == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
# Parameter is an array, so we need to iterate through it
|
|
49
|
+
attachments = nil
|
|
50
|
+
unless hash['Attachments'].nil?
|
|
51
|
+
attachments = []
|
|
52
|
+
hash['Attachments'].each do |structure|
|
|
53
|
+
attachments << (Attachment.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
attachments = SKIP unless hash.key?('Attachments')
|
|
58
|
+
|
|
59
|
+
# Create a new hash for additional properties, removing known properties.
|
|
60
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
61
|
+
|
|
62
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
63
|
+
new_hash, proc { |value| value }
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Create object from extracted values.
|
|
67
|
+
Attachments.new(attachments: attachments,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} attachments: #{@attachments}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} attachments: #{@attachments.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 method of averaging applied to this asset. See Averaging Methods
|
|
8
|
+
class AveragingMethod
|
|
9
|
+
AVERAGING_METHOD = [
|
|
10
|
+
# TODO: Write general description for FULLMONTH
|
|
11
|
+
FULLMONTH = 'FullMonth'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for ACTUALDAYS
|
|
14
|
+
ACTUALDAYS = 'ActualDays'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
AVERAGING_METHOD.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = FULLMONTH)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'fullmonth' then FULLMONTH
|
|
30
|
+
when 'actualdays' then ACTUALDAYS
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
# An array to specify multiple currency balances of an account
|
|
8
|
+
class BalanceDetails < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The opening balances of the account. Debits are positive, credits are
|
|
13
|
+
# negative values
|
|
14
|
+
# @return [Float]
|
|
15
|
+
attr_accessor :balance
|
|
16
|
+
|
|
17
|
+
# The currency of the balance (Not required for base currency)
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :currency_code
|
|
20
|
+
|
|
21
|
+
# (Optional) Exchange rate to base currency when money is spent or received.
|
|
22
|
+
# If not specified, XE rate for the day is applied
|
|
23
|
+
# @return [Float]
|
|
24
|
+
attr_accessor :currency_rate
|
|
25
|
+
|
|
26
|
+
# A mapping from model property names to API property names.
|
|
27
|
+
def self.names
|
|
28
|
+
@_hash = {} if @_hash.nil?
|
|
29
|
+
@_hash['balance'] = 'Balance'
|
|
30
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
|
31
|
+
@_hash['currency_rate'] = 'CurrencyRate'
|
|
32
|
+
@_hash
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for optional fields
|
|
36
|
+
def self.optionals
|
|
37
|
+
%w[
|
|
38
|
+
balance
|
|
39
|
+
currency_code
|
|
40
|
+
currency_rate
|
|
41
|
+
]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for nullable fields
|
|
45
|
+
def self.nullables
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def initialize(balance: SKIP, currency_code: SKIP, currency_rate: SKIP,
|
|
50
|
+
additional_properties: nil)
|
|
51
|
+
# Add additional model properties to the instance
|
|
52
|
+
additional_properties = {} if additional_properties.nil?
|
|
53
|
+
|
|
54
|
+
@balance = balance unless balance == SKIP
|
|
55
|
+
@currency_code = currency_code unless currency_code == SKIP
|
|
56
|
+
@currency_rate = currency_rate unless currency_rate == SKIP
|
|
57
|
+
@additional_properties = additional_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
balance = hash.key?('Balance') ? hash['Balance'] : SKIP
|
|
66
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
|
67
|
+
currency_rate = hash.key?('CurrencyRate') ? hash['CurrencyRate'] : SKIP
|
|
68
|
+
|
|
69
|
+
# Create a new hash for additional properties, removing known properties.
|
|
70
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
71
|
+
|
|
72
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
73
|
+
new_hash, proc { |value| value }
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Create object from extracted values.
|
|
77
|
+
BalanceDetails.new(balance: balance,
|
|
78
|
+
currency_code: currency_code,
|
|
79
|
+
currency_rate: currency_rate,
|
|
80
|
+
additional_properties: additional_properties)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Provides a human-readable string representation of the object.
|
|
84
|
+
def to_s
|
|
85
|
+
class_name = self.class.name.split('::').last
|
|
86
|
+
"<#{class_name} balance: #{@balance}, currency_code: #{@currency_code}, currency_rate:"\
|
|
87
|
+
" #{@currency_rate}, additional_properties: #{@additional_properties}>"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
91
|
+
def inspect
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} balance: #{@balance.inspect}, currency_code: #{@currency_code.inspect},"\
|
|
94
|
+
" currency_rate: #{@currency_rate.inspect}, additional_properties:"\
|
|
95
|
+
" #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|