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,661 @@
|
|
|
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
|
+
# Contact Model.
|
|
8
|
+
class Contact < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Xero identifier
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :contact_id
|
|
15
|
+
|
|
16
|
+
# ID for the destination of a merged contact. Only returned when using
|
|
17
|
+
# paging or when fetching a contact by ContactId or ContactNumber.
|
|
18
|
+
# @return [UUID | String]
|
|
19
|
+
attr_accessor :merged_to_contact_id
|
|
20
|
+
|
|
21
|
+
# This can be updated via the API only i.e. This field is read only on the
|
|
22
|
+
# Xero contact screen, used to identify contacts in external systems (max
|
|
23
|
+
# length = 50). If the Contact Number is used, this is displayed as Contact
|
|
24
|
+
# Code in the Contacts UI in Xero.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :contact_number
|
|
27
|
+
|
|
28
|
+
# A user defined account number. This can be updated via the API and the
|
|
29
|
+
# Xero UI (max length = 50)
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :account_number
|
|
32
|
+
|
|
33
|
+
# Current status of a contact – see contact status types
|
|
34
|
+
# @return [ContactStatus]
|
|
35
|
+
attr_accessor :contact_status
|
|
36
|
+
|
|
37
|
+
# Full name of contact/organisation (max length = 255)
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :name
|
|
40
|
+
|
|
41
|
+
# First name of contact person (max length = 255)
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :first_name
|
|
44
|
+
|
|
45
|
+
# Last name of contact person (max length = 255)
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :last_name
|
|
48
|
+
|
|
49
|
+
# Company registration number (max length = 50)
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :company_number
|
|
52
|
+
|
|
53
|
+
# Email address of contact person (umlauts not supported) (max length =
|
|
54
|
+
# 255)
|
|
55
|
+
# @return [String]
|
|
56
|
+
attr_accessor :email_address
|
|
57
|
+
|
|
58
|
+
# See contact persons
|
|
59
|
+
# @return [Array[ContactPerson]]
|
|
60
|
+
attr_accessor :contact_persons
|
|
61
|
+
|
|
62
|
+
# Bank account number of contact
|
|
63
|
+
# @return [String]
|
|
64
|
+
attr_accessor :bank_account_details
|
|
65
|
+
|
|
66
|
+
# Tax number of contact – this is also known as the ABN (Australia), GST
|
|
67
|
+
# Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in
|
|
68
|
+
# the Xero UI depending on which regionalized version of Xero you are using
|
|
69
|
+
# (max length = 50)
|
|
70
|
+
# @return [String]
|
|
71
|
+
attr_accessor :tax_number
|
|
72
|
+
|
|
73
|
+
# Identifier of the regional type of tax number, such as US, UK, or other
|
|
74
|
+
# regional tax identifiers
|
|
75
|
+
# @return [TaxNumberType]
|
|
76
|
+
attr_accessor :tax_number_type
|
|
77
|
+
|
|
78
|
+
# The tax type from TaxRates
|
|
79
|
+
# @return [String]
|
|
80
|
+
attr_accessor :accounts_receivable_tax_type
|
|
81
|
+
|
|
82
|
+
# The tax type from TaxRates
|
|
83
|
+
# @return [String]
|
|
84
|
+
attr_accessor :accounts_payable_tax_type
|
|
85
|
+
|
|
86
|
+
# Store certain address types for a contact – see address types
|
|
87
|
+
# @return [Array[Address]]
|
|
88
|
+
attr_accessor :addresses
|
|
89
|
+
|
|
90
|
+
# Store certain phone types for a contact – see phone types
|
|
91
|
+
# @return [Array[Phone]]
|
|
92
|
+
attr_accessor :phones
|
|
93
|
+
|
|
94
|
+
# true or false – Boolean that describes if a contact that has any AP
|
|
95
|
+
# invoices entered against them. Cannot be set via PUT or POST – it is
|
|
96
|
+
# automatically set when an accounts payable invoice is generated against
|
|
97
|
+
# this contact.
|
|
98
|
+
# @return [TrueClass | FalseClass]
|
|
99
|
+
attr_accessor :is_supplier
|
|
100
|
+
|
|
101
|
+
# true or false – Boolean that describes if a contact has any AR invoices
|
|
102
|
+
# entered against them. Cannot be set via PUT or POST – it is automatically
|
|
103
|
+
# set when an accounts receivable invoice is generated against this contact.
|
|
104
|
+
# @return [TrueClass | FalseClass]
|
|
105
|
+
attr_accessor :is_customer
|
|
106
|
+
|
|
107
|
+
# The default sales line amount type for a contact. Only available when
|
|
108
|
+
# summaryOnly parameter or paging is used, or when fetch by ContactId or
|
|
109
|
+
# ContactNumber.
|
|
110
|
+
# @return [SalesDefaultLineAmountType]
|
|
111
|
+
attr_accessor :sales_default_line_amount_type
|
|
112
|
+
|
|
113
|
+
# The default purchases line amount type for a contact Only available when
|
|
114
|
+
# summaryOnly parameter or paging is used, or when fetch by ContactId or
|
|
115
|
+
# ContactNumber.
|
|
116
|
+
# @return [PurchasesDefaultLineAmountType]
|
|
117
|
+
attr_accessor :purchases_default_line_amount_type
|
|
118
|
+
|
|
119
|
+
# 3 letter alpha code for the currency – see list of currency codes
|
|
120
|
+
# @return [CurrencyCode]
|
|
121
|
+
attr_accessor :default_currency
|
|
122
|
+
|
|
123
|
+
# Store XeroNetworkKey for contacts.
|
|
124
|
+
# @return [String]
|
|
125
|
+
attr_accessor :xero_network_key
|
|
126
|
+
|
|
127
|
+
# The default sales account code for contacts
|
|
128
|
+
# @return [String]
|
|
129
|
+
attr_accessor :sales_default_account_code
|
|
130
|
+
|
|
131
|
+
# The default purchases account code for contacts
|
|
132
|
+
# @return [String]
|
|
133
|
+
attr_accessor :purchases_default_account_code
|
|
134
|
+
|
|
135
|
+
# The default sales tracking categories for contacts
|
|
136
|
+
# @return [Array[SalesTrackingCategory]]
|
|
137
|
+
attr_accessor :sales_tracking_categories
|
|
138
|
+
|
|
139
|
+
# The default purchases tracking categories for contacts
|
|
140
|
+
# @return [Array[SalesTrackingCategory]]
|
|
141
|
+
attr_accessor :purchases_tracking_categories
|
|
142
|
+
|
|
143
|
+
# The name of the Tracking Category assigned to the contact under
|
|
144
|
+
# SalesTrackingCategories and PurchasesTrackingCategories
|
|
145
|
+
# @return [String]
|
|
146
|
+
attr_accessor :tracking_category_name
|
|
147
|
+
|
|
148
|
+
# The name of the Tracking Option assigned to the contact under
|
|
149
|
+
# SalesTrackingCategories and PurchasesTrackingCategories
|
|
150
|
+
# @return [String]
|
|
151
|
+
attr_accessor :tracking_category_option
|
|
152
|
+
|
|
153
|
+
# The name of the Tracking Option assigned to the contact under
|
|
154
|
+
# SalesTrackingCategories and PurchasesTrackingCategories
|
|
155
|
+
# @return [PaymentTerm]
|
|
156
|
+
attr_accessor :payment_terms
|
|
157
|
+
|
|
158
|
+
# UTC timestamp of last update to contact
|
|
159
|
+
# @return [String]
|
|
160
|
+
attr_accessor :updated_date_utc
|
|
161
|
+
|
|
162
|
+
# Displays which contact groups a contact is included in
|
|
163
|
+
# @return [Array[ContactGroup]]
|
|
164
|
+
attr_accessor :contact_groups
|
|
165
|
+
|
|
166
|
+
# Website address for contact (read only)
|
|
167
|
+
# @return [String]
|
|
168
|
+
attr_accessor :website
|
|
169
|
+
|
|
170
|
+
# Website address for contact (read only)
|
|
171
|
+
# @return [BrandingTheme]
|
|
172
|
+
attr_accessor :branding_theme
|
|
173
|
+
|
|
174
|
+
# Bank details for use on a batch payment stored with each contact
|
|
175
|
+
# @return [BatchPaymentDetails]
|
|
176
|
+
attr_accessor :batch_payments
|
|
177
|
+
|
|
178
|
+
# The default discount rate for the contact (read only)
|
|
179
|
+
# @return [Float]
|
|
180
|
+
attr_accessor :discount
|
|
181
|
+
|
|
182
|
+
# The raw AccountsReceivable(sales invoices) and AccountsPayable(bills)
|
|
183
|
+
# outstanding and overdue amounts, not converted to base currency (read
|
|
184
|
+
# only)
|
|
185
|
+
# @return [Balances]
|
|
186
|
+
attr_accessor :balances
|
|
187
|
+
|
|
188
|
+
# Displays array of attachments from the API
|
|
189
|
+
# @return [Array[Attachment]]
|
|
190
|
+
attr_accessor :attachments
|
|
191
|
+
|
|
192
|
+
# A boolean to indicate if a contact has an attachment
|
|
193
|
+
# @return [TrueClass | FalseClass]
|
|
194
|
+
attr_accessor :has_attachments
|
|
195
|
+
|
|
196
|
+
# Displays validation errors returned from the API
|
|
197
|
+
# @return [Array[ValidationError]]
|
|
198
|
+
attr_accessor :validation_errors
|
|
199
|
+
|
|
200
|
+
# A boolean to indicate if a contact has an validation errors
|
|
201
|
+
# @return [TrueClass | FalseClass]
|
|
202
|
+
attr_accessor :has_validation_errors
|
|
203
|
+
|
|
204
|
+
# Status of object
|
|
205
|
+
# @return [String]
|
|
206
|
+
attr_accessor :status_attribute_string
|
|
207
|
+
|
|
208
|
+
# A mapping from model property names to API property names.
|
|
209
|
+
def self.names
|
|
210
|
+
@_hash = {} if @_hash.nil?
|
|
211
|
+
@_hash['contact_id'] = 'ContactID'
|
|
212
|
+
@_hash['merged_to_contact_id'] = 'MergedToContactID'
|
|
213
|
+
@_hash['contact_number'] = 'ContactNumber'
|
|
214
|
+
@_hash['account_number'] = 'AccountNumber'
|
|
215
|
+
@_hash['contact_status'] = 'ContactStatus'
|
|
216
|
+
@_hash['name'] = 'Name'
|
|
217
|
+
@_hash['first_name'] = 'FirstName'
|
|
218
|
+
@_hash['last_name'] = 'LastName'
|
|
219
|
+
@_hash['company_number'] = 'CompanyNumber'
|
|
220
|
+
@_hash['email_address'] = 'EmailAddress'
|
|
221
|
+
@_hash['contact_persons'] = 'ContactPersons'
|
|
222
|
+
@_hash['bank_account_details'] = 'BankAccountDetails'
|
|
223
|
+
@_hash['tax_number'] = 'TaxNumber'
|
|
224
|
+
@_hash['tax_number_type'] = 'TaxNumberType'
|
|
225
|
+
@_hash['accounts_receivable_tax_type'] = 'AccountsReceivableTaxType'
|
|
226
|
+
@_hash['accounts_payable_tax_type'] = 'AccountsPayableTaxType'
|
|
227
|
+
@_hash['addresses'] = 'Addresses'
|
|
228
|
+
@_hash['phones'] = 'Phones'
|
|
229
|
+
@_hash['is_supplier'] = 'IsSupplier'
|
|
230
|
+
@_hash['is_customer'] = 'IsCustomer'
|
|
231
|
+
@_hash['sales_default_line_amount_type'] = 'SalesDefaultLineAmountType'
|
|
232
|
+
@_hash['purchases_default_line_amount_type'] =
|
|
233
|
+
'PurchasesDefaultLineAmountType'
|
|
234
|
+
@_hash['default_currency'] = 'DefaultCurrency'
|
|
235
|
+
@_hash['xero_network_key'] = 'XeroNetworkKey'
|
|
236
|
+
@_hash['sales_default_account_code'] = 'SalesDefaultAccountCode'
|
|
237
|
+
@_hash['purchases_default_account_code'] = 'PurchasesDefaultAccountCode'
|
|
238
|
+
@_hash['sales_tracking_categories'] = 'SalesTrackingCategories'
|
|
239
|
+
@_hash['purchases_tracking_categories'] = 'PurchasesTrackingCategories'
|
|
240
|
+
@_hash['tracking_category_name'] = 'TrackingCategoryName'
|
|
241
|
+
@_hash['tracking_category_option'] = 'TrackingCategoryOption'
|
|
242
|
+
@_hash['payment_terms'] = 'PaymentTerms'
|
|
243
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
244
|
+
@_hash['contact_groups'] = 'ContactGroups'
|
|
245
|
+
@_hash['website'] = 'Website'
|
|
246
|
+
@_hash['branding_theme'] = 'BrandingTheme'
|
|
247
|
+
@_hash['batch_payments'] = 'BatchPayments'
|
|
248
|
+
@_hash['discount'] = 'Discount'
|
|
249
|
+
@_hash['balances'] = 'Balances'
|
|
250
|
+
@_hash['attachments'] = 'Attachments'
|
|
251
|
+
@_hash['has_attachments'] = 'HasAttachments'
|
|
252
|
+
@_hash['validation_errors'] = 'ValidationErrors'
|
|
253
|
+
@_hash['has_validation_errors'] = 'HasValidationErrors'
|
|
254
|
+
@_hash['status_attribute_string'] = 'StatusAttributeString'
|
|
255
|
+
@_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# An array for optional fields
|
|
259
|
+
def self.optionals
|
|
260
|
+
%w[
|
|
261
|
+
contact_id
|
|
262
|
+
merged_to_contact_id
|
|
263
|
+
contact_number
|
|
264
|
+
account_number
|
|
265
|
+
contact_status
|
|
266
|
+
name
|
|
267
|
+
first_name
|
|
268
|
+
last_name
|
|
269
|
+
company_number
|
|
270
|
+
email_address
|
|
271
|
+
contact_persons
|
|
272
|
+
bank_account_details
|
|
273
|
+
tax_number
|
|
274
|
+
tax_number_type
|
|
275
|
+
accounts_receivable_tax_type
|
|
276
|
+
accounts_payable_tax_type
|
|
277
|
+
addresses
|
|
278
|
+
phones
|
|
279
|
+
is_supplier
|
|
280
|
+
is_customer
|
|
281
|
+
sales_default_line_amount_type
|
|
282
|
+
purchases_default_line_amount_type
|
|
283
|
+
default_currency
|
|
284
|
+
xero_network_key
|
|
285
|
+
sales_default_account_code
|
|
286
|
+
purchases_default_account_code
|
|
287
|
+
sales_tracking_categories
|
|
288
|
+
purchases_tracking_categories
|
|
289
|
+
tracking_category_name
|
|
290
|
+
tracking_category_option
|
|
291
|
+
payment_terms
|
|
292
|
+
updated_date_utc
|
|
293
|
+
contact_groups
|
|
294
|
+
website
|
|
295
|
+
branding_theme
|
|
296
|
+
batch_payments
|
|
297
|
+
discount
|
|
298
|
+
balances
|
|
299
|
+
attachments
|
|
300
|
+
has_attachments
|
|
301
|
+
validation_errors
|
|
302
|
+
has_validation_errors
|
|
303
|
+
status_attribute_string
|
|
304
|
+
]
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# An array for nullable fields
|
|
308
|
+
def self.nullables
|
|
309
|
+
[]
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
def initialize(contact_id: SKIP, merged_to_contact_id: SKIP,
|
|
313
|
+
contact_number: SKIP, account_number: SKIP,
|
|
314
|
+
contact_status: SKIP, name: SKIP, first_name: SKIP,
|
|
315
|
+
last_name: SKIP, company_number: SKIP, email_address: SKIP,
|
|
316
|
+
contact_persons: SKIP, bank_account_details: SKIP,
|
|
317
|
+
tax_number: SKIP, tax_number_type: SKIP,
|
|
318
|
+
accounts_receivable_tax_type: SKIP,
|
|
319
|
+
accounts_payable_tax_type: SKIP, addresses: SKIP,
|
|
320
|
+
phones: SKIP, is_supplier: SKIP, is_customer: SKIP,
|
|
321
|
+
sales_default_line_amount_type: SKIP,
|
|
322
|
+
purchases_default_line_amount_type: SKIP,
|
|
323
|
+
default_currency: SKIP, xero_network_key: SKIP,
|
|
324
|
+
sales_default_account_code: SKIP,
|
|
325
|
+
purchases_default_account_code: SKIP,
|
|
326
|
+
sales_tracking_categories: SKIP,
|
|
327
|
+
purchases_tracking_categories: SKIP,
|
|
328
|
+
tracking_category_name: SKIP, tracking_category_option: SKIP,
|
|
329
|
+
payment_terms: SKIP, updated_date_utc: SKIP,
|
|
330
|
+
contact_groups: SKIP, website: SKIP, branding_theme: SKIP,
|
|
331
|
+
batch_payments: SKIP, discount: SKIP, balances: SKIP,
|
|
332
|
+
attachments: SKIP, has_attachments: false,
|
|
333
|
+
validation_errors: SKIP, has_validation_errors: false,
|
|
334
|
+
status_attribute_string: SKIP, additional_properties: nil)
|
|
335
|
+
# Add additional model properties to the instance
|
|
336
|
+
additional_properties = {} if additional_properties.nil?
|
|
337
|
+
|
|
338
|
+
@contact_id = contact_id unless contact_id == SKIP
|
|
339
|
+
@merged_to_contact_id = merged_to_contact_id unless merged_to_contact_id == SKIP
|
|
340
|
+
@contact_number = contact_number unless contact_number == SKIP
|
|
341
|
+
@account_number = account_number unless account_number == SKIP
|
|
342
|
+
@contact_status = contact_status unless contact_status == SKIP
|
|
343
|
+
@name = name unless name == SKIP
|
|
344
|
+
@first_name = first_name unless first_name == SKIP
|
|
345
|
+
@last_name = last_name unless last_name == SKIP
|
|
346
|
+
@company_number = company_number unless company_number == SKIP
|
|
347
|
+
@email_address = email_address unless email_address == SKIP
|
|
348
|
+
@contact_persons = contact_persons unless contact_persons == SKIP
|
|
349
|
+
@bank_account_details = bank_account_details unless bank_account_details == SKIP
|
|
350
|
+
@tax_number = tax_number unless tax_number == SKIP
|
|
351
|
+
@tax_number_type = tax_number_type unless tax_number_type == SKIP
|
|
352
|
+
unless accounts_receivable_tax_type == SKIP
|
|
353
|
+
@accounts_receivable_tax_type =
|
|
354
|
+
accounts_receivable_tax_type
|
|
355
|
+
end
|
|
356
|
+
unless accounts_payable_tax_type == SKIP
|
|
357
|
+
@accounts_payable_tax_type =
|
|
358
|
+
accounts_payable_tax_type
|
|
359
|
+
end
|
|
360
|
+
@addresses = addresses unless addresses == SKIP
|
|
361
|
+
@phones = phones unless phones == SKIP
|
|
362
|
+
@is_supplier = is_supplier unless is_supplier == SKIP
|
|
363
|
+
@is_customer = is_customer unless is_customer == SKIP
|
|
364
|
+
unless sales_default_line_amount_type == SKIP
|
|
365
|
+
@sales_default_line_amount_type =
|
|
366
|
+
sales_default_line_amount_type
|
|
367
|
+
end
|
|
368
|
+
unless purchases_default_line_amount_type == SKIP
|
|
369
|
+
@purchases_default_line_amount_type =
|
|
370
|
+
purchases_default_line_amount_type
|
|
371
|
+
end
|
|
372
|
+
@default_currency = default_currency unless default_currency == SKIP
|
|
373
|
+
@xero_network_key = xero_network_key unless xero_network_key == SKIP
|
|
374
|
+
unless sales_default_account_code == SKIP
|
|
375
|
+
@sales_default_account_code =
|
|
376
|
+
sales_default_account_code
|
|
377
|
+
end
|
|
378
|
+
unless purchases_default_account_code == SKIP
|
|
379
|
+
@purchases_default_account_code =
|
|
380
|
+
purchases_default_account_code
|
|
381
|
+
end
|
|
382
|
+
unless sales_tracking_categories == SKIP
|
|
383
|
+
@sales_tracking_categories =
|
|
384
|
+
sales_tracking_categories
|
|
385
|
+
end
|
|
386
|
+
unless purchases_tracking_categories == SKIP
|
|
387
|
+
@purchases_tracking_categories =
|
|
388
|
+
purchases_tracking_categories
|
|
389
|
+
end
|
|
390
|
+
@tracking_category_name = tracking_category_name unless tracking_category_name == SKIP
|
|
391
|
+
@tracking_category_option = tracking_category_option unless tracking_category_option == SKIP
|
|
392
|
+
@payment_terms = payment_terms unless payment_terms == SKIP
|
|
393
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
394
|
+
@contact_groups = contact_groups unless contact_groups == SKIP
|
|
395
|
+
@website = website unless website == SKIP
|
|
396
|
+
@branding_theme = branding_theme unless branding_theme == SKIP
|
|
397
|
+
@batch_payments = batch_payments unless batch_payments == SKIP
|
|
398
|
+
@discount = discount unless discount == SKIP
|
|
399
|
+
@balances = balances unless balances == SKIP
|
|
400
|
+
@attachments = attachments unless attachments == SKIP
|
|
401
|
+
@has_attachments = has_attachments unless has_attachments == SKIP
|
|
402
|
+
@validation_errors = validation_errors unless validation_errors == SKIP
|
|
403
|
+
@has_validation_errors = has_validation_errors unless has_validation_errors == SKIP
|
|
404
|
+
@status_attribute_string = status_attribute_string unless status_attribute_string == SKIP
|
|
405
|
+
@additional_properties = additional_properties
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Creates an instance of the object from a hash.
|
|
409
|
+
def self.from_hash(hash)
|
|
410
|
+
return nil unless hash
|
|
411
|
+
|
|
412
|
+
# Extract variables from the hash.
|
|
413
|
+
contact_id = hash.key?('ContactID') ? hash['ContactID'] : SKIP
|
|
414
|
+
merged_to_contact_id =
|
|
415
|
+
hash.key?('MergedToContactID') ? hash['MergedToContactID'] : SKIP
|
|
416
|
+
contact_number = hash.key?('ContactNumber') ? hash['ContactNumber'] : SKIP
|
|
417
|
+
account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
|
|
418
|
+
contact_status = hash.key?('ContactStatus') ? hash['ContactStatus'] : SKIP
|
|
419
|
+
name = hash.key?('Name') ? hash['Name'] : SKIP
|
|
420
|
+
first_name = hash.key?('FirstName') ? hash['FirstName'] : SKIP
|
|
421
|
+
last_name = hash.key?('LastName') ? hash['LastName'] : SKIP
|
|
422
|
+
company_number = hash.key?('CompanyNumber') ? hash['CompanyNumber'] : SKIP
|
|
423
|
+
email_address = hash.key?('EmailAddress') ? hash['EmailAddress'] : SKIP
|
|
424
|
+
# Parameter is an array, so we need to iterate through it
|
|
425
|
+
contact_persons = nil
|
|
426
|
+
unless hash['ContactPersons'].nil?
|
|
427
|
+
contact_persons = []
|
|
428
|
+
hash['ContactPersons'].each do |structure|
|
|
429
|
+
contact_persons << (ContactPerson.from_hash(structure) if structure)
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
contact_persons = SKIP unless hash.key?('ContactPersons')
|
|
434
|
+
bank_account_details =
|
|
435
|
+
hash.key?('BankAccountDetails') ? hash['BankAccountDetails'] : SKIP
|
|
436
|
+
tax_number = hash.key?('TaxNumber') ? hash['TaxNumber'] : SKIP
|
|
437
|
+
tax_number_type =
|
|
438
|
+
hash.key?('TaxNumberType') ? hash['TaxNumberType'] : SKIP
|
|
439
|
+
accounts_receivable_tax_type =
|
|
440
|
+
hash.key?('AccountsReceivableTaxType') ? hash['AccountsReceivableTaxType'] : SKIP
|
|
441
|
+
accounts_payable_tax_type =
|
|
442
|
+
hash.key?('AccountsPayableTaxType') ? hash['AccountsPayableTaxType'] : SKIP
|
|
443
|
+
# Parameter is an array, so we need to iterate through it
|
|
444
|
+
addresses = nil
|
|
445
|
+
unless hash['Addresses'].nil?
|
|
446
|
+
addresses = []
|
|
447
|
+
hash['Addresses'].each do |structure|
|
|
448
|
+
addresses << (Address.from_hash(structure) if structure)
|
|
449
|
+
end
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
addresses = SKIP unless hash.key?('Addresses')
|
|
453
|
+
# Parameter is an array, so we need to iterate through it
|
|
454
|
+
phones = nil
|
|
455
|
+
unless hash['Phones'].nil?
|
|
456
|
+
phones = []
|
|
457
|
+
hash['Phones'].each do |structure|
|
|
458
|
+
phones << (Phone.from_hash(structure) if structure)
|
|
459
|
+
end
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
phones = SKIP unless hash.key?('Phones')
|
|
463
|
+
is_supplier = hash.key?('IsSupplier') ? hash['IsSupplier'] : SKIP
|
|
464
|
+
is_customer = hash.key?('IsCustomer') ? hash['IsCustomer'] : SKIP
|
|
465
|
+
sales_default_line_amount_type =
|
|
466
|
+
hash.key?('SalesDefaultLineAmountType') ? hash['SalesDefaultLineAmountType'] : SKIP
|
|
467
|
+
purchases_default_line_amount_type =
|
|
468
|
+
hash.key?('PurchasesDefaultLineAmountType') ? hash['PurchasesDefaultLineAmountType'] : SKIP
|
|
469
|
+
default_currency =
|
|
470
|
+
hash.key?('DefaultCurrency') ? hash['DefaultCurrency'] : SKIP
|
|
471
|
+
xero_network_key =
|
|
472
|
+
hash.key?('XeroNetworkKey') ? hash['XeroNetworkKey'] : SKIP
|
|
473
|
+
sales_default_account_code =
|
|
474
|
+
hash.key?('SalesDefaultAccountCode') ? hash['SalesDefaultAccountCode'] : SKIP
|
|
475
|
+
purchases_default_account_code =
|
|
476
|
+
hash.key?('PurchasesDefaultAccountCode') ? hash['PurchasesDefaultAccountCode'] : SKIP
|
|
477
|
+
# Parameter is an array, so we need to iterate through it
|
|
478
|
+
sales_tracking_categories = nil
|
|
479
|
+
unless hash['SalesTrackingCategories'].nil?
|
|
480
|
+
sales_tracking_categories = []
|
|
481
|
+
hash['SalesTrackingCategories'].each do |structure|
|
|
482
|
+
sales_tracking_categories << (SalesTrackingCategory.from_hash(structure) if structure)
|
|
483
|
+
end
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
sales_tracking_categories = SKIP unless hash.key?('SalesTrackingCategories')
|
|
487
|
+
# Parameter is an array, so we need to iterate through it
|
|
488
|
+
purchases_tracking_categories = nil
|
|
489
|
+
unless hash['PurchasesTrackingCategories'].nil?
|
|
490
|
+
purchases_tracking_categories = []
|
|
491
|
+
hash['PurchasesTrackingCategories'].each do |structure|
|
|
492
|
+
purchases_tracking_categories << (SalesTrackingCategory.from_hash(structure) if structure)
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
purchases_tracking_categories = SKIP unless hash.key?('PurchasesTrackingCategories')
|
|
497
|
+
tracking_category_name =
|
|
498
|
+
hash.key?('TrackingCategoryName') ? hash['TrackingCategoryName'] : SKIP
|
|
499
|
+
tracking_category_option =
|
|
500
|
+
hash.key?('TrackingCategoryOption') ? hash['TrackingCategoryOption'] : SKIP
|
|
501
|
+
payment_terms = PaymentTerm.from_hash(hash['PaymentTerms']) if hash['PaymentTerms']
|
|
502
|
+
updated_date_utc =
|
|
503
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
504
|
+
# Parameter is an array, so we need to iterate through it
|
|
505
|
+
contact_groups = nil
|
|
506
|
+
unless hash['ContactGroups'].nil?
|
|
507
|
+
contact_groups = []
|
|
508
|
+
hash['ContactGroups'].each do |structure|
|
|
509
|
+
contact_groups << (ContactGroup.from_hash(structure) if structure)
|
|
510
|
+
end
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
contact_groups = SKIP unless hash.key?('ContactGroups')
|
|
514
|
+
website = hash.key?('Website') ? hash['Website'] : SKIP
|
|
515
|
+
branding_theme = BrandingTheme.from_hash(hash['BrandingTheme']) if hash['BrandingTheme']
|
|
516
|
+
batch_payments = BatchPaymentDetails.from_hash(hash['BatchPayments']) if
|
|
517
|
+
hash['BatchPayments']
|
|
518
|
+
discount = hash.key?('Discount') ? hash['Discount'] : SKIP
|
|
519
|
+
balances = Balances.from_hash(hash['Balances']) if hash['Balances']
|
|
520
|
+
# Parameter is an array, so we need to iterate through it
|
|
521
|
+
attachments = nil
|
|
522
|
+
unless hash['Attachments'].nil?
|
|
523
|
+
attachments = []
|
|
524
|
+
hash['Attachments'].each do |structure|
|
|
525
|
+
attachments << (Attachment.from_hash(structure) if structure)
|
|
526
|
+
end
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
attachments = SKIP unless hash.key?('Attachments')
|
|
530
|
+
has_attachments = hash['HasAttachments'] ||= false
|
|
531
|
+
# Parameter is an array, so we need to iterate through it
|
|
532
|
+
validation_errors = nil
|
|
533
|
+
unless hash['ValidationErrors'].nil?
|
|
534
|
+
validation_errors = []
|
|
535
|
+
hash['ValidationErrors'].each do |structure|
|
|
536
|
+
validation_errors << (ValidationError.from_hash(structure) if structure)
|
|
537
|
+
end
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
validation_errors = SKIP unless hash.key?('ValidationErrors')
|
|
541
|
+
has_validation_errors = hash['HasValidationErrors'] ||= false
|
|
542
|
+
status_attribute_string =
|
|
543
|
+
hash.key?('StatusAttributeString') ? hash['StatusAttributeString'] : SKIP
|
|
544
|
+
|
|
545
|
+
# Create a new hash for additional properties, removing known properties.
|
|
546
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
547
|
+
|
|
548
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
549
|
+
new_hash, proc { |value| value }
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
# Create object from extracted values.
|
|
553
|
+
Contact.new(contact_id: contact_id,
|
|
554
|
+
merged_to_contact_id: merged_to_contact_id,
|
|
555
|
+
contact_number: contact_number,
|
|
556
|
+
account_number: account_number,
|
|
557
|
+
contact_status: contact_status,
|
|
558
|
+
name: name,
|
|
559
|
+
first_name: first_name,
|
|
560
|
+
last_name: last_name,
|
|
561
|
+
company_number: company_number,
|
|
562
|
+
email_address: email_address,
|
|
563
|
+
contact_persons: contact_persons,
|
|
564
|
+
bank_account_details: bank_account_details,
|
|
565
|
+
tax_number: tax_number,
|
|
566
|
+
tax_number_type: tax_number_type,
|
|
567
|
+
accounts_receivable_tax_type: accounts_receivable_tax_type,
|
|
568
|
+
accounts_payable_tax_type: accounts_payable_tax_type,
|
|
569
|
+
addresses: addresses,
|
|
570
|
+
phones: phones,
|
|
571
|
+
is_supplier: is_supplier,
|
|
572
|
+
is_customer: is_customer,
|
|
573
|
+
sales_default_line_amount_type: sales_default_line_amount_type,
|
|
574
|
+
purchases_default_line_amount_type: purchases_default_line_amount_type,
|
|
575
|
+
default_currency: default_currency,
|
|
576
|
+
xero_network_key: xero_network_key,
|
|
577
|
+
sales_default_account_code: sales_default_account_code,
|
|
578
|
+
purchases_default_account_code: purchases_default_account_code,
|
|
579
|
+
sales_tracking_categories: sales_tracking_categories,
|
|
580
|
+
purchases_tracking_categories: purchases_tracking_categories,
|
|
581
|
+
tracking_category_name: tracking_category_name,
|
|
582
|
+
tracking_category_option: tracking_category_option,
|
|
583
|
+
payment_terms: payment_terms,
|
|
584
|
+
updated_date_utc: updated_date_utc,
|
|
585
|
+
contact_groups: contact_groups,
|
|
586
|
+
website: website,
|
|
587
|
+
branding_theme: branding_theme,
|
|
588
|
+
batch_payments: batch_payments,
|
|
589
|
+
discount: discount,
|
|
590
|
+
balances: balances,
|
|
591
|
+
attachments: attachments,
|
|
592
|
+
has_attachments: has_attachments,
|
|
593
|
+
validation_errors: validation_errors,
|
|
594
|
+
has_validation_errors: has_validation_errors,
|
|
595
|
+
status_attribute_string: status_attribute_string,
|
|
596
|
+
additional_properties: additional_properties)
|
|
597
|
+
end
|
|
598
|
+
|
|
599
|
+
# Provides a human-readable string representation of the object.
|
|
600
|
+
def to_s
|
|
601
|
+
class_name = self.class.name.split('::').last
|
|
602
|
+
"<#{class_name} contact_id: #{@contact_id}, merged_to_contact_id: #{@merged_to_contact_id},"\
|
|
603
|
+
" contact_number: #{@contact_number}, account_number: #{@account_number}, contact_status:"\
|
|
604
|
+
" #{@contact_status}, name: #{@name}, first_name: #{@first_name}, last_name: #{@last_name},"\
|
|
605
|
+
" company_number: #{@company_number}, email_address: #{@email_address}, contact_persons:"\
|
|
606
|
+
" #{@contact_persons}, bank_account_details: #{@bank_account_details}, tax_number:"\
|
|
607
|
+
" #{@tax_number}, tax_number_type: #{@tax_number_type}, accounts_receivable_tax_type:"\
|
|
608
|
+
" #{@accounts_receivable_tax_type}, accounts_payable_tax_type:"\
|
|
609
|
+
" #{@accounts_payable_tax_type}, addresses: #{@addresses}, phones: #{@phones}, is_supplier:"\
|
|
610
|
+
" #{@is_supplier}, is_customer: #{@is_customer}, sales_default_line_amount_type:"\
|
|
611
|
+
" #{@sales_default_line_amount_type}, purchases_default_line_amount_type:"\
|
|
612
|
+
" #{@purchases_default_line_amount_type}, default_currency: #{@default_currency},"\
|
|
613
|
+
" xero_network_key: #{@xero_network_key}, sales_default_account_code:"\
|
|
614
|
+
" #{@sales_default_account_code}, purchases_default_account_code:"\
|
|
615
|
+
" #{@purchases_default_account_code}, sales_tracking_categories:"\
|
|
616
|
+
" #{@sales_tracking_categories}, purchases_tracking_categories:"\
|
|
617
|
+
" #{@purchases_tracking_categories}, tracking_category_name: #{@tracking_category_name},"\
|
|
618
|
+
" tracking_category_option: #{@tracking_category_option}, payment_terms: #{@payment_terms},"\
|
|
619
|
+
" updated_date_utc: #{@updated_date_utc}, contact_groups: #{@contact_groups}, website:"\
|
|
620
|
+
" #{@website}, branding_theme: #{@branding_theme}, batch_payments: #{@batch_payments},"\
|
|
621
|
+
" discount: #{@discount}, balances: #{@balances}, attachments: #{@attachments},"\
|
|
622
|
+
" has_attachments: #{@has_attachments}, validation_errors: #{@validation_errors},"\
|
|
623
|
+
" has_validation_errors: #{@has_validation_errors}, status_attribute_string:"\
|
|
624
|
+
" #{@status_attribute_string}, additional_properties: #{@additional_properties}>"
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
628
|
+
def inspect
|
|
629
|
+
class_name = self.class.name.split('::').last
|
|
630
|
+
"<#{class_name} contact_id: #{@contact_id.inspect}, merged_to_contact_id:"\
|
|
631
|
+
" #{@merged_to_contact_id.inspect}, contact_number: #{@contact_number.inspect},"\
|
|
632
|
+
" account_number: #{@account_number.inspect}, contact_status: #{@contact_status.inspect},"\
|
|
633
|
+
" name: #{@name.inspect}, first_name: #{@first_name.inspect}, last_name:"\
|
|
634
|
+
" #{@last_name.inspect}, company_number: #{@company_number.inspect}, email_address:"\
|
|
635
|
+
" #{@email_address.inspect}, contact_persons: #{@contact_persons.inspect},"\
|
|
636
|
+
" bank_account_details: #{@bank_account_details.inspect}, tax_number:"\
|
|
637
|
+
" #{@tax_number.inspect}, tax_number_type: #{@tax_number_type.inspect},"\
|
|
638
|
+
" accounts_receivable_tax_type: #{@accounts_receivable_tax_type.inspect},"\
|
|
639
|
+
" accounts_payable_tax_type: #{@accounts_payable_tax_type.inspect}, addresses:"\
|
|
640
|
+
" #{@addresses.inspect}, phones: #{@phones.inspect}, is_supplier: #{@is_supplier.inspect},"\
|
|
641
|
+
" is_customer: #{@is_customer.inspect}, sales_default_line_amount_type:"\
|
|
642
|
+
" #{@sales_default_line_amount_type.inspect}, purchases_default_line_amount_type:"\
|
|
643
|
+
" #{@purchases_default_line_amount_type.inspect}, default_currency:"\
|
|
644
|
+
" #{@default_currency.inspect}, xero_network_key: #{@xero_network_key.inspect},"\
|
|
645
|
+
" sales_default_account_code: #{@sales_default_account_code.inspect},"\
|
|
646
|
+
" purchases_default_account_code: #{@purchases_default_account_code.inspect},"\
|
|
647
|
+
" sales_tracking_categories: #{@sales_tracking_categories.inspect},"\
|
|
648
|
+
" purchases_tracking_categories: #{@purchases_tracking_categories.inspect},"\
|
|
649
|
+
" tracking_category_name: #{@tracking_category_name.inspect}, tracking_category_option:"\
|
|
650
|
+
" #{@tracking_category_option.inspect}, payment_terms: #{@payment_terms.inspect},"\
|
|
651
|
+
" updated_date_utc: #{@updated_date_utc.inspect}, contact_groups:"\
|
|
652
|
+
" #{@contact_groups.inspect}, website: #{@website.inspect}, branding_theme:"\
|
|
653
|
+
" #{@branding_theme.inspect}, batch_payments: #{@batch_payments.inspect}, discount:"\
|
|
654
|
+
" #{@discount.inspect}, balances: #{@balances.inspect}, attachments:"\
|
|
655
|
+
" #{@attachments.inspect}, has_attachments: #{@has_attachments.inspect}, validation_errors:"\
|
|
656
|
+
" #{@validation_errors.inspect}, has_validation_errors: #{@has_validation_errors.inspect},"\
|
|
657
|
+
" status_attribute_string: #{@status_attribute_string.inspect}, additional_properties:"\
|
|
658
|
+
" #{@additional_properties}>"
|
|
659
|
+
end
|
|
660
|
+
end
|
|
661
|
+
end
|