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,138 @@
|
|
|
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
|
+
# Error1 Model.
|
|
8
|
+
class Error1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Array of elements of resource validation errors
|
|
13
|
+
# @return [Array[ResourceValidationErrorsElement]]
|
|
14
|
+
attr_accessor :resource_validation_errors
|
|
15
|
+
|
|
16
|
+
# Array of elements of field validation errors
|
|
17
|
+
# @return [Array[FieldValidationErrorsElement]]
|
|
18
|
+
attr_accessor :field_validation_errors
|
|
19
|
+
|
|
20
|
+
# The internal type of error, not accessible externally
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
# Title of the error
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :title
|
|
27
|
+
|
|
28
|
+
# Detail of the error
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :detail
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['resource_validation_errors'] = 'resourceValidationErrors'
|
|
36
|
+
@_hash['field_validation_errors'] = 'fieldValidationErrors'
|
|
37
|
+
@_hash['type'] = 'type'
|
|
38
|
+
@_hash['title'] = 'title'
|
|
39
|
+
@_hash['detail'] = 'detail'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
%w[
|
|
46
|
+
resource_validation_errors
|
|
47
|
+
field_validation_errors
|
|
48
|
+
type
|
|
49
|
+
title
|
|
50
|
+
detail
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
[]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def initialize(resource_validation_errors: SKIP,
|
|
60
|
+
field_validation_errors: SKIP, type: SKIP, title: SKIP,
|
|
61
|
+
detail: SKIP, additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
65
|
+
unless resource_validation_errors == SKIP
|
|
66
|
+
@resource_validation_errors =
|
|
67
|
+
resource_validation_errors
|
|
68
|
+
end
|
|
69
|
+
@field_validation_errors = field_validation_errors unless field_validation_errors == SKIP
|
|
70
|
+
@type = type unless type == SKIP
|
|
71
|
+
@title = title unless title == SKIP
|
|
72
|
+
@detail = detail unless detail == SKIP
|
|
73
|
+
@additional_properties = additional_properties
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Creates an instance of the object from a hash.
|
|
77
|
+
def self.from_hash(hash)
|
|
78
|
+
return nil unless hash
|
|
79
|
+
|
|
80
|
+
# Extract variables from the hash.
|
|
81
|
+
# Parameter is an array, so we need to iterate through it
|
|
82
|
+
resource_validation_errors = nil
|
|
83
|
+
unless hash['resourceValidationErrors'].nil?
|
|
84
|
+
resource_validation_errors = []
|
|
85
|
+
hash['resourceValidationErrors'].each do |structure|
|
|
86
|
+
resource_validation_errors << (ResourceValidationErrorsElement.from_hash(structure) if structure)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
resource_validation_errors = SKIP unless hash.key?('resourceValidationErrors')
|
|
91
|
+
# Parameter is an array, so we need to iterate through it
|
|
92
|
+
field_validation_errors = nil
|
|
93
|
+
unless hash['fieldValidationErrors'].nil?
|
|
94
|
+
field_validation_errors = []
|
|
95
|
+
hash['fieldValidationErrors'].each do |structure|
|
|
96
|
+
field_validation_errors << (FieldValidationErrorsElement.from_hash(structure) if structure)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
field_validation_errors = SKIP unless hash.key?('fieldValidationErrors')
|
|
101
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
|
102
|
+
title = hash.key?('title') ? hash['title'] : SKIP
|
|
103
|
+
detail = hash.key?('detail') ? hash['detail'] : SKIP
|
|
104
|
+
|
|
105
|
+
# Create a new hash for additional properties, removing known properties.
|
|
106
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
107
|
+
|
|
108
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
109
|
+
new_hash, proc { |value| value }
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Create object from extracted values.
|
|
113
|
+
Error1.new(resource_validation_errors: resource_validation_errors,
|
|
114
|
+
field_validation_errors: field_validation_errors,
|
|
115
|
+
type: type,
|
|
116
|
+
title: title,
|
|
117
|
+
detail: detail,
|
|
118
|
+
additional_properties: additional_properties)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Provides a human-readable string representation of the object.
|
|
122
|
+
def to_s
|
|
123
|
+
class_name = self.class.name.split('::').last
|
|
124
|
+
"<#{class_name} resource_validation_errors: #{@resource_validation_errors},"\
|
|
125
|
+
" field_validation_errors: #{@field_validation_errors}, type: #{@type}, title: #{@title},"\
|
|
126
|
+
" detail: #{@detail}, additional_properties: #{@additional_properties}>"
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
130
|
+
def inspect
|
|
131
|
+
class_name = self.class.name.split('::').last
|
|
132
|
+
"<#{class_name} resource_validation_errors: #{@resource_validation_errors.inspect},"\
|
|
133
|
+
" field_validation_errors: #{@field_validation_errors.inspect}, type: #{@type.inspect},"\
|
|
134
|
+
" title: #{@title.inspect}, detail: #{@detail.inspect}, additional_properties:"\
|
|
135
|
+
" #{@additional_properties}>"
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
# On error, the API consumer will receive an HTTP response with a HTTP Status
|
|
8
|
+
# Code of 4xx or 5xx and a Content-Type of application/problem+json.
|
|
9
|
+
class Error2 < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Human readable high level error description.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :title
|
|
16
|
+
|
|
17
|
+
# The numeric HTTP Status Code, e.g. 404
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
# Human readable detailed error description.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :detail
|
|
24
|
+
|
|
25
|
+
# Identifies the type of error.
|
|
26
|
+
# @return [Type11]
|
|
27
|
+
attr_accessor :type
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['title'] = 'title'
|
|
33
|
+
@_hash['status'] = 'status'
|
|
34
|
+
@_hash['detail'] = 'detail'
|
|
35
|
+
@_hash['type'] = 'type'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
title
|
|
43
|
+
status
|
|
44
|
+
detail
|
|
45
|
+
type
|
|
46
|
+
]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(title: SKIP, status: SKIP, detail: SKIP, type: SKIP,
|
|
55
|
+
additional_properties: nil)
|
|
56
|
+
# Add additional model properties to the instance
|
|
57
|
+
additional_properties = {} if additional_properties.nil?
|
|
58
|
+
|
|
59
|
+
@title = title unless title == SKIP
|
|
60
|
+
@status = status unless status == SKIP
|
|
61
|
+
@detail = detail unless detail == SKIP
|
|
62
|
+
@type = type unless type == SKIP
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
title = hash.key?('title') ? hash['title'] : SKIP
|
|
72
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
73
|
+
detail = hash.key?('detail') ? hash['detail'] : SKIP
|
|
74
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
Error2.new(title: title,
|
|
85
|
+
status: status,
|
|
86
|
+
detail: detail,
|
|
87
|
+
type: type,
|
|
88
|
+
additional_properties: additional_properties)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a human-readable string representation of the object.
|
|
92
|
+
def to_s
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} title: #{@title}, status: #{@status}, detail: #{@detail}, type: #{@type},"\
|
|
95
|
+
" additional_properties: #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
99
|
+
def inspect
|
|
100
|
+
class_name = self.class.name.split('::').last
|
|
101
|
+
"<#{class_name} title: #{@title.inspect}, status: #{@status.inspect}, detail:"\
|
|
102
|
+
" #{@detail.inspect}, type: #{@type.inspect}, additional_properties:"\
|
|
103
|
+
" #{@additional_properties}>"
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
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
|
+
# Error3 Model.
|
|
8
|
+
class Error3 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Exception message
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# Array of Elements of validation Errors
|
|
17
|
+
# @return [Object]
|
|
18
|
+
attr_accessor :model_state
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['message'] = 'message'
|
|
24
|
+
@_hash['model_state'] = 'modelState'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
message
|
|
32
|
+
model_state
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(message: SKIP, model_state: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@message = message unless message == SKIP
|
|
46
|
+
@model_state = model_state unless model_state == 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
|
+
message = hash.key?('message') ? hash['message'] : SKIP
|
|
56
|
+
model_state = hash.key?('modelState') ? hash['modelState'] : 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
|
+
Error3.new(message: message,
|
|
67
|
+
model_state: model_state,
|
|
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} message: #{@message}, model_state: #{@model_state}, 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} message: #{@message.inspect}, model_state: #{@model_state.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,209 @@
|
|
|
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
|
+
# ExpenseClaim Model.
|
|
8
|
+
class ExpenseClaim < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Xero generated unique identifier for an expense claim
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :expense_claim_id
|
|
15
|
+
|
|
16
|
+
# Current status of an expense claim – see status types
|
|
17
|
+
# @return [Status12]
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
# See Payments
|
|
21
|
+
# @return [Array[Payment]]
|
|
22
|
+
attr_accessor :payments
|
|
23
|
+
|
|
24
|
+
# See Payments
|
|
25
|
+
# @return [User]
|
|
26
|
+
attr_accessor :user
|
|
27
|
+
|
|
28
|
+
# See Payments
|
|
29
|
+
# @return [Array[Receipt]]
|
|
30
|
+
attr_accessor :receipts
|
|
31
|
+
|
|
32
|
+
# Last modified date UTC format
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :updated_date_utc
|
|
35
|
+
|
|
36
|
+
# The total of an expense claim being paid
|
|
37
|
+
# @return [Float]
|
|
38
|
+
attr_accessor :total
|
|
39
|
+
|
|
40
|
+
# The amount due to be paid for an expense claim
|
|
41
|
+
# @return [Float]
|
|
42
|
+
attr_accessor :amount_due
|
|
43
|
+
|
|
44
|
+
# The amount still to pay for an expense claim
|
|
45
|
+
# @return [Float]
|
|
46
|
+
attr_accessor :amount_paid
|
|
47
|
+
|
|
48
|
+
# The date when the expense claim is due to be paid YYYY-MM-DD
|
|
49
|
+
# @return [String]
|
|
50
|
+
attr_accessor :payment_due_date
|
|
51
|
+
|
|
52
|
+
# The date the expense claim will be reported in Xero YYYY-MM-DD
|
|
53
|
+
# @return [String]
|
|
54
|
+
attr_accessor :reporting_date
|
|
55
|
+
|
|
56
|
+
# The Xero identifier for the Receipt e.g.
|
|
57
|
+
# e59a2c7f-1306-4078-a0f3-73537afcbba9
|
|
58
|
+
# @return [UUID | String]
|
|
59
|
+
attr_accessor :receipt_id
|
|
60
|
+
|
|
61
|
+
# A mapping from model property names to API property names.
|
|
62
|
+
def self.names
|
|
63
|
+
@_hash = {} if @_hash.nil?
|
|
64
|
+
@_hash['expense_claim_id'] = 'ExpenseClaimID'
|
|
65
|
+
@_hash['status'] = 'Status'
|
|
66
|
+
@_hash['payments'] = 'Payments'
|
|
67
|
+
@_hash['user'] = 'User'
|
|
68
|
+
@_hash['receipts'] = 'Receipts'
|
|
69
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
70
|
+
@_hash['total'] = 'Total'
|
|
71
|
+
@_hash['amount_due'] = 'AmountDue'
|
|
72
|
+
@_hash['amount_paid'] = 'AmountPaid'
|
|
73
|
+
@_hash['payment_due_date'] = 'PaymentDueDate'
|
|
74
|
+
@_hash['reporting_date'] = 'ReportingDate'
|
|
75
|
+
@_hash['receipt_id'] = 'ReceiptID'
|
|
76
|
+
@_hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# An array for optional fields
|
|
80
|
+
def self.optionals
|
|
81
|
+
%w[
|
|
82
|
+
expense_claim_id
|
|
83
|
+
status
|
|
84
|
+
payments
|
|
85
|
+
user
|
|
86
|
+
receipts
|
|
87
|
+
updated_date_utc
|
|
88
|
+
total
|
|
89
|
+
amount_due
|
|
90
|
+
amount_paid
|
|
91
|
+
payment_due_date
|
|
92
|
+
reporting_date
|
|
93
|
+
receipt_id
|
|
94
|
+
]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# An array for nullable fields
|
|
98
|
+
def self.nullables
|
|
99
|
+
[]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def initialize(expense_claim_id: SKIP, status: SKIP, payments: SKIP,
|
|
103
|
+
user: SKIP, receipts: SKIP, updated_date_utc: SKIP,
|
|
104
|
+
total: SKIP, amount_due: SKIP, amount_paid: SKIP,
|
|
105
|
+
payment_due_date: SKIP, reporting_date: SKIP,
|
|
106
|
+
receipt_id: SKIP, additional_properties: nil)
|
|
107
|
+
# Add additional model properties to the instance
|
|
108
|
+
additional_properties = {} if additional_properties.nil?
|
|
109
|
+
|
|
110
|
+
@expense_claim_id = expense_claim_id unless expense_claim_id == SKIP
|
|
111
|
+
@status = status unless status == SKIP
|
|
112
|
+
@payments = payments unless payments == SKIP
|
|
113
|
+
@user = user unless user == SKIP
|
|
114
|
+
@receipts = receipts unless receipts == SKIP
|
|
115
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
116
|
+
@total = total unless total == SKIP
|
|
117
|
+
@amount_due = amount_due unless amount_due == SKIP
|
|
118
|
+
@amount_paid = amount_paid unless amount_paid == SKIP
|
|
119
|
+
@payment_due_date = payment_due_date unless payment_due_date == SKIP
|
|
120
|
+
@reporting_date = reporting_date unless reporting_date == SKIP
|
|
121
|
+
@receipt_id = receipt_id unless receipt_id == SKIP
|
|
122
|
+
@additional_properties = additional_properties
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Creates an instance of the object from a hash.
|
|
126
|
+
def self.from_hash(hash)
|
|
127
|
+
return nil unless hash
|
|
128
|
+
|
|
129
|
+
# Extract variables from the hash.
|
|
130
|
+
expense_claim_id =
|
|
131
|
+
hash.key?('ExpenseClaimID') ? hash['ExpenseClaimID'] : SKIP
|
|
132
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
|
133
|
+
# Parameter is an array, so we need to iterate through it
|
|
134
|
+
payments = nil
|
|
135
|
+
unless hash['Payments'].nil?
|
|
136
|
+
payments = []
|
|
137
|
+
hash['Payments'].each do |structure|
|
|
138
|
+
payments << (Payment.from_hash(structure) if structure)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
payments = SKIP unless hash.key?('Payments')
|
|
143
|
+
user = User.from_hash(hash['User']) if hash['User']
|
|
144
|
+
# Parameter is an array, so we need to iterate through it
|
|
145
|
+
receipts = nil
|
|
146
|
+
unless hash['Receipts'].nil?
|
|
147
|
+
receipts = []
|
|
148
|
+
hash['Receipts'].each do |structure|
|
|
149
|
+
receipts << (Receipt.from_hash(structure) if structure)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
receipts = SKIP unless hash.key?('Receipts')
|
|
154
|
+
updated_date_utc =
|
|
155
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
156
|
+
total = hash.key?('Total') ? hash['Total'] : SKIP
|
|
157
|
+
amount_due = hash.key?('AmountDue') ? hash['AmountDue'] : SKIP
|
|
158
|
+
amount_paid = hash.key?('AmountPaid') ? hash['AmountPaid'] : SKIP
|
|
159
|
+
payment_due_date =
|
|
160
|
+
hash.key?('PaymentDueDate') ? hash['PaymentDueDate'] : SKIP
|
|
161
|
+
reporting_date = hash.key?('ReportingDate') ? hash['ReportingDate'] : SKIP
|
|
162
|
+
receipt_id = hash.key?('ReceiptID') ? hash['ReceiptID'] : SKIP
|
|
163
|
+
|
|
164
|
+
# Create a new hash for additional properties, removing known properties.
|
|
165
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
166
|
+
|
|
167
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
168
|
+
new_hash, proc { |value| value }
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Create object from extracted values.
|
|
172
|
+
ExpenseClaim.new(expense_claim_id: expense_claim_id,
|
|
173
|
+
status: status,
|
|
174
|
+
payments: payments,
|
|
175
|
+
user: user,
|
|
176
|
+
receipts: receipts,
|
|
177
|
+
updated_date_utc: updated_date_utc,
|
|
178
|
+
total: total,
|
|
179
|
+
amount_due: amount_due,
|
|
180
|
+
amount_paid: amount_paid,
|
|
181
|
+
payment_due_date: payment_due_date,
|
|
182
|
+
reporting_date: reporting_date,
|
|
183
|
+
receipt_id: receipt_id,
|
|
184
|
+
additional_properties: additional_properties)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Provides a human-readable string representation of the object.
|
|
188
|
+
def to_s
|
|
189
|
+
class_name = self.class.name.split('::').last
|
|
190
|
+
"<#{class_name} expense_claim_id: #{@expense_claim_id}, status: #{@status}, payments:"\
|
|
191
|
+
" #{@payments}, user: #{@user}, receipts: #{@receipts}, updated_date_utc:"\
|
|
192
|
+
" #{@updated_date_utc}, total: #{@total}, amount_due: #{@amount_due}, amount_paid:"\
|
|
193
|
+
" #{@amount_paid}, payment_due_date: #{@payment_due_date}, reporting_date:"\
|
|
194
|
+
" #{@reporting_date}, receipt_id: #{@receipt_id}, additional_properties:"\
|
|
195
|
+
" #{@additional_properties}>"
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
199
|
+
def inspect
|
|
200
|
+
class_name = self.class.name.split('::').last
|
|
201
|
+
"<#{class_name} expense_claim_id: #{@expense_claim_id.inspect}, status: #{@status.inspect},"\
|
|
202
|
+
" payments: #{@payments.inspect}, user: #{@user.inspect}, receipts: #{@receipts.inspect},"\
|
|
203
|
+
" updated_date_utc: #{@updated_date_utc.inspect}, total: #{@total.inspect}, amount_due:"\
|
|
204
|
+
" #{@amount_due.inspect}, amount_paid: #{@amount_paid.inspect}, payment_due_date:"\
|
|
205
|
+
" #{@payment_due_date.inspect}, reporting_date: #{@reporting_date.inspect}, receipt_id:"\
|
|
206
|
+
" #{@receipt_id.inspect}, additional_properties: #{@additional_properties}>"
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
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
|
+
# ExpenseClaims Model.
|
|
8
|
+
class ExpenseClaims < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[ExpenseClaim]]
|
|
14
|
+
attr_accessor :expense_claims
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['expense_claims'] = 'ExpenseClaims'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
expense_claims
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(expense_claims: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@expense_claims = expense_claims unless expense_claims == 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
|
+
expense_claims = nil
|
|
50
|
+
unless hash['ExpenseClaims'].nil?
|
|
51
|
+
expense_claims = []
|
|
52
|
+
hash['ExpenseClaims'].each do |structure|
|
|
53
|
+
expense_claims << (ExpenseClaim.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
expense_claims = SKIP unless hash.key?('ExpenseClaims')
|
|
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
|
+
ExpenseClaims.new(expense_claims: expense_claims,
|
|
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} expense_claims: #{@expense_claims}, 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} expense_claims: #{@expense_claims.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|