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,17 @@
|
|
|
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
|
+
# Represents the generic logger facade
|
|
8
|
+
class AbstractLogger < Logger
|
|
9
|
+
# Logs a message with a specified log level and additional parameters.
|
|
10
|
+
# @param level [Symbol] The log level of the message.
|
|
11
|
+
# @param message [String] The message to log.
|
|
12
|
+
# @param params [Hash] Additional parameters to include in the log message.
|
|
13
|
+
def log(level, message, params)
|
|
14
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
# AccessToken Model.
|
|
8
|
+
class AccessToken < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Xero unique identifier
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :id_token
|
|
15
|
+
|
|
16
|
+
# access token provided during authentication flow
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :access_token
|
|
19
|
+
|
|
20
|
+
# time in seconds until access token expires.
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :expires_in
|
|
23
|
+
|
|
24
|
+
# type of token i.e. Bearer
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :token_type
|
|
27
|
+
|
|
28
|
+
# token used to refresh an expired access token
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :refresh_token
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['id_token'] = 'id_token'
|
|
36
|
+
@_hash['access_token'] = 'access_token'
|
|
37
|
+
@_hash['expires_in'] = 'expires_in'
|
|
38
|
+
@_hash['token_type'] = 'token_type'
|
|
39
|
+
@_hash['refresh_token'] = 'refresh_token'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
%w[
|
|
46
|
+
id_token
|
|
47
|
+
access_token
|
|
48
|
+
expires_in
|
|
49
|
+
token_type
|
|
50
|
+
refresh_token
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
[]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def initialize(id_token: SKIP, access_token: SKIP, expires_in: SKIP,
|
|
60
|
+
token_type: SKIP, refresh_token: SKIP,
|
|
61
|
+
additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
65
|
+
@id_token = id_token unless id_token == SKIP
|
|
66
|
+
@access_token = access_token unless access_token == SKIP
|
|
67
|
+
@expires_in = expires_in unless expires_in == SKIP
|
|
68
|
+
@token_type = token_type unless token_type == SKIP
|
|
69
|
+
@refresh_token = refresh_token unless refresh_token == SKIP
|
|
70
|
+
@additional_properties = additional_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Creates an instance of the object from a hash.
|
|
74
|
+
def self.from_hash(hash)
|
|
75
|
+
return nil unless hash
|
|
76
|
+
|
|
77
|
+
# Extract variables from the hash.
|
|
78
|
+
id_token = hash.key?('id_token') ? hash['id_token'] : SKIP
|
|
79
|
+
access_token = hash.key?('access_token') ? hash['access_token'] : SKIP
|
|
80
|
+
expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
|
|
81
|
+
token_type = hash.key?('token_type') ? hash['token_type'] : SKIP
|
|
82
|
+
refresh_token = hash.key?('refresh_token') ? hash['refresh_token'] : SKIP
|
|
83
|
+
|
|
84
|
+
# Create a new hash for additional properties, removing known properties.
|
|
85
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
86
|
+
|
|
87
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
88
|
+
new_hash, proc { |value| value }
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
# Create object from extracted values.
|
|
92
|
+
AccessToken.new(id_token: id_token,
|
|
93
|
+
access_token: access_token,
|
|
94
|
+
expires_in: expires_in,
|
|
95
|
+
token_type: token_type,
|
|
96
|
+
refresh_token: refresh_token,
|
|
97
|
+
additional_properties: additional_properties)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Provides a human-readable string representation of the object.
|
|
101
|
+
def to_s
|
|
102
|
+
class_name = self.class.name.split('::').last
|
|
103
|
+
"<#{class_name} id_token: #{@id_token}, access_token: #{@access_token}, expires_in:"\
|
|
104
|
+
" #{@expires_in}, token_type: #{@token_type}, refresh_token: #{@refresh_token},"\
|
|
105
|
+
" additional_properties: #{@additional_properties}>"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
109
|
+
def inspect
|
|
110
|
+
class_name = self.class.name.split('::').last
|
|
111
|
+
"<#{class_name} id_token: #{@id_token.inspect}, access_token: #{@access_token.inspect},"\
|
|
112
|
+
" expires_in: #{@expires_in.inspect}, token_type: #{@token_type.inspect}, refresh_token:"\
|
|
113
|
+
" #{@refresh_token.inspect}, additional_properties: #{@additional_properties}>"
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,300 @@
|
|
|
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
|
+
# Account Model.
|
|
8
|
+
class Account < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Customer defined alpha numeric account code e.g 200 or SALES (max length =
|
|
13
|
+
# 10)
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :code
|
|
16
|
+
|
|
17
|
+
# Name of account (max length = 150)
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# The Xero identifier for an account – specified as a string following the
|
|
22
|
+
# endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9
|
|
23
|
+
# @return [UUID | String]
|
|
24
|
+
attr_accessor :account_id
|
|
25
|
+
|
|
26
|
+
# See Account Types
|
|
27
|
+
# @return [AccountType]
|
|
28
|
+
attr_accessor :type
|
|
29
|
+
|
|
30
|
+
# For bank accounts only (Account Type BANK)
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :bank_account_number
|
|
33
|
+
|
|
34
|
+
# Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account
|
|
35
|
+
# Status Codes
|
|
36
|
+
# @return [Status]
|
|
37
|
+
attr_accessor :status
|
|
38
|
+
|
|
39
|
+
# Description of the Account. Valid for all types of accounts except bank
|
|
40
|
+
# accounts (max length = 4000)
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :description
|
|
43
|
+
|
|
44
|
+
# For bank accounts only. See Bank Account types
|
|
45
|
+
# @return [BankAccountType]
|
|
46
|
+
attr_accessor :bank_account_type
|
|
47
|
+
|
|
48
|
+
# 3 letter alpha code for the currency – see list of currency codes
|
|
49
|
+
# @return [CurrencyCode]
|
|
50
|
+
attr_accessor :currency_code
|
|
51
|
+
|
|
52
|
+
# The tax type from taxRates
|
|
53
|
+
# @return [String]
|
|
54
|
+
attr_accessor :tax_type
|
|
55
|
+
|
|
56
|
+
# Boolean – describes whether account can have payments applied to it
|
|
57
|
+
# @return [TrueClass | FalseClass]
|
|
58
|
+
attr_accessor :enable_payments_to_account
|
|
59
|
+
|
|
60
|
+
# Boolean – describes whether account code is available for use with expense
|
|
61
|
+
# claims
|
|
62
|
+
# @return [TrueClass | FalseClass]
|
|
63
|
+
attr_accessor :show_in_expense_claims
|
|
64
|
+
|
|
65
|
+
# See Account Class Types
|
|
66
|
+
# @return [Class]
|
|
67
|
+
attr_accessor :mclass
|
|
68
|
+
|
|
69
|
+
# If this is a system account then this element is returned. See System
|
|
70
|
+
# Account types. Note that non-system accounts may have this element set as
|
|
71
|
+
# either “” or null.
|
|
72
|
+
# @return [SystemAccount]
|
|
73
|
+
attr_accessor :system_account
|
|
74
|
+
|
|
75
|
+
# Shown if set
|
|
76
|
+
# @return [String]
|
|
77
|
+
attr_accessor :reporting_code
|
|
78
|
+
|
|
79
|
+
# Shown if set
|
|
80
|
+
# @return [String]
|
|
81
|
+
attr_accessor :reporting_code_name
|
|
82
|
+
|
|
83
|
+
# boolean to indicate if an account has an attachment (read only)
|
|
84
|
+
# @return [TrueClass | FalseClass]
|
|
85
|
+
attr_accessor :has_attachments
|
|
86
|
+
|
|
87
|
+
# Last modified date UTC format
|
|
88
|
+
# @return [String]
|
|
89
|
+
attr_accessor :updated_date_utc
|
|
90
|
+
|
|
91
|
+
# Boolean – describes whether the account is shown in the watchlist widget
|
|
92
|
+
# on the dashboard
|
|
93
|
+
# @return [TrueClass | FalseClass]
|
|
94
|
+
attr_accessor :add_to_watchlist
|
|
95
|
+
|
|
96
|
+
# Displays array of validation error messages from the API
|
|
97
|
+
# @return [Array[ValidationError]]
|
|
98
|
+
attr_accessor :validation_errors
|
|
99
|
+
|
|
100
|
+
# A mapping from model property names to API property names.
|
|
101
|
+
def self.names
|
|
102
|
+
@_hash = {} if @_hash.nil?
|
|
103
|
+
@_hash['code'] = 'Code'
|
|
104
|
+
@_hash['name'] = 'Name'
|
|
105
|
+
@_hash['account_id'] = 'AccountID'
|
|
106
|
+
@_hash['type'] = 'Type'
|
|
107
|
+
@_hash['bank_account_number'] = 'BankAccountNumber'
|
|
108
|
+
@_hash['status'] = 'Status'
|
|
109
|
+
@_hash['description'] = 'Description'
|
|
110
|
+
@_hash['bank_account_type'] = 'BankAccountType'
|
|
111
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
|
112
|
+
@_hash['tax_type'] = 'TaxType'
|
|
113
|
+
@_hash['enable_payments_to_account'] = 'EnablePaymentsToAccount'
|
|
114
|
+
@_hash['show_in_expense_claims'] = 'ShowInExpenseClaims'
|
|
115
|
+
@_hash['mclass'] = 'Class'
|
|
116
|
+
@_hash['system_account'] = 'SystemAccount'
|
|
117
|
+
@_hash['reporting_code'] = 'ReportingCode'
|
|
118
|
+
@_hash['reporting_code_name'] = 'ReportingCodeName'
|
|
119
|
+
@_hash['has_attachments'] = 'HasAttachments'
|
|
120
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
121
|
+
@_hash['add_to_watchlist'] = 'AddToWatchlist'
|
|
122
|
+
@_hash['validation_errors'] = 'ValidationErrors'
|
|
123
|
+
@_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# An array for optional fields
|
|
127
|
+
def self.optionals
|
|
128
|
+
%w[
|
|
129
|
+
code
|
|
130
|
+
name
|
|
131
|
+
account_id
|
|
132
|
+
type
|
|
133
|
+
bank_account_number
|
|
134
|
+
status
|
|
135
|
+
description
|
|
136
|
+
bank_account_type
|
|
137
|
+
currency_code
|
|
138
|
+
tax_type
|
|
139
|
+
enable_payments_to_account
|
|
140
|
+
show_in_expense_claims
|
|
141
|
+
mclass
|
|
142
|
+
system_account
|
|
143
|
+
reporting_code
|
|
144
|
+
reporting_code_name
|
|
145
|
+
has_attachments
|
|
146
|
+
updated_date_utc
|
|
147
|
+
add_to_watchlist
|
|
148
|
+
validation_errors
|
|
149
|
+
]
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# An array for nullable fields
|
|
153
|
+
def self.nullables
|
|
154
|
+
[]
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def initialize(code: SKIP, name: SKIP, account_id: SKIP, type: SKIP,
|
|
158
|
+
bank_account_number: SKIP, status: SKIP, description: SKIP,
|
|
159
|
+
bank_account_type: SKIP, currency_code: SKIP, tax_type: SKIP,
|
|
160
|
+
enable_payments_to_account: SKIP,
|
|
161
|
+
show_in_expense_claims: SKIP, mclass: SKIP,
|
|
162
|
+
system_account: SKIP, reporting_code: SKIP,
|
|
163
|
+
reporting_code_name: SKIP, has_attachments: false,
|
|
164
|
+
updated_date_utc: SKIP, add_to_watchlist: SKIP,
|
|
165
|
+
validation_errors: SKIP, additional_properties: nil)
|
|
166
|
+
# Add additional model properties to the instance
|
|
167
|
+
additional_properties = {} if additional_properties.nil?
|
|
168
|
+
|
|
169
|
+
@code = code unless code == SKIP
|
|
170
|
+
@name = name unless name == SKIP
|
|
171
|
+
@account_id = account_id unless account_id == SKIP
|
|
172
|
+
@type = type unless type == SKIP
|
|
173
|
+
@bank_account_number = bank_account_number unless bank_account_number == SKIP
|
|
174
|
+
@status = status unless status == SKIP
|
|
175
|
+
@description = description unless description == SKIP
|
|
176
|
+
@bank_account_type = bank_account_type unless bank_account_type == SKIP
|
|
177
|
+
@currency_code = currency_code unless currency_code == SKIP
|
|
178
|
+
@tax_type = tax_type unless tax_type == SKIP
|
|
179
|
+
unless enable_payments_to_account == SKIP
|
|
180
|
+
@enable_payments_to_account =
|
|
181
|
+
enable_payments_to_account
|
|
182
|
+
end
|
|
183
|
+
@show_in_expense_claims = show_in_expense_claims unless show_in_expense_claims == SKIP
|
|
184
|
+
@mclass = mclass unless mclass == SKIP
|
|
185
|
+
@system_account = system_account unless system_account == SKIP
|
|
186
|
+
@reporting_code = reporting_code unless reporting_code == SKIP
|
|
187
|
+
@reporting_code_name = reporting_code_name unless reporting_code_name == SKIP
|
|
188
|
+
@has_attachments = has_attachments unless has_attachments == SKIP
|
|
189
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
190
|
+
@add_to_watchlist = add_to_watchlist unless add_to_watchlist == SKIP
|
|
191
|
+
@validation_errors = validation_errors unless validation_errors == SKIP
|
|
192
|
+
@additional_properties = additional_properties
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Creates an instance of the object from a hash.
|
|
196
|
+
def self.from_hash(hash)
|
|
197
|
+
return nil unless hash
|
|
198
|
+
|
|
199
|
+
# Extract variables from the hash.
|
|
200
|
+
code = hash.key?('Code') ? hash['Code'] : SKIP
|
|
201
|
+
name = hash.key?('Name') ? hash['Name'] : SKIP
|
|
202
|
+
account_id = hash.key?('AccountID') ? hash['AccountID'] : SKIP
|
|
203
|
+
type = hash.key?('Type') ? hash['Type'] : SKIP
|
|
204
|
+
bank_account_number =
|
|
205
|
+
hash.key?('BankAccountNumber') ? hash['BankAccountNumber'] : SKIP
|
|
206
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
|
207
|
+
description = hash.key?('Description') ? hash['Description'] : SKIP
|
|
208
|
+
bank_account_type =
|
|
209
|
+
hash.key?('BankAccountType') ? hash['BankAccountType'] : SKIP
|
|
210
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
|
211
|
+
tax_type = hash.key?('TaxType') ? hash['TaxType'] : SKIP
|
|
212
|
+
enable_payments_to_account =
|
|
213
|
+
hash.key?('EnablePaymentsToAccount') ? hash['EnablePaymentsToAccount'] : SKIP
|
|
214
|
+
show_in_expense_claims =
|
|
215
|
+
hash.key?('ShowInExpenseClaims') ? hash['ShowInExpenseClaims'] : SKIP
|
|
216
|
+
mclass = hash.key?('Class') ? hash['Class'] : SKIP
|
|
217
|
+
system_account = hash.key?('SystemAccount') ? hash['SystemAccount'] : SKIP
|
|
218
|
+
reporting_code = hash.key?('ReportingCode') ? hash['ReportingCode'] : SKIP
|
|
219
|
+
reporting_code_name =
|
|
220
|
+
hash.key?('ReportingCodeName') ? hash['ReportingCodeName'] : SKIP
|
|
221
|
+
has_attachments = hash['HasAttachments'] ||= false
|
|
222
|
+
updated_date_utc =
|
|
223
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
224
|
+
add_to_watchlist =
|
|
225
|
+
hash.key?('AddToWatchlist') ? hash['AddToWatchlist'] : SKIP
|
|
226
|
+
# Parameter is an array, so we need to iterate through it
|
|
227
|
+
validation_errors = nil
|
|
228
|
+
unless hash['ValidationErrors'].nil?
|
|
229
|
+
validation_errors = []
|
|
230
|
+
hash['ValidationErrors'].each do |structure|
|
|
231
|
+
validation_errors << (ValidationError.from_hash(structure) if structure)
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
validation_errors = SKIP unless hash.key?('ValidationErrors')
|
|
236
|
+
|
|
237
|
+
# Create a new hash for additional properties, removing known properties.
|
|
238
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
239
|
+
|
|
240
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
241
|
+
new_hash, proc { |value| value }
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
# Create object from extracted values.
|
|
245
|
+
Account.new(code: code,
|
|
246
|
+
name: name,
|
|
247
|
+
account_id: account_id,
|
|
248
|
+
type: type,
|
|
249
|
+
bank_account_number: bank_account_number,
|
|
250
|
+
status: status,
|
|
251
|
+
description: description,
|
|
252
|
+
bank_account_type: bank_account_type,
|
|
253
|
+
currency_code: currency_code,
|
|
254
|
+
tax_type: tax_type,
|
|
255
|
+
enable_payments_to_account: enable_payments_to_account,
|
|
256
|
+
show_in_expense_claims: show_in_expense_claims,
|
|
257
|
+
mclass: mclass,
|
|
258
|
+
system_account: system_account,
|
|
259
|
+
reporting_code: reporting_code,
|
|
260
|
+
reporting_code_name: reporting_code_name,
|
|
261
|
+
has_attachments: has_attachments,
|
|
262
|
+
updated_date_utc: updated_date_utc,
|
|
263
|
+
add_to_watchlist: add_to_watchlist,
|
|
264
|
+
validation_errors: validation_errors,
|
|
265
|
+
additional_properties: additional_properties)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Provides a human-readable string representation of the object.
|
|
269
|
+
def to_s
|
|
270
|
+
class_name = self.class.name.split('::').last
|
|
271
|
+
"<#{class_name} code: #{@code}, name: #{@name}, account_id: #{@account_id}, type: #{@type},"\
|
|
272
|
+
" bank_account_number: #{@bank_account_number}, status: #{@status}, description:"\
|
|
273
|
+
" #{@description}, bank_account_type: #{@bank_account_type}, currency_code:"\
|
|
274
|
+
" #{@currency_code}, tax_type: #{@tax_type}, enable_payments_to_account:"\
|
|
275
|
+
" #{@enable_payments_to_account}, show_in_expense_claims: #{@show_in_expense_claims},"\
|
|
276
|
+
" mclass: #{@mclass}, system_account: #{@system_account}, reporting_code:"\
|
|
277
|
+
" #{@reporting_code}, reporting_code_name: #{@reporting_code_name}, has_attachments:"\
|
|
278
|
+
" #{@has_attachments}, updated_date_utc: #{@updated_date_utc}, add_to_watchlist:"\
|
|
279
|
+
" #{@add_to_watchlist}, validation_errors: #{@validation_errors}, additional_properties:"\
|
|
280
|
+
" #{@additional_properties}>"
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
284
|
+
def inspect
|
|
285
|
+
class_name = self.class.name.split('::').last
|
|
286
|
+
"<#{class_name} code: #{@code.inspect}, name: #{@name.inspect}, account_id:"\
|
|
287
|
+
" #{@account_id.inspect}, type: #{@type.inspect}, bank_account_number:"\
|
|
288
|
+
" #{@bank_account_number.inspect}, status: #{@status.inspect}, description:"\
|
|
289
|
+
" #{@description.inspect}, bank_account_type: #{@bank_account_type.inspect}, currency_code:"\
|
|
290
|
+
" #{@currency_code.inspect}, tax_type: #{@tax_type.inspect}, enable_payments_to_account:"\
|
|
291
|
+
" #{@enable_payments_to_account.inspect}, show_in_expense_claims:"\
|
|
292
|
+
" #{@show_in_expense_claims.inspect}, mclass: #{@mclass.inspect}, system_account:"\
|
|
293
|
+
" #{@system_account.inspect}, reporting_code: #{@reporting_code.inspect},"\
|
|
294
|
+
" reporting_code_name: #{@reporting_code_name.inspect}, has_attachments:"\
|
|
295
|
+
" #{@has_attachments.inspect}, updated_date_utc: #{@updated_date_utc.inspect},"\
|
|
296
|
+
" add_to_watchlist: #{@add_to_watchlist.inspect}, validation_errors:"\
|
|
297
|
+
" #{@validation_errors.inspect}, additional_properties: #{@additional_properties}>"
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
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 Account Types
|
|
8
|
+
class AccountType
|
|
9
|
+
ACCOUNT_TYPE = [
|
|
10
|
+
# TODO: Write general description for BANK
|
|
11
|
+
BANK = 'BANK'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CURRENT
|
|
14
|
+
CURRENT = 'CURRENT'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for CURRLIAB
|
|
17
|
+
CURRLIAB = 'CURRLIAB'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for DEPRECIATN
|
|
20
|
+
DEPRECIATN = 'DEPRECIATN'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for DIRECTCOSTS
|
|
23
|
+
DIRECTCOSTS = 'DIRECTCOSTS'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for EQUITY
|
|
26
|
+
EQUITY = 'EQUITY'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for EXPENSE
|
|
29
|
+
EXPENSE = 'EXPENSE'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for FIXED
|
|
32
|
+
FIXED = 'FIXED'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for INVENTORY
|
|
35
|
+
INVENTORY = 'INVENTORY'.freeze,
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for LIABILITY
|
|
38
|
+
LIABILITY = 'LIABILITY'.freeze,
|
|
39
|
+
|
|
40
|
+
# TODO: Write general description for NONCURRENT
|
|
41
|
+
NONCURRENT = 'NONCURRENT'.freeze,
|
|
42
|
+
|
|
43
|
+
# TODO: Write general description for OTHERINCOME
|
|
44
|
+
OTHERINCOME = 'OTHERINCOME'.freeze,
|
|
45
|
+
|
|
46
|
+
# TODO: Write general description for OVERHEADS
|
|
47
|
+
OVERHEADS = 'OVERHEADS'.freeze,
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for PREPAYMENT
|
|
50
|
+
PREPAYMENT = 'PREPAYMENT'.freeze,
|
|
51
|
+
|
|
52
|
+
# TODO: Write general description for REVENUE
|
|
53
|
+
REVENUE = 'REVENUE'.freeze,
|
|
54
|
+
|
|
55
|
+
# TODO: Write general description for SALES
|
|
56
|
+
SALES = 'SALES'.freeze,
|
|
57
|
+
|
|
58
|
+
# TODO: Write general description for TERMLIAB
|
|
59
|
+
TERMLIAB = 'TERMLIAB'.freeze,
|
|
60
|
+
|
|
61
|
+
# TODO: Write general description for PAYG
|
|
62
|
+
PAYG = 'PAYG'.freeze
|
|
63
|
+
].freeze
|
|
64
|
+
|
|
65
|
+
def self.validate(value)
|
|
66
|
+
return false if value.nil?
|
|
67
|
+
|
|
68
|
+
ACCOUNT_TYPE.include?(value)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def self.from_value(value, default_value = BANK)
|
|
72
|
+
return default_value if value.nil?
|
|
73
|
+
|
|
74
|
+
str = value.to_s.strip
|
|
75
|
+
|
|
76
|
+
case str.downcase
|
|
77
|
+
when 'bank' then BANK
|
|
78
|
+
when 'current' then CURRENT
|
|
79
|
+
when 'currliab' then CURRLIAB
|
|
80
|
+
when 'depreciatn' then DEPRECIATN
|
|
81
|
+
when 'directcosts' then DIRECTCOSTS
|
|
82
|
+
when 'equity' then EQUITY
|
|
83
|
+
when 'expense' then EXPENSE
|
|
84
|
+
when 'fixed' then FIXED
|
|
85
|
+
when 'inventory' then INVENTORY
|
|
86
|
+
when 'liability' then LIABILITY
|
|
87
|
+
when 'noncurrent' then NONCURRENT
|
|
88
|
+
when 'otherincome' then OTHERINCOME
|
|
89
|
+
when 'overheads' then OVERHEADS
|
|
90
|
+
when 'prepayment' then PREPAYMENT
|
|
91
|
+
when 'revenue' then REVENUE
|
|
92
|
+
when 'sales' then SALES
|
|
93
|
+
when 'termliab' then TERMLIAB
|
|
94
|
+
when 'payg' then PAYG
|
|
95
|
+
else
|
|
96
|
+
default_value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# High level bank account type - BANK CREDITCARD BANK encompasses all bank
|
|
8
|
+
# account types other than credit cards.
|
|
9
|
+
class AccountType1
|
|
10
|
+
ACCOUNT_TYPE1 = [
|
|
11
|
+
# TODO: Write general description for BANK
|
|
12
|
+
BANK = 'BANK'.freeze,
|
|
13
|
+
|
|
14
|
+
# TODO: Write general description for CREDITCARD
|
|
15
|
+
CREDITCARD = 'CREDITCARD'.freeze
|
|
16
|
+
].freeze
|
|
17
|
+
|
|
18
|
+
def self.validate(value)
|
|
19
|
+
return false if value.nil?
|
|
20
|
+
|
|
21
|
+
ACCOUNT_TYPE1.include?(value)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.from_value(value, default_value = BANK)
|
|
25
|
+
return default_value if value.nil?
|
|
26
|
+
|
|
27
|
+
str = value.to_s.strip
|
|
28
|
+
|
|
29
|
+
case str.downcase
|
|
30
|
+
when 'bank' then BANK
|
|
31
|
+
when 'creditcard' then CREDITCARD
|
|
32
|
+
else
|
|
33
|
+
default_value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
# Accounts Model.
|
|
8
|
+
class Accounts < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Account]]
|
|
14
|
+
attr_accessor :accounts
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['accounts'] = 'Accounts'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
accounts
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(accounts: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@accounts = accounts unless accounts == 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
|
+
accounts = nil
|
|
50
|
+
unless hash['Accounts'].nil?
|
|
51
|
+
accounts = []
|
|
52
|
+
hash['Accounts'].each do |structure|
|
|
53
|
+
accounts << (Account.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
accounts = SKIP unless hash.key?('Accounts')
|
|
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
|
+
Accounts.new(accounts: accounts,
|
|
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} accounts: #{@accounts}, additional_properties: #{@additional_properties}>"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
78
|
+
def inspect
|
|
79
|
+
class_name = self.class.name.split('::').last
|
|
80
|
+
"<#{class_name} accounts: #{@accounts.inspect}, additional_properties:"\
|
|
81
|
+
" #{@additional_properties}>"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|