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
|
+
# define the type of address
|
|
8
|
+
class AddressType
|
|
9
|
+
ADDRESS_TYPE = [
|
|
10
|
+
# TODO: Write general description for POBOX
|
|
11
|
+
POBOX = 'POBOX'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for STREET
|
|
14
|
+
STREET = 'STREET'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DELIVERY
|
|
17
|
+
DELIVERY = 'DELIVERY'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
ADDRESS_TYPE.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = POBOX)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'pobox' then POBOX
|
|
33
|
+
when 'street' then STREET
|
|
34
|
+
when 'delivery' then DELIVERY
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
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
|
+
# define the type of address
|
|
8
|
+
class AddressType1
|
|
9
|
+
ADDRESS_TYPE1 = [
|
|
10
|
+
# TODO: Write general description for POBOX
|
|
11
|
+
POBOX = 'POBOX'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for STREET
|
|
14
|
+
STREET = 'STREET'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
ADDRESS_TYPE1.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = POBOX)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'pobox' then POBOX
|
|
30
|
+
when 'street' then STREET
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
# Allocation Model.
|
|
8
|
+
class Allocation < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Xero generated unique identifier
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :allocation_id
|
|
15
|
+
|
|
16
|
+
# Xero generated unique identifier
|
|
17
|
+
# @return [Invoice]
|
|
18
|
+
attr_accessor :invoice
|
|
19
|
+
|
|
20
|
+
# Xero generated unique identifier
|
|
21
|
+
# @return [Overpayment]
|
|
22
|
+
attr_accessor :overpayment
|
|
23
|
+
|
|
24
|
+
# Xero generated unique identifier
|
|
25
|
+
# @return [Prepayment]
|
|
26
|
+
attr_accessor :prepayment
|
|
27
|
+
|
|
28
|
+
# Xero generated unique identifier
|
|
29
|
+
# @return [CreditNote]
|
|
30
|
+
attr_accessor :credit_note
|
|
31
|
+
|
|
32
|
+
# the amount being applied to the invoice
|
|
33
|
+
# @return [Float]
|
|
34
|
+
attr_accessor :amount
|
|
35
|
+
|
|
36
|
+
# the date the allocation is applied YYYY-MM-DD.
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :date
|
|
39
|
+
|
|
40
|
+
# A flag that returns true when the allocation is succesfully deleted
|
|
41
|
+
# @return [TrueClass | FalseClass]
|
|
42
|
+
attr_accessor :is_deleted
|
|
43
|
+
|
|
44
|
+
# A string to indicate if a invoice status
|
|
45
|
+
# @return [String]
|
|
46
|
+
attr_accessor :status_attribute_string
|
|
47
|
+
|
|
48
|
+
# Displays array of validation error messages from the API
|
|
49
|
+
# @return [Array[ValidationError]]
|
|
50
|
+
attr_accessor :validation_errors
|
|
51
|
+
|
|
52
|
+
# A mapping from model property names to API property names.
|
|
53
|
+
def self.names
|
|
54
|
+
@_hash = {} if @_hash.nil?
|
|
55
|
+
@_hash['allocation_id'] = 'AllocationID'
|
|
56
|
+
@_hash['invoice'] = 'Invoice'
|
|
57
|
+
@_hash['overpayment'] = 'Overpayment'
|
|
58
|
+
@_hash['prepayment'] = 'Prepayment'
|
|
59
|
+
@_hash['credit_note'] = 'CreditNote'
|
|
60
|
+
@_hash['amount'] = 'Amount'
|
|
61
|
+
@_hash['date'] = 'Date'
|
|
62
|
+
@_hash['is_deleted'] = 'IsDeleted'
|
|
63
|
+
@_hash['status_attribute_string'] = 'StatusAttributeString'
|
|
64
|
+
@_hash['validation_errors'] = 'ValidationErrors'
|
|
65
|
+
@_hash
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# An array for optional fields
|
|
69
|
+
def self.optionals
|
|
70
|
+
%w[
|
|
71
|
+
allocation_id
|
|
72
|
+
overpayment
|
|
73
|
+
prepayment
|
|
74
|
+
credit_note
|
|
75
|
+
is_deleted
|
|
76
|
+
status_attribute_string
|
|
77
|
+
validation_errors
|
|
78
|
+
]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# An array for nullable fields
|
|
82
|
+
def self.nullables
|
|
83
|
+
[]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def initialize(invoice:, amount:, date:, allocation_id: SKIP,
|
|
87
|
+
overpayment: SKIP, prepayment: SKIP, credit_note: SKIP,
|
|
88
|
+
is_deleted: SKIP, status_attribute_string: SKIP,
|
|
89
|
+
validation_errors: SKIP, additional_properties: nil)
|
|
90
|
+
# Add additional model properties to the instance
|
|
91
|
+
additional_properties = {} if additional_properties.nil?
|
|
92
|
+
|
|
93
|
+
@allocation_id = allocation_id unless allocation_id == SKIP
|
|
94
|
+
@invoice = invoice
|
|
95
|
+
@overpayment = overpayment unless overpayment == SKIP
|
|
96
|
+
@prepayment = prepayment unless prepayment == SKIP
|
|
97
|
+
@credit_note = credit_note unless credit_note == SKIP
|
|
98
|
+
@amount = amount
|
|
99
|
+
@date = date
|
|
100
|
+
@is_deleted = is_deleted unless is_deleted == SKIP
|
|
101
|
+
@status_attribute_string = status_attribute_string unless status_attribute_string == SKIP
|
|
102
|
+
@validation_errors = validation_errors unless validation_errors == SKIP
|
|
103
|
+
@additional_properties = additional_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Creates an instance of the object from a hash.
|
|
107
|
+
def self.from_hash(hash)
|
|
108
|
+
return nil unless hash
|
|
109
|
+
|
|
110
|
+
# Extract variables from the hash.
|
|
111
|
+
invoice = Invoice.from_hash(hash['Invoice']) if hash['Invoice']
|
|
112
|
+
amount = hash.key?('Amount') ? hash['Amount'] : nil
|
|
113
|
+
date = hash.key?('Date') ? hash['Date'] : nil
|
|
114
|
+
allocation_id = hash.key?('AllocationID') ? hash['AllocationID'] : SKIP
|
|
115
|
+
overpayment = Overpayment.from_hash(hash['Overpayment']) if hash['Overpayment']
|
|
116
|
+
prepayment = Prepayment.from_hash(hash['Prepayment']) if hash['Prepayment']
|
|
117
|
+
credit_note = CreditNote.from_hash(hash['CreditNote']) if hash['CreditNote']
|
|
118
|
+
is_deleted = hash.key?('IsDeleted') ? hash['IsDeleted'] : SKIP
|
|
119
|
+
status_attribute_string =
|
|
120
|
+
hash.key?('StatusAttributeString') ? hash['StatusAttributeString'] : SKIP
|
|
121
|
+
# Parameter is an array, so we need to iterate through it
|
|
122
|
+
validation_errors = nil
|
|
123
|
+
unless hash['ValidationErrors'].nil?
|
|
124
|
+
validation_errors = []
|
|
125
|
+
hash['ValidationErrors'].each do |structure|
|
|
126
|
+
validation_errors << (ValidationError.from_hash(structure) if structure)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
validation_errors = SKIP unless hash.key?('ValidationErrors')
|
|
131
|
+
|
|
132
|
+
# Create a new hash for additional properties, removing known properties.
|
|
133
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
134
|
+
|
|
135
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
136
|
+
new_hash, proc { |value| value }
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Create object from extracted values.
|
|
140
|
+
Allocation.new(invoice: invoice,
|
|
141
|
+
amount: amount,
|
|
142
|
+
date: date,
|
|
143
|
+
allocation_id: allocation_id,
|
|
144
|
+
overpayment: overpayment,
|
|
145
|
+
prepayment: prepayment,
|
|
146
|
+
credit_note: credit_note,
|
|
147
|
+
is_deleted: is_deleted,
|
|
148
|
+
status_attribute_string: status_attribute_string,
|
|
149
|
+
validation_errors: validation_errors,
|
|
150
|
+
additional_properties: additional_properties)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Provides a human-readable string representation of the object.
|
|
154
|
+
def to_s
|
|
155
|
+
class_name = self.class.name.split('::').last
|
|
156
|
+
"<#{class_name} allocation_id: #{@allocation_id}, invoice: #{@invoice}, overpayment:"\
|
|
157
|
+
" #{@overpayment}, prepayment: #{@prepayment}, credit_note: #{@credit_note}, amount:"\
|
|
158
|
+
" #{@amount}, date: #{@date}, is_deleted: #{@is_deleted}, status_attribute_string:"\
|
|
159
|
+
" #{@status_attribute_string}, validation_errors: #{@validation_errors},"\
|
|
160
|
+
" additional_properties: #{@additional_properties}>"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
164
|
+
def inspect
|
|
165
|
+
class_name = self.class.name.split('::').last
|
|
166
|
+
"<#{class_name} allocation_id: #{@allocation_id.inspect}, invoice: #{@invoice.inspect},"\
|
|
167
|
+
" overpayment: #{@overpayment.inspect}, prepayment: #{@prepayment.inspect}, credit_note:"\
|
|
168
|
+
" #{@credit_note.inspect}, amount: #{@amount.inspect}, date: #{@date.inspect}, is_deleted:"\
|
|
169
|
+
" #{@is_deleted.inspect}, status_attribute_string: #{@status_attribute_string.inspect},"\
|
|
170
|
+
" validation_errors: #{@validation_errors.inspect}, additional_properties:"\
|
|
171
|
+
" #{@additional_properties}>"
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
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
|
+
# Allocations Model.
|
|
8
|
+
class Allocations < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Allocation]]
|
|
14
|
+
attr_accessor :allocations
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['allocations'] = 'Allocations'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
allocations
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(allocations: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@allocations = allocations unless allocations == 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
|
+
allocations = nil
|
|
50
|
+
unless hash['Allocations'].nil?
|
|
51
|
+
allocations = []
|
|
52
|
+
hash['Allocations'].each do |structure|
|
|
53
|
+
allocations << (Allocation.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
allocations = SKIP unless hash.key?('Allocations')
|
|
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
|
+
Allocations.new(allocations: allocations,
|
|
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} allocations: #{@allocations}, 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} allocations: #{@allocations.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
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
|
+
# Amount Model.
|
|
8
|
+
class Amount < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD.
|
|
13
|
+
# @return [CurrencyCode1]
|
|
14
|
+
attr_accessor :currency
|
|
15
|
+
|
|
16
|
+
# 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD.
|
|
17
|
+
# @return [Float]
|
|
18
|
+
attr_accessor :value
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['currency'] = 'currency'
|
|
24
|
+
@_hash['value'] = 'value'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
currency
|
|
32
|
+
value
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(currency: SKIP, value: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@currency = currency unless currency == SKIP
|
|
46
|
+
@value = value unless value == 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
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
56
|
+
value = hash.key?('value') ? hash['value'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
Amount.new(currency: currency,
|
|
67
|
+
value: value,
|
|
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} currency: #{@currency}, value: #{@value}, 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} currency: #{@currency.inspect}, value: #{@value.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,249 @@
|
|
|
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
|
+
# Asset Model.
|
|
8
|
+
class Asset < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The Xero-generated Id for the asset
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :asset_id
|
|
15
|
+
|
|
16
|
+
# The name of the asset
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :asset_name
|
|
19
|
+
|
|
20
|
+
# The Xero-generated Id for the asset type
|
|
21
|
+
# @return [UUID | String]
|
|
22
|
+
attr_accessor :asset_type_id
|
|
23
|
+
|
|
24
|
+
# Must be unique.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :asset_number
|
|
27
|
+
|
|
28
|
+
# The date the asset was purchased YYYY-MM-DD
|
|
29
|
+
# @return [Date]
|
|
30
|
+
attr_accessor :purchase_date
|
|
31
|
+
|
|
32
|
+
# The purchase price of the asset
|
|
33
|
+
# @return [Float]
|
|
34
|
+
attr_accessor :purchase_price
|
|
35
|
+
|
|
36
|
+
# The date the asset was disposed
|
|
37
|
+
# @return [Date]
|
|
38
|
+
attr_accessor :disposal_date
|
|
39
|
+
|
|
40
|
+
# The price the asset was disposed at
|
|
41
|
+
# @return [Float]
|
|
42
|
+
attr_accessor :disposal_price
|
|
43
|
+
|
|
44
|
+
# See Asset Status Codes.
|
|
45
|
+
# @return [AssetStatus]
|
|
46
|
+
attr_accessor :asset_status
|
|
47
|
+
|
|
48
|
+
# The date the asset’s warranty expires (if needed) YYYY-MM-DD
|
|
49
|
+
# @return [String]
|
|
50
|
+
attr_accessor :warranty_expiry_date
|
|
51
|
+
|
|
52
|
+
# The asset's serial number
|
|
53
|
+
# @return [String]
|
|
54
|
+
attr_accessor :serial_number
|
|
55
|
+
|
|
56
|
+
# The asset's serial number
|
|
57
|
+
# @return [BookDepreciationSetting]
|
|
58
|
+
attr_accessor :book_depreciation_setting
|
|
59
|
+
|
|
60
|
+
# The asset's serial number
|
|
61
|
+
# @return [BookDepreciationDetail]
|
|
62
|
+
attr_accessor :book_depreciation_detail
|
|
63
|
+
|
|
64
|
+
# Boolean to indicate whether depreciation can be rolled back for this asset
|
|
65
|
+
# individually. This is true if it doesn't have 'legacy' journal entries and
|
|
66
|
+
# if there is no lock period that would prevent this asset from rolling
|
|
67
|
+
# back.
|
|
68
|
+
# @return [TrueClass | FalseClass]
|
|
69
|
+
attr_accessor :can_rollback
|
|
70
|
+
|
|
71
|
+
# The accounting value of the asset
|
|
72
|
+
# @return [Float]
|
|
73
|
+
attr_accessor :accounting_book_value
|
|
74
|
+
|
|
75
|
+
# Boolean to indicate whether delete is enabled
|
|
76
|
+
# @return [TrueClass | FalseClass]
|
|
77
|
+
attr_accessor :is_delete_enabled_for_date
|
|
78
|
+
|
|
79
|
+
# A mapping from model property names to API property names.
|
|
80
|
+
def self.names
|
|
81
|
+
@_hash = {} if @_hash.nil?
|
|
82
|
+
@_hash['asset_id'] = 'assetId'
|
|
83
|
+
@_hash['asset_name'] = 'assetName'
|
|
84
|
+
@_hash['asset_type_id'] = 'assetTypeId'
|
|
85
|
+
@_hash['asset_number'] = 'assetNumber'
|
|
86
|
+
@_hash['purchase_date'] = 'purchaseDate'
|
|
87
|
+
@_hash['purchase_price'] = 'purchasePrice'
|
|
88
|
+
@_hash['disposal_date'] = 'disposalDate'
|
|
89
|
+
@_hash['disposal_price'] = 'disposalPrice'
|
|
90
|
+
@_hash['asset_status'] = 'assetStatus'
|
|
91
|
+
@_hash['warranty_expiry_date'] = 'warrantyExpiryDate'
|
|
92
|
+
@_hash['serial_number'] = 'serialNumber'
|
|
93
|
+
@_hash['book_depreciation_setting'] = 'bookDepreciationSetting'
|
|
94
|
+
@_hash['book_depreciation_detail'] = 'bookDepreciationDetail'
|
|
95
|
+
@_hash['can_rollback'] = 'canRollback'
|
|
96
|
+
@_hash['accounting_book_value'] = 'accountingBookValue'
|
|
97
|
+
@_hash['is_delete_enabled_for_date'] = 'isDeleteEnabledForDate'
|
|
98
|
+
@_hash
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# An array for optional fields
|
|
102
|
+
def self.optionals
|
|
103
|
+
%w[
|
|
104
|
+
asset_id
|
|
105
|
+
asset_type_id
|
|
106
|
+
asset_number
|
|
107
|
+
purchase_date
|
|
108
|
+
purchase_price
|
|
109
|
+
disposal_date
|
|
110
|
+
disposal_price
|
|
111
|
+
asset_status
|
|
112
|
+
warranty_expiry_date
|
|
113
|
+
serial_number
|
|
114
|
+
book_depreciation_setting
|
|
115
|
+
book_depreciation_detail
|
|
116
|
+
can_rollback
|
|
117
|
+
accounting_book_value
|
|
118
|
+
is_delete_enabled_for_date
|
|
119
|
+
]
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# An array for nullable fields
|
|
123
|
+
def self.nullables
|
|
124
|
+
[]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def initialize(asset_name:, asset_id: SKIP, asset_type_id: SKIP,
|
|
128
|
+
asset_number: SKIP, purchase_date: SKIP,
|
|
129
|
+
purchase_price: SKIP, disposal_date: SKIP,
|
|
130
|
+
disposal_price: SKIP, asset_status: SKIP,
|
|
131
|
+
warranty_expiry_date: SKIP, serial_number: SKIP,
|
|
132
|
+
book_depreciation_setting: SKIP,
|
|
133
|
+
book_depreciation_detail: SKIP, can_rollback: SKIP,
|
|
134
|
+
accounting_book_value: SKIP,
|
|
135
|
+
is_delete_enabled_for_date: SKIP, additional_properties: nil)
|
|
136
|
+
# Add additional model properties to the instance
|
|
137
|
+
additional_properties = {} if additional_properties.nil?
|
|
138
|
+
|
|
139
|
+
@asset_id = asset_id unless asset_id == SKIP
|
|
140
|
+
@asset_name = asset_name
|
|
141
|
+
@asset_type_id = asset_type_id unless asset_type_id == SKIP
|
|
142
|
+
@asset_number = asset_number unless asset_number == SKIP
|
|
143
|
+
@purchase_date = purchase_date unless purchase_date == SKIP
|
|
144
|
+
@purchase_price = purchase_price unless purchase_price == SKIP
|
|
145
|
+
@disposal_date = disposal_date unless disposal_date == SKIP
|
|
146
|
+
@disposal_price = disposal_price unless disposal_price == SKIP
|
|
147
|
+
@asset_status = asset_status unless asset_status == SKIP
|
|
148
|
+
@warranty_expiry_date = warranty_expiry_date unless warranty_expiry_date == SKIP
|
|
149
|
+
@serial_number = serial_number unless serial_number == SKIP
|
|
150
|
+
unless book_depreciation_setting == SKIP
|
|
151
|
+
@book_depreciation_setting =
|
|
152
|
+
book_depreciation_setting
|
|
153
|
+
end
|
|
154
|
+
@book_depreciation_detail = book_depreciation_detail unless book_depreciation_detail == SKIP
|
|
155
|
+
@can_rollback = can_rollback unless can_rollback == SKIP
|
|
156
|
+
@accounting_book_value = accounting_book_value unless accounting_book_value == SKIP
|
|
157
|
+
unless is_delete_enabled_for_date == SKIP
|
|
158
|
+
@is_delete_enabled_for_date =
|
|
159
|
+
is_delete_enabled_for_date
|
|
160
|
+
end
|
|
161
|
+
@additional_properties = additional_properties
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Creates an instance of the object from a hash.
|
|
165
|
+
def self.from_hash(hash)
|
|
166
|
+
return nil unless hash
|
|
167
|
+
|
|
168
|
+
# Extract variables from the hash.
|
|
169
|
+
asset_name = hash.key?('assetName') ? hash['assetName'] : nil
|
|
170
|
+
asset_id = hash.key?('assetId') ? hash['assetId'] : SKIP
|
|
171
|
+
asset_type_id = hash.key?('assetTypeId') ? hash['assetTypeId'] : SKIP
|
|
172
|
+
asset_number = hash.key?('assetNumber') ? hash['assetNumber'] : SKIP
|
|
173
|
+
purchase_date = hash.key?('purchaseDate') ? hash['purchaseDate'] : SKIP
|
|
174
|
+
purchase_price = hash.key?('purchasePrice') ? hash['purchasePrice'] : SKIP
|
|
175
|
+
disposal_date = hash.key?('disposalDate') ? hash['disposalDate'] : SKIP
|
|
176
|
+
disposal_price = hash.key?('disposalPrice') ? hash['disposalPrice'] : SKIP
|
|
177
|
+
asset_status = hash.key?('assetStatus') ? hash['assetStatus'] : SKIP
|
|
178
|
+
warranty_expiry_date =
|
|
179
|
+
hash.key?('warrantyExpiryDate') ? hash['warrantyExpiryDate'] : SKIP
|
|
180
|
+
serial_number = hash.key?('serialNumber') ? hash['serialNumber'] : SKIP
|
|
181
|
+
if hash['bookDepreciationSetting']
|
|
182
|
+
book_depreciation_setting = BookDepreciationSetting.from_hash(hash['bookDepreciationSetting'])
|
|
183
|
+
end
|
|
184
|
+
book_depreciation_detail = BookDepreciationDetail.from_hash(hash['bookDepreciationDetail']) if
|
|
185
|
+
hash['bookDepreciationDetail']
|
|
186
|
+
can_rollback = hash.key?('canRollback') ? hash['canRollback'] : SKIP
|
|
187
|
+
accounting_book_value =
|
|
188
|
+
hash.key?('accountingBookValue') ? hash['accountingBookValue'] : SKIP
|
|
189
|
+
is_delete_enabled_for_date =
|
|
190
|
+
hash.key?('isDeleteEnabledForDate') ? hash['isDeleteEnabledForDate'] : SKIP
|
|
191
|
+
|
|
192
|
+
# Create a new hash for additional properties, removing known properties.
|
|
193
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
194
|
+
|
|
195
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
196
|
+
new_hash, proc { |value| value }
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
# Create object from extracted values.
|
|
200
|
+
Asset.new(asset_name: asset_name,
|
|
201
|
+
asset_id: asset_id,
|
|
202
|
+
asset_type_id: asset_type_id,
|
|
203
|
+
asset_number: asset_number,
|
|
204
|
+
purchase_date: purchase_date,
|
|
205
|
+
purchase_price: purchase_price,
|
|
206
|
+
disposal_date: disposal_date,
|
|
207
|
+
disposal_price: disposal_price,
|
|
208
|
+
asset_status: asset_status,
|
|
209
|
+
warranty_expiry_date: warranty_expiry_date,
|
|
210
|
+
serial_number: serial_number,
|
|
211
|
+
book_depreciation_setting: book_depreciation_setting,
|
|
212
|
+
book_depreciation_detail: book_depreciation_detail,
|
|
213
|
+
can_rollback: can_rollback,
|
|
214
|
+
accounting_book_value: accounting_book_value,
|
|
215
|
+
is_delete_enabled_for_date: is_delete_enabled_for_date,
|
|
216
|
+
additional_properties: additional_properties)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Provides a human-readable string representation of the object.
|
|
220
|
+
def to_s
|
|
221
|
+
class_name = self.class.name.split('::').last
|
|
222
|
+
"<#{class_name} asset_id: #{@asset_id}, asset_name: #{@asset_name}, asset_type_id:"\
|
|
223
|
+
" #{@asset_type_id}, asset_number: #{@asset_number}, purchase_date: #{@purchase_date},"\
|
|
224
|
+
" purchase_price: #{@purchase_price}, disposal_date: #{@disposal_date}, disposal_price:"\
|
|
225
|
+
" #{@disposal_price}, asset_status: #{@asset_status}, warranty_expiry_date:"\
|
|
226
|
+
" #{@warranty_expiry_date}, serial_number: #{@serial_number}, book_depreciation_setting:"\
|
|
227
|
+
" #{@book_depreciation_setting}, book_depreciation_detail: #{@book_depreciation_detail},"\
|
|
228
|
+
" can_rollback: #{@can_rollback}, accounting_book_value: #{@accounting_book_value},"\
|
|
229
|
+
" is_delete_enabled_for_date: #{@is_delete_enabled_for_date}, additional_properties:"\
|
|
230
|
+
" #{@additional_properties}>"
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
234
|
+
def inspect
|
|
235
|
+
class_name = self.class.name.split('::').last
|
|
236
|
+
"<#{class_name} asset_id: #{@asset_id.inspect}, asset_name: #{@asset_name.inspect},"\
|
|
237
|
+
" asset_type_id: #{@asset_type_id.inspect}, asset_number: #{@asset_number.inspect},"\
|
|
238
|
+
" purchase_date: #{@purchase_date.inspect}, purchase_price: #{@purchase_price.inspect},"\
|
|
239
|
+
" disposal_date: #{@disposal_date.inspect}, disposal_price: #{@disposal_price.inspect},"\
|
|
240
|
+
" asset_status: #{@asset_status.inspect}, warranty_expiry_date:"\
|
|
241
|
+
" #{@warranty_expiry_date.inspect}, serial_number: #{@serial_number.inspect},"\
|
|
242
|
+
" book_depreciation_setting: #{@book_depreciation_setting.inspect},"\
|
|
243
|
+
" book_depreciation_detail: #{@book_depreciation_detail.inspect}, can_rollback:"\
|
|
244
|
+
" #{@can_rollback.inspect}, accounting_book_value: #{@accounting_book_value.inspect},"\
|
|
245
|
+
" is_delete_enabled_for_date: #{@is_delete_enabled_for_date.inspect}, additional_properties:"\
|
|
246
|
+
" #{@additional_properties}>"
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
end
|