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,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
|
+
# If the statement balances are credit or debit, the CreditDebitIndicator
|
|
8
|
+
# should be specified from the perspective of the Customer.
|
|
9
|
+
class CreditDebitIndicator
|
|
10
|
+
CREDIT_DEBIT_INDICATOR = [
|
|
11
|
+
# TODO: Write general description for CREDIT
|
|
12
|
+
CREDIT = 'CREDIT'.freeze,
|
|
13
|
+
|
|
14
|
+
# TODO: Write general description for DEBIT
|
|
15
|
+
DEBIT = 'DEBIT'.freeze
|
|
16
|
+
].freeze
|
|
17
|
+
|
|
18
|
+
def self.validate(value)
|
|
19
|
+
return false if value.nil?
|
|
20
|
+
|
|
21
|
+
CREDIT_DEBIT_INDICATOR.include?(value)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.from_value(value, default_value = CREDIT)
|
|
25
|
+
return default_value if value.nil?
|
|
26
|
+
|
|
27
|
+
str = value.to_s.strip
|
|
28
|
+
|
|
29
|
+
case str.downcase
|
|
30
|
+
when 'credit' then CREDIT
|
|
31
|
+
when 'debit' then DEBIT
|
|
32
|
+
else
|
|
33
|
+
default_value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,453 @@
|
|
|
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
|
+
# CreditNote Model.
|
|
8
|
+
class CreditNote < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# See Credit Note Types
|
|
13
|
+
# @return [Type6]
|
|
14
|
+
attr_accessor :type
|
|
15
|
+
|
|
16
|
+
# See Credit Note Types
|
|
17
|
+
# @return [Contact]
|
|
18
|
+
attr_accessor :contact
|
|
19
|
+
|
|
20
|
+
# The date the credit note is issued YYYY-MM-DD. If the Date element is not
|
|
21
|
+
# specified then it will default to the current date based on the timezone
|
|
22
|
+
# setting of the organisation
|
|
23
|
+
# @return [String]
|
|
24
|
+
attr_accessor :date
|
|
25
|
+
|
|
26
|
+
# Date invoice is due – YYYY-MM-DD
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :due_date
|
|
29
|
+
|
|
30
|
+
# See Credit Note Status Codes
|
|
31
|
+
# @return [Status6]
|
|
32
|
+
attr_accessor :status
|
|
33
|
+
|
|
34
|
+
# Line amounts are exclusive of tax by default if you don’t specify this
|
|
35
|
+
# element. See Line Amount Types
|
|
36
|
+
# @return [LineAmountTypes]
|
|
37
|
+
attr_accessor :line_amount_types
|
|
38
|
+
|
|
39
|
+
# See Invoice Line Items
|
|
40
|
+
# @return [Array[LineItem]]
|
|
41
|
+
attr_accessor :line_items
|
|
42
|
+
|
|
43
|
+
# The subtotal of the credit note excluding taxes
|
|
44
|
+
# @return [Float]
|
|
45
|
+
attr_accessor :sub_total
|
|
46
|
+
|
|
47
|
+
# The total tax on the credit note
|
|
48
|
+
# @return [Float]
|
|
49
|
+
attr_accessor :total_tax
|
|
50
|
+
|
|
51
|
+
# The total of the Credit Note(subtotal + total tax)
|
|
52
|
+
# @return [Float]
|
|
53
|
+
attr_accessor :total
|
|
54
|
+
|
|
55
|
+
# CIS deduction for UK contractors
|
|
56
|
+
# @return [Float]
|
|
57
|
+
attr_accessor :cis_deduction
|
|
58
|
+
|
|
59
|
+
# CIS Deduction rate for the organisation
|
|
60
|
+
# @return [Float]
|
|
61
|
+
attr_accessor :cis_rate
|
|
62
|
+
|
|
63
|
+
# UTC timestamp of last update to the credit note
|
|
64
|
+
# @return [String]
|
|
65
|
+
attr_accessor :updated_date_utc
|
|
66
|
+
|
|
67
|
+
# 3 letter alpha code for the currency – see list of currency codes
|
|
68
|
+
# @return [CurrencyCode]
|
|
69
|
+
attr_accessor :currency_code
|
|
70
|
+
|
|
71
|
+
# Date when credit note was fully paid(UTC format)
|
|
72
|
+
# @return [String]
|
|
73
|
+
attr_accessor :fully_paid_on_date
|
|
74
|
+
|
|
75
|
+
# Xero generated unique identifier
|
|
76
|
+
# @return [UUID | String]
|
|
77
|
+
attr_accessor :credit_note_id
|
|
78
|
+
|
|
79
|
+
# ACCRECCREDIT – Unique alpha numeric code identifying credit note (when
|
|
80
|
+
# missing will auto-generate from your Organisation Invoice Settings)
|
|
81
|
+
# @return [String]
|
|
82
|
+
attr_accessor :credit_note_number
|
|
83
|
+
|
|
84
|
+
# ACCRECCREDIT only – additional reference number
|
|
85
|
+
# @return [String]
|
|
86
|
+
attr_accessor :reference
|
|
87
|
+
|
|
88
|
+
# Boolean to set whether the credit note in the Xero app should be marked as
|
|
89
|
+
# “sent”. This can be set only on credit notes that have been approved
|
|
90
|
+
# @return [TrueClass | FalseClass]
|
|
91
|
+
attr_accessor :sent_to_contact
|
|
92
|
+
|
|
93
|
+
# The currency rate for a multicurrency invoice. If no rate is specified,
|
|
94
|
+
# the XE.com day rate is used
|
|
95
|
+
# @return [Float]
|
|
96
|
+
attr_accessor :currency_rate
|
|
97
|
+
|
|
98
|
+
# The remaining credit balance on the Credit Note
|
|
99
|
+
# @return [Float]
|
|
100
|
+
attr_accessor :remaining_credit
|
|
101
|
+
|
|
102
|
+
# See Allocations
|
|
103
|
+
# @return [Array[Allocation]]
|
|
104
|
+
attr_accessor :allocations
|
|
105
|
+
|
|
106
|
+
# The amount of applied to an invoice
|
|
107
|
+
# @return [Float]
|
|
108
|
+
attr_accessor :applied_amount
|
|
109
|
+
|
|
110
|
+
# See Payments
|
|
111
|
+
# @return [Array[Payment]]
|
|
112
|
+
attr_accessor :payments
|
|
113
|
+
|
|
114
|
+
# See BrandingThemes
|
|
115
|
+
# @return [UUID | String]
|
|
116
|
+
attr_accessor :branding_theme_id
|
|
117
|
+
|
|
118
|
+
# A string to indicate if a invoice status
|
|
119
|
+
# @return [String]
|
|
120
|
+
attr_accessor :status_attribute_string
|
|
121
|
+
|
|
122
|
+
# boolean to indicate if a credit note has an attachment
|
|
123
|
+
# @return [TrueClass | FalseClass]
|
|
124
|
+
attr_accessor :has_attachments
|
|
125
|
+
|
|
126
|
+
# A boolean to indicate if a credit note has an validation errors
|
|
127
|
+
# @return [TrueClass | FalseClass]
|
|
128
|
+
attr_accessor :has_errors
|
|
129
|
+
|
|
130
|
+
# Displays array of validation error messages from the API
|
|
131
|
+
# @return [Array[ValidationError]]
|
|
132
|
+
attr_accessor :validation_errors
|
|
133
|
+
|
|
134
|
+
# Displays array of warning messages from the API
|
|
135
|
+
# @return [Array[ValidationError]]
|
|
136
|
+
attr_accessor :warnings
|
|
137
|
+
|
|
138
|
+
# An array of addresses used to auto calculate sales tax
|
|
139
|
+
# @return [Array[InvoiceAddress]]
|
|
140
|
+
attr_accessor :invoice_addresses
|
|
141
|
+
|
|
142
|
+
# A mapping from model property names to API property names.
|
|
143
|
+
def self.names
|
|
144
|
+
@_hash = {} if @_hash.nil?
|
|
145
|
+
@_hash['type'] = 'Type'
|
|
146
|
+
@_hash['contact'] = 'Contact'
|
|
147
|
+
@_hash['date'] = 'Date'
|
|
148
|
+
@_hash['due_date'] = 'DueDate'
|
|
149
|
+
@_hash['status'] = 'Status'
|
|
150
|
+
@_hash['line_amount_types'] = 'LineAmountTypes'
|
|
151
|
+
@_hash['line_items'] = 'LineItems'
|
|
152
|
+
@_hash['sub_total'] = 'SubTotal'
|
|
153
|
+
@_hash['total_tax'] = 'TotalTax'
|
|
154
|
+
@_hash['total'] = 'Total'
|
|
155
|
+
@_hash['cis_deduction'] = 'CISDeduction'
|
|
156
|
+
@_hash['cis_rate'] = 'CISRate'
|
|
157
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
158
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
|
159
|
+
@_hash['fully_paid_on_date'] = 'FullyPaidOnDate'
|
|
160
|
+
@_hash['credit_note_id'] = 'CreditNoteID'
|
|
161
|
+
@_hash['credit_note_number'] = 'CreditNoteNumber'
|
|
162
|
+
@_hash['reference'] = 'Reference'
|
|
163
|
+
@_hash['sent_to_contact'] = 'SentToContact'
|
|
164
|
+
@_hash['currency_rate'] = 'CurrencyRate'
|
|
165
|
+
@_hash['remaining_credit'] = 'RemainingCredit'
|
|
166
|
+
@_hash['allocations'] = 'Allocations'
|
|
167
|
+
@_hash['applied_amount'] = 'AppliedAmount'
|
|
168
|
+
@_hash['payments'] = 'Payments'
|
|
169
|
+
@_hash['branding_theme_id'] = 'BrandingThemeID'
|
|
170
|
+
@_hash['status_attribute_string'] = 'StatusAttributeString'
|
|
171
|
+
@_hash['has_attachments'] = 'HasAttachments'
|
|
172
|
+
@_hash['has_errors'] = 'HasErrors'
|
|
173
|
+
@_hash['validation_errors'] = 'ValidationErrors'
|
|
174
|
+
@_hash['warnings'] = 'Warnings'
|
|
175
|
+
@_hash['invoice_addresses'] = 'InvoiceAddresses'
|
|
176
|
+
@_hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# An array for optional fields
|
|
180
|
+
def self.optionals
|
|
181
|
+
%w[
|
|
182
|
+
type
|
|
183
|
+
contact
|
|
184
|
+
date
|
|
185
|
+
due_date
|
|
186
|
+
status
|
|
187
|
+
line_amount_types
|
|
188
|
+
line_items
|
|
189
|
+
sub_total
|
|
190
|
+
total_tax
|
|
191
|
+
total
|
|
192
|
+
cis_deduction
|
|
193
|
+
cis_rate
|
|
194
|
+
updated_date_utc
|
|
195
|
+
currency_code
|
|
196
|
+
fully_paid_on_date
|
|
197
|
+
credit_note_id
|
|
198
|
+
credit_note_number
|
|
199
|
+
reference
|
|
200
|
+
sent_to_contact
|
|
201
|
+
currency_rate
|
|
202
|
+
remaining_credit
|
|
203
|
+
allocations
|
|
204
|
+
applied_amount
|
|
205
|
+
payments
|
|
206
|
+
branding_theme_id
|
|
207
|
+
status_attribute_string
|
|
208
|
+
has_attachments
|
|
209
|
+
has_errors
|
|
210
|
+
validation_errors
|
|
211
|
+
warnings
|
|
212
|
+
invoice_addresses
|
|
213
|
+
]
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# An array for nullable fields
|
|
217
|
+
def self.nullables
|
|
218
|
+
[]
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def initialize(type: SKIP, contact: SKIP, date: SKIP, due_date: SKIP,
|
|
222
|
+
status: SKIP, line_amount_types: SKIP, line_items: SKIP,
|
|
223
|
+
sub_total: SKIP, total_tax: SKIP, total: SKIP,
|
|
224
|
+
cis_deduction: SKIP, cis_rate: SKIP, updated_date_utc: SKIP,
|
|
225
|
+
currency_code: SKIP, fully_paid_on_date: SKIP,
|
|
226
|
+
credit_note_id: SKIP, credit_note_number: SKIP,
|
|
227
|
+
reference: SKIP, sent_to_contact: SKIP, currency_rate: SKIP,
|
|
228
|
+
remaining_credit: SKIP, allocations: SKIP,
|
|
229
|
+
applied_amount: SKIP, payments: SKIP,
|
|
230
|
+
branding_theme_id: SKIP, status_attribute_string: SKIP,
|
|
231
|
+
has_attachments: false, has_errors: false,
|
|
232
|
+
validation_errors: SKIP, warnings: SKIP,
|
|
233
|
+
invoice_addresses: SKIP, additional_properties: nil)
|
|
234
|
+
# Add additional model properties to the instance
|
|
235
|
+
additional_properties = {} if additional_properties.nil?
|
|
236
|
+
|
|
237
|
+
@type = type unless type == SKIP
|
|
238
|
+
@contact = contact unless contact == SKIP
|
|
239
|
+
@date = date unless date == SKIP
|
|
240
|
+
@due_date = due_date unless due_date == SKIP
|
|
241
|
+
@status = status unless status == SKIP
|
|
242
|
+
@line_amount_types = line_amount_types unless line_amount_types == SKIP
|
|
243
|
+
@line_items = line_items unless line_items == SKIP
|
|
244
|
+
@sub_total = sub_total unless sub_total == SKIP
|
|
245
|
+
@total_tax = total_tax unless total_tax == SKIP
|
|
246
|
+
@total = total unless total == SKIP
|
|
247
|
+
@cis_deduction = cis_deduction unless cis_deduction == SKIP
|
|
248
|
+
@cis_rate = cis_rate unless cis_rate == SKIP
|
|
249
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
250
|
+
@currency_code = currency_code unless currency_code == SKIP
|
|
251
|
+
@fully_paid_on_date = fully_paid_on_date unless fully_paid_on_date == SKIP
|
|
252
|
+
@credit_note_id = credit_note_id unless credit_note_id == SKIP
|
|
253
|
+
@credit_note_number = credit_note_number unless credit_note_number == SKIP
|
|
254
|
+
@reference = reference unless reference == SKIP
|
|
255
|
+
@sent_to_contact = sent_to_contact unless sent_to_contact == SKIP
|
|
256
|
+
@currency_rate = currency_rate unless currency_rate == SKIP
|
|
257
|
+
@remaining_credit = remaining_credit unless remaining_credit == SKIP
|
|
258
|
+
@allocations = allocations unless allocations == SKIP
|
|
259
|
+
@applied_amount = applied_amount unless applied_amount == SKIP
|
|
260
|
+
@payments = payments unless payments == SKIP
|
|
261
|
+
@branding_theme_id = branding_theme_id unless branding_theme_id == SKIP
|
|
262
|
+
@status_attribute_string = status_attribute_string unless status_attribute_string == SKIP
|
|
263
|
+
@has_attachments = has_attachments unless has_attachments == SKIP
|
|
264
|
+
@has_errors = has_errors unless has_errors == SKIP
|
|
265
|
+
@validation_errors = validation_errors unless validation_errors == SKIP
|
|
266
|
+
@warnings = warnings unless warnings == SKIP
|
|
267
|
+
@invoice_addresses = invoice_addresses unless invoice_addresses == SKIP
|
|
268
|
+
@additional_properties = additional_properties
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Creates an instance of the object from a hash.
|
|
272
|
+
def self.from_hash(hash)
|
|
273
|
+
return nil unless hash
|
|
274
|
+
|
|
275
|
+
# Extract variables from the hash.
|
|
276
|
+
type = hash.key?('Type') ? hash['Type'] : SKIP
|
|
277
|
+
contact = Contact.from_hash(hash['Contact']) if hash['Contact']
|
|
278
|
+
date = hash.key?('Date') ? hash['Date'] : SKIP
|
|
279
|
+
due_date = hash.key?('DueDate') ? hash['DueDate'] : SKIP
|
|
280
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
|
281
|
+
line_amount_types =
|
|
282
|
+
hash.key?('LineAmountTypes') ? hash['LineAmountTypes'] : SKIP
|
|
283
|
+
# Parameter is an array, so we need to iterate through it
|
|
284
|
+
line_items = nil
|
|
285
|
+
unless hash['LineItems'].nil?
|
|
286
|
+
line_items = []
|
|
287
|
+
hash['LineItems'].each do |structure|
|
|
288
|
+
line_items << (LineItem.from_hash(structure) if structure)
|
|
289
|
+
end
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
line_items = SKIP unless hash.key?('LineItems')
|
|
293
|
+
sub_total = hash.key?('SubTotal') ? hash['SubTotal'] : SKIP
|
|
294
|
+
total_tax = hash.key?('TotalTax') ? hash['TotalTax'] : SKIP
|
|
295
|
+
total = hash.key?('Total') ? hash['Total'] : SKIP
|
|
296
|
+
cis_deduction = hash.key?('CISDeduction') ? hash['CISDeduction'] : SKIP
|
|
297
|
+
cis_rate = hash.key?('CISRate') ? hash['CISRate'] : SKIP
|
|
298
|
+
updated_date_utc =
|
|
299
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
300
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
|
301
|
+
fully_paid_on_date =
|
|
302
|
+
hash.key?('FullyPaidOnDate') ? hash['FullyPaidOnDate'] : SKIP
|
|
303
|
+
credit_note_id = hash.key?('CreditNoteID') ? hash['CreditNoteID'] : SKIP
|
|
304
|
+
credit_note_number =
|
|
305
|
+
hash.key?('CreditNoteNumber') ? hash['CreditNoteNumber'] : SKIP
|
|
306
|
+
reference = hash.key?('Reference') ? hash['Reference'] : SKIP
|
|
307
|
+
sent_to_contact =
|
|
308
|
+
hash.key?('SentToContact') ? hash['SentToContact'] : SKIP
|
|
309
|
+
currency_rate = hash.key?('CurrencyRate') ? hash['CurrencyRate'] : SKIP
|
|
310
|
+
remaining_credit =
|
|
311
|
+
hash.key?('RemainingCredit') ? hash['RemainingCredit'] : SKIP
|
|
312
|
+
# Parameter is an array, so we need to iterate through it
|
|
313
|
+
allocations = nil
|
|
314
|
+
unless hash['Allocations'].nil?
|
|
315
|
+
allocations = []
|
|
316
|
+
hash['Allocations'].each do |structure|
|
|
317
|
+
allocations << (Allocation.from_hash(structure) if structure)
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
allocations = SKIP unless hash.key?('Allocations')
|
|
322
|
+
applied_amount = hash.key?('AppliedAmount') ? hash['AppliedAmount'] : SKIP
|
|
323
|
+
# Parameter is an array, so we need to iterate through it
|
|
324
|
+
payments = nil
|
|
325
|
+
unless hash['Payments'].nil?
|
|
326
|
+
payments = []
|
|
327
|
+
hash['Payments'].each do |structure|
|
|
328
|
+
payments << (Payment.from_hash(structure) if structure)
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
payments = SKIP unless hash.key?('Payments')
|
|
333
|
+
branding_theme_id =
|
|
334
|
+
hash.key?('BrandingThemeID') ? hash['BrandingThemeID'] : SKIP
|
|
335
|
+
status_attribute_string =
|
|
336
|
+
hash.key?('StatusAttributeString') ? hash['StatusAttributeString'] : SKIP
|
|
337
|
+
has_attachments = hash['HasAttachments'] ||= false
|
|
338
|
+
has_errors = hash['HasErrors'] ||= false
|
|
339
|
+
# Parameter is an array, so we need to iterate through it
|
|
340
|
+
validation_errors = nil
|
|
341
|
+
unless hash['ValidationErrors'].nil?
|
|
342
|
+
validation_errors = []
|
|
343
|
+
hash['ValidationErrors'].each do |structure|
|
|
344
|
+
validation_errors << (ValidationError.from_hash(structure) if structure)
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
validation_errors = SKIP unless hash.key?('ValidationErrors')
|
|
349
|
+
# Parameter is an array, so we need to iterate through it
|
|
350
|
+
warnings = nil
|
|
351
|
+
unless hash['Warnings'].nil?
|
|
352
|
+
warnings = []
|
|
353
|
+
hash['Warnings'].each do |structure|
|
|
354
|
+
warnings << (ValidationError.from_hash(structure) if structure)
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
359
|
+
# Parameter is an array, so we need to iterate through it
|
|
360
|
+
invoice_addresses = nil
|
|
361
|
+
unless hash['InvoiceAddresses'].nil?
|
|
362
|
+
invoice_addresses = []
|
|
363
|
+
hash['InvoiceAddresses'].each do |structure|
|
|
364
|
+
invoice_addresses << (InvoiceAddress.from_hash(structure) if structure)
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
invoice_addresses = SKIP unless hash.key?('InvoiceAddresses')
|
|
369
|
+
|
|
370
|
+
# Create a new hash for additional properties, removing known properties.
|
|
371
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
372
|
+
|
|
373
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
374
|
+
new_hash, proc { |value| value }
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
# Create object from extracted values.
|
|
378
|
+
CreditNote.new(type: type,
|
|
379
|
+
contact: contact,
|
|
380
|
+
date: date,
|
|
381
|
+
due_date: due_date,
|
|
382
|
+
status: status,
|
|
383
|
+
line_amount_types: line_amount_types,
|
|
384
|
+
line_items: line_items,
|
|
385
|
+
sub_total: sub_total,
|
|
386
|
+
total_tax: total_tax,
|
|
387
|
+
total: total,
|
|
388
|
+
cis_deduction: cis_deduction,
|
|
389
|
+
cis_rate: cis_rate,
|
|
390
|
+
updated_date_utc: updated_date_utc,
|
|
391
|
+
currency_code: currency_code,
|
|
392
|
+
fully_paid_on_date: fully_paid_on_date,
|
|
393
|
+
credit_note_id: credit_note_id,
|
|
394
|
+
credit_note_number: credit_note_number,
|
|
395
|
+
reference: reference,
|
|
396
|
+
sent_to_contact: sent_to_contact,
|
|
397
|
+
currency_rate: currency_rate,
|
|
398
|
+
remaining_credit: remaining_credit,
|
|
399
|
+
allocations: allocations,
|
|
400
|
+
applied_amount: applied_amount,
|
|
401
|
+
payments: payments,
|
|
402
|
+
branding_theme_id: branding_theme_id,
|
|
403
|
+
status_attribute_string: status_attribute_string,
|
|
404
|
+
has_attachments: has_attachments,
|
|
405
|
+
has_errors: has_errors,
|
|
406
|
+
validation_errors: validation_errors,
|
|
407
|
+
warnings: warnings,
|
|
408
|
+
invoice_addresses: invoice_addresses,
|
|
409
|
+
additional_properties: additional_properties)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Provides a human-readable string representation of the object.
|
|
413
|
+
def to_s
|
|
414
|
+
class_name = self.class.name.split('::').last
|
|
415
|
+
"<#{class_name} type: #{@type}, contact: #{@contact}, date: #{@date}, due_date:"\
|
|
416
|
+
" #{@due_date}, status: #{@status}, line_amount_types: #{@line_amount_types}, line_items:"\
|
|
417
|
+
" #{@line_items}, sub_total: #{@sub_total}, total_tax: #{@total_tax}, total: #{@total},"\
|
|
418
|
+
" cis_deduction: #{@cis_deduction}, cis_rate: #{@cis_rate}, updated_date_utc:"\
|
|
419
|
+
" #{@updated_date_utc}, currency_code: #{@currency_code}, fully_paid_on_date:"\
|
|
420
|
+
" #{@fully_paid_on_date}, credit_note_id: #{@credit_note_id}, credit_note_number:"\
|
|
421
|
+
" #{@credit_note_number}, reference: #{@reference}, sent_to_contact: #{@sent_to_contact},"\
|
|
422
|
+
" currency_rate: #{@currency_rate}, remaining_credit: #{@remaining_credit}, allocations:"\
|
|
423
|
+
" #{@allocations}, applied_amount: #{@applied_amount}, payments: #{@payments},"\
|
|
424
|
+
" branding_theme_id: #{@branding_theme_id}, status_attribute_string:"\
|
|
425
|
+
" #{@status_attribute_string}, has_attachments: #{@has_attachments}, has_errors:"\
|
|
426
|
+
" #{@has_errors}, validation_errors: #{@validation_errors}, warnings: #{@warnings},"\
|
|
427
|
+
" invoice_addresses: #{@invoice_addresses}, additional_properties:"\
|
|
428
|
+
" #{@additional_properties}>"
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
432
|
+
def inspect
|
|
433
|
+
class_name = self.class.name.split('::').last
|
|
434
|
+
"<#{class_name} type: #{@type.inspect}, contact: #{@contact.inspect}, date:"\
|
|
435
|
+
" #{@date.inspect}, due_date: #{@due_date.inspect}, status: #{@status.inspect},"\
|
|
436
|
+
" line_amount_types: #{@line_amount_types.inspect}, line_items: #{@line_items.inspect},"\
|
|
437
|
+
" sub_total: #{@sub_total.inspect}, total_tax: #{@total_tax.inspect}, total:"\
|
|
438
|
+
" #{@total.inspect}, cis_deduction: #{@cis_deduction.inspect}, cis_rate:"\
|
|
439
|
+
" #{@cis_rate.inspect}, updated_date_utc: #{@updated_date_utc.inspect}, currency_code:"\
|
|
440
|
+
" #{@currency_code.inspect}, fully_paid_on_date: #{@fully_paid_on_date.inspect},"\
|
|
441
|
+
" credit_note_id: #{@credit_note_id.inspect}, credit_note_number:"\
|
|
442
|
+
" #{@credit_note_number.inspect}, reference: #{@reference.inspect}, sent_to_contact:"\
|
|
443
|
+
" #{@sent_to_contact.inspect}, currency_rate: #{@currency_rate.inspect}, remaining_credit:"\
|
|
444
|
+
" #{@remaining_credit.inspect}, allocations: #{@allocations.inspect}, applied_amount:"\
|
|
445
|
+
" #{@applied_amount.inspect}, payments: #{@payments.inspect}, branding_theme_id:"\
|
|
446
|
+
" #{@branding_theme_id.inspect}, status_attribute_string:"\
|
|
447
|
+
" #{@status_attribute_string.inspect}, has_attachments: #{@has_attachments.inspect},"\
|
|
448
|
+
" has_errors: #{@has_errors.inspect}, validation_errors: #{@validation_errors.inspect},"\
|
|
449
|
+
" warnings: #{@warnings.inspect}, invoice_addresses: #{@invoice_addresses.inspect},"\
|
|
450
|
+
" additional_properties: #{@additional_properties}>"
|
|
451
|
+
end
|
|
452
|
+
end
|
|
453
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
# CreditNotes Model.
|
|
8
|
+
class CreditNotes < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Pagination]
|
|
14
|
+
attr_accessor :pagination
|
|
15
|
+
|
|
16
|
+
# Displays array of warning messages from the API
|
|
17
|
+
# @return [Array[ValidationError]]
|
|
18
|
+
attr_accessor :warnings
|
|
19
|
+
|
|
20
|
+
# Displays array of warning messages from the API
|
|
21
|
+
# @return [Array[CreditNote]]
|
|
22
|
+
attr_accessor :credit_notes
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['pagination'] = 'pagination'
|
|
28
|
+
@_hash['warnings'] = 'Warnings'
|
|
29
|
+
@_hash['credit_notes'] = 'CreditNotes'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
pagination
|
|
37
|
+
warnings
|
|
38
|
+
credit_notes
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(pagination: SKIP, warnings: SKIP, credit_notes: SKIP,
|
|
48
|
+
additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@pagination = pagination unless pagination == SKIP
|
|
53
|
+
@warnings = warnings unless warnings == SKIP
|
|
54
|
+
@credit_notes = credit_notes unless credit_notes == SKIP
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
pagination = Pagination.from_hash(hash['pagination']) if hash['pagination']
|
|
64
|
+
# Parameter is an array, so we need to iterate through it
|
|
65
|
+
warnings = nil
|
|
66
|
+
unless hash['Warnings'].nil?
|
|
67
|
+
warnings = []
|
|
68
|
+
hash['Warnings'].each do |structure|
|
|
69
|
+
warnings << (ValidationError.from_hash(structure) if structure)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
warnings = SKIP unless hash.key?('Warnings')
|
|
74
|
+
# Parameter is an array, so we need to iterate through it
|
|
75
|
+
credit_notes = nil
|
|
76
|
+
unless hash['CreditNotes'].nil?
|
|
77
|
+
credit_notes = []
|
|
78
|
+
hash['CreditNotes'].each do |structure|
|
|
79
|
+
credit_notes << (CreditNote.from_hash(structure) if structure)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
credit_notes = SKIP unless hash.key?('CreditNotes')
|
|
84
|
+
|
|
85
|
+
# Create a new hash for additional properties, removing known properties.
|
|
86
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
87
|
+
|
|
88
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
89
|
+
new_hash, proc { |value| value }
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Create object from extracted values.
|
|
93
|
+
CreditNotes.new(pagination: pagination,
|
|
94
|
+
warnings: warnings,
|
|
95
|
+
credit_notes: credit_notes,
|
|
96
|
+
additional_properties: additional_properties)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a human-readable string representation of the object.
|
|
100
|
+
def to_s
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} pagination: #{@pagination}, warnings: #{@warnings}, credit_notes:"\
|
|
103
|
+
" #{@credit_notes}, additional_properties: #{@additional_properties}>"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
107
|
+
def inspect
|
|
108
|
+
class_name = self.class.name.split('::').last
|
|
109
|
+
"<#{class_name} pagination: #{@pagination.inspect}, warnings: #{@warnings.inspect},"\
|
|
110
|
+
" credit_notes: #{@credit_notes.inspect}, additional_properties: #{@additional_properties}>"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
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
|
+
# Currencies Model.
|
|
8
|
+
class Currencies < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Currency]]
|
|
14
|
+
attr_accessor :currencies
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['currencies'] = 'Currencies'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
currencies
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(currencies: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@currencies = currencies unless currencies == 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
|
+
currencies = nil
|
|
50
|
+
unless hash['Currencies'].nil?
|
|
51
|
+
currencies = []
|
|
52
|
+
hash['Currencies'].each do |structure|
|
|
53
|
+
currencies << (Currency.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
currencies = SKIP unless hash.key?('Currencies')
|
|
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
|
+
Currencies.new(currencies: currencies,
|
|
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} currencies: #{@currencies}, 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} currencies: #{@currencies.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|