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,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
|
+
# Organisations Model.
|
|
8
|
+
class Organisations < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[Organisation]]
|
|
14
|
+
attr_accessor :organisations
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['organisations'] = 'Organisations'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
organisations
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(organisations: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@organisations = organisations unless organisations == 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
|
+
organisations = nil
|
|
50
|
+
unless hash['Organisations'].nil?
|
|
51
|
+
organisations = []
|
|
52
|
+
hash['Organisations'].each do |structure|
|
|
53
|
+
organisations << (Organisation.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
organisations = SKIP unless hash.key?('Organisations')
|
|
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
|
+
Organisations.new(organisations: organisations,
|
|
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} organisations: #{@organisations}, 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} organisations: #{@organisations.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,309 @@
|
|
|
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
|
+
# Overpayment Model.
|
|
8
|
+
class Overpayment < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# See Overpayment Types
|
|
13
|
+
# @return [Type5]
|
|
14
|
+
attr_accessor :type
|
|
15
|
+
|
|
16
|
+
# See Overpayment Types
|
|
17
|
+
# @return [Contact]
|
|
18
|
+
attr_accessor :contact
|
|
19
|
+
|
|
20
|
+
# The date the overpayment is created YYYY-MM-DD
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :date
|
|
23
|
+
|
|
24
|
+
# See Overpayment Status Codes
|
|
25
|
+
# @return [Status5]
|
|
26
|
+
attr_accessor :status
|
|
27
|
+
|
|
28
|
+
# Line amounts are exclusive of tax by default if you don’t specify this
|
|
29
|
+
# element. See Line Amount Types
|
|
30
|
+
# @return [LineAmountTypes]
|
|
31
|
+
attr_accessor :line_amount_types
|
|
32
|
+
|
|
33
|
+
# See Overpayment Line Items
|
|
34
|
+
# @return [Array[LineItem]]
|
|
35
|
+
attr_accessor :line_items
|
|
36
|
+
|
|
37
|
+
# The subtotal of the overpayment excluding taxes
|
|
38
|
+
# @return [Float]
|
|
39
|
+
attr_accessor :sub_total
|
|
40
|
+
|
|
41
|
+
# The total tax on the overpayment
|
|
42
|
+
# @return [Float]
|
|
43
|
+
attr_accessor :total_tax
|
|
44
|
+
|
|
45
|
+
# The total of the overpayment (subtotal + total tax)
|
|
46
|
+
# @return [Float]
|
|
47
|
+
attr_accessor :total
|
|
48
|
+
|
|
49
|
+
# UTC timestamp of last update to the overpayment
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :updated_date_utc
|
|
52
|
+
|
|
53
|
+
# 3 letter alpha code for the currency – see list of currency codes
|
|
54
|
+
# @return [CurrencyCode]
|
|
55
|
+
attr_accessor :currency_code
|
|
56
|
+
|
|
57
|
+
# Xero generated unique identifier
|
|
58
|
+
# @return [UUID | String]
|
|
59
|
+
attr_accessor :overpayment_id
|
|
60
|
+
|
|
61
|
+
# The currency rate for a multicurrency overpayment. If no rate is
|
|
62
|
+
# specified, the XE.com day rate is used
|
|
63
|
+
# @return [Float]
|
|
64
|
+
attr_accessor :currency_rate
|
|
65
|
+
|
|
66
|
+
# The remaining credit balance on the overpayment
|
|
67
|
+
# @return [Float]
|
|
68
|
+
attr_accessor :remaining_credit
|
|
69
|
+
|
|
70
|
+
# See Allocations
|
|
71
|
+
# @return [Array[Allocation]]
|
|
72
|
+
attr_accessor :allocations
|
|
73
|
+
|
|
74
|
+
# The amount of applied to an invoice
|
|
75
|
+
# @return [Float]
|
|
76
|
+
attr_accessor :applied_amount
|
|
77
|
+
|
|
78
|
+
# See Payments
|
|
79
|
+
# @return [Array[Payment]]
|
|
80
|
+
attr_accessor :payments
|
|
81
|
+
|
|
82
|
+
# boolean to indicate if a overpayment has an attachment
|
|
83
|
+
# @return [TrueClass | FalseClass]
|
|
84
|
+
attr_accessor :has_attachments
|
|
85
|
+
|
|
86
|
+
# An optional description for Overpayment
|
|
87
|
+
# @return [String]
|
|
88
|
+
attr_accessor :reference
|
|
89
|
+
|
|
90
|
+
# See Attachments
|
|
91
|
+
# @return [Array[Attachment]]
|
|
92
|
+
attr_accessor :attachments
|
|
93
|
+
|
|
94
|
+
# A mapping from model property names to API property names.
|
|
95
|
+
def self.names
|
|
96
|
+
@_hash = {} if @_hash.nil?
|
|
97
|
+
@_hash['type'] = 'Type'
|
|
98
|
+
@_hash['contact'] = 'Contact'
|
|
99
|
+
@_hash['date'] = 'Date'
|
|
100
|
+
@_hash['status'] = 'Status'
|
|
101
|
+
@_hash['line_amount_types'] = 'LineAmountTypes'
|
|
102
|
+
@_hash['line_items'] = 'LineItems'
|
|
103
|
+
@_hash['sub_total'] = 'SubTotal'
|
|
104
|
+
@_hash['total_tax'] = 'TotalTax'
|
|
105
|
+
@_hash['total'] = 'Total'
|
|
106
|
+
@_hash['updated_date_utc'] = 'UpdatedDateUTC'
|
|
107
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
|
108
|
+
@_hash['overpayment_id'] = 'OverpaymentID'
|
|
109
|
+
@_hash['currency_rate'] = 'CurrencyRate'
|
|
110
|
+
@_hash['remaining_credit'] = 'RemainingCredit'
|
|
111
|
+
@_hash['allocations'] = 'Allocations'
|
|
112
|
+
@_hash['applied_amount'] = 'AppliedAmount'
|
|
113
|
+
@_hash['payments'] = 'Payments'
|
|
114
|
+
@_hash['has_attachments'] = 'HasAttachments'
|
|
115
|
+
@_hash['reference'] = 'Reference'
|
|
116
|
+
@_hash['attachments'] = 'Attachments'
|
|
117
|
+
@_hash
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# An array for optional fields
|
|
121
|
+
def self.optionals
|
|
122
|
+
%w[
|
|
123
|
+
type
|
|
124
|
+
contact
|
|
125
|
+
date
|
|
126
|
+
status
|
|
127
|
+
line_amount_types
|
|
128
|
+
line_items
|
|
129
|
+
sub_total
|
|
130
|
+
total_tax
|
|
131
|
+
total
|
|
132
|
+
updated_date_utc
|
|
133
|
+
currency_code
|
|
134
|
+
overpayment_id
|
|
135
|
+
currency_rate
|
|
136
|
+
remaining_credit
|
|
137
|
+
allocations
|
|
138
|
+
applied_amount
|
|
139
|
+
payments
|
|
140
|
+
has_attachments
|
|
141
|
+
reference
|
|
142
|
+
attachments
|
|
143
|
+
]
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# An array for nullable fields
|
|
147
|
+
def self.nullables
|
|
148
|
+
[]
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def initialize(type: SKIP, contact: SKIP, date: SKIP, status: SKIP,
|
|
152
|
+
line_amount_types: SKIP, line_items: SKIP, sub_total: SKIP,
|
|
153
|
+
total_tax: SKIP, total: SKIP, updated_date_utc: SKIP,
|
|
154
|
+
currency_code: SKIP, overpayment_id: SKIP,
|
|
155
|
+
currency_rate: SKIP, remaining_credit: SKIP,
|
|
156
|
+
allocations: SKIP, applied_amount: SKIP, payments: SKIP,
|
|
157
|
+
has_attachments: false, reference: SKIP, attachments: SKIP,
|
|
158
|
+
additional_properties: nil)
|
|
159
|
+
# Add additional model properties to the instance
|
|
160
|
+
additional_properties = {} if additional_properties.nil?
|
|
161
|
+
|
|
162
|
+
@type = type unless type == SKIP
|
|
163
|
+
@contact = contact unless contact == SKIP
|
|
164
|
+
@date = date unless date == SKIP
|
|
165
|
+
@status = status unless status == SKIP
|
|
166
|
+
@line_amount_types = line_amount_types unless line_amount_types == SKIP
|
|
167
|
+
@line_items = line_items unless line_items == SKIP
|
|
168
|
+
@sub_total = sub_total unless sub_total == SKIP
|
|
169
|
+
@total_tax = total_tax unless total_tax == SKIP
|
|
170
|
+
@total = total unless total == SKIP
|
|
171
|
+
@updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
|
|
172
|
+
@currency_code = currency_code unless currency_code == SKIP
|
|
173
|
+
@overpayment_id = overpayment_id unless overpayment_id == SKIP
|
|
174
|
+
@currency_rate = currency_rate unless currency_rate == SKIP
|
|
175
|
+
@remaining_credit = remaining_credit unless remaining_credit == SKIP
|
|
176
|
+
@allocations = allocations unless allocations == SKIP
|
|
177
|
+
@applied_amount = applied_amount unless applied_amount == SKIP
|
|
178
|
+
@payments = payments unless payments == SKIP
|
|
179
|
+
@has_attachments = has_attachments unless has_attachments == SKIP
|
|
180
|
+
@reference = reference unless reference == SKIP
|
|
181
|
+
@attachments = attachments unless attachments == SKIP
|
|
182
|
+
@additional_properties = additional_properties
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Creates an instance of the object from a hash.
|
|
186
|
+
def self.from_hash(hash)
|
|
187
|
+
return nil unless hash
|
|
188
|
+
|
|
189
|
+
# Extract variables from the hash.
|
|
190
|
+
type = hash.key?('Type') ? hash['Type'] : SKIP
|
|
191
|
+
contact = Contact.from_hash(hash['Contact']) if hash['Contact']
|
|
192
|
+
date = hash.key?('Date') ? hash['Date'] : SKIP
|
|
193
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
|
194
|
+
line_amount_types =
|
|
195
|
+
hash.key?('LineAmountTypes') ? hash['LineAmountTypes'] : SKIP
|
|
196
|
+
# Parameter is an array, so we need to iterate through it
|
|
197
|
+
line_items = nil
|
|
198
|
+
unless hash['LineItems'].nil?
|
|
199
|
+
line_items = []
|
|
200
|
+
hash['LineItems'].each do |structure|
|
|
201
|
+
line_items << (LineItem.from_hash(structure) if structure)
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
line_items = SKIP unless hash.key?('LineItems')
|
|
206
|
+
sub_total = hash.key?('SubTotal') ? hash['SubTotal'] : SKIP
|
|
207
|
+
total_tax = hash.key?('TotalTax') ? hash['TotalTax'] : SKIP
|
|
208
|
+
total = hash.key?('Total') ? hash['Total'] : SKIP
|
|
209
|
+
updated_date_utc =
|
|
210
|
+
hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
|
|
211
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
|
212
|
+
overpayment_id = hash.key?('OverpaymentID') ? hash['OverpaymentID'] : SKIP
|
|
213
|
+
currency_rate = hash.key?('CurrencyRate') ? hash['CurrencyRate'] : SKIP
|
|
214
|
+
remaining_credit =
|
|
215
|
+
hash.key?('RemainingCredit') ? hash['RemainingCredit'] : SKIP
|
|
216
|
+
# Parameter is an array, so we need to iterate through it
|
|
217
|
+
allocations = nil
|
|
218
|
+
unless hash['Allocations'].nil?
|
|
219
|
+
allocations = []
|
|
220
|
+
hash['Allocations'].each do |structure|
|
|
221
|
+
allocations << (Allocation.from_hash(structure) if structure)
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
allocations = SKIP unless hash.key?('Allocations')
|
|
226
|
+
applied_amount = hash.key?('AppliedAmount') ? hash['AppliedAmount'] : SKIP
|
|
227
|
+
# Parameter is an array, so we need to iterate through it
|
|
228
|
+
payments = nil
|
|
229
|
+
unless hash['Payments'].nil?
|
|
230
|
+
payments = []
|
|
231
|
+
hash['Payments'].each do |structure|
|
|
232
|
+
payments << (Payment.from_hash(structure) if structure)
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
payments = SKIP unless hash.key?('Payments')
|
|
237
|
+
has_attachments = hash['HasAttachments'] ||= false
|
|
238
|
+
reference = hash.key?('Reference') ? hash['Reference'] : SKIP
|
|
239
|
+
# Parameter is an array, so we need to iterate through it
|
|
240
|
+
attachments = nil
|
|
241
|
+
unless hash['Attachments'].nil?
|
|
242
|
+
attachments = []
|
|
243
|
+
hash['Attachments'].each do |structure|
|
|
244
|
+
attachments << (Attachment.from_hash(structure) if structure)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
attachments = SKIP unless hash.key?('Attachments')
|
|
249
|
+
|
|
250
|
+
# Create a new hash for additional properties, removing known properties.
|
|
251
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
252
|
+
|
|
253
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
254
|
+
new_hash, proc { |value| value }
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
# Create object from extracted values.
|
|
258
|
+
Overpayment.new(type: type,
|
|
259
|
+
contact: contact,
|
|
260
|
+
date: date,
|
|
261
|
+
status: status,
|
|
262
|
+
line_amount_types: line_amount_types,
|
|
263
|
+
line_items: line_items,
|
|
264
|
+
sub_total: sub_total,
|
|
265
|
+
total_tax: total_tax,
|
|
266
|
+
total: total,
|
|
267
|
+
updated_date_utc: updated_date_utc,
|
|
268
|
+
currency_code: currency_code,
|
|
269
|
+
overpayment_id: overpayment_id,
|
|
270
|
+
currency_rate: currency_rate,
|
|
271
|
+
remaining_credit: remaining_credit,
|
|
272
|
+
allocations: allocations,
|
|
273
|
+
applied_amount: applied_amount,
|
|
274
|
+
payments: payments,
|
|
275
|
+
has_attachments: has_attachments,
|
|
276
|
+
reference: reference,
|
|
277
|
+
attachments: attachments,
|
|
278
|
+
additional_properties: additional_properties)
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Provides a human-readable string representation of the object.
|
|
282
|
+
def to_s
|
|
283
|
+
class_name = self.class.name.split('::').last
|
|
284
|
+
"<#{class_name} type: #{@type}, contact: #{@contact}, date: #{@date}, status: #{@status},"\
|
|
285
|
+
" line_amount_types: #{@line_amount_types}, line_items: #{@line_items}, sub_total:"\
|
|
286
|
+
" #{@sub_total}, total_tax: #{@total_tax}, total: #{@total}, updated_date_utc:"\
|
|
287
|
+
" #{@updated_date_utc}, currency_code: #{@currency_code}, overpayment_id:"\
|
|
288
|
+
" #{@overpayment_id}, currency_rate: #{@currency_rate}, remaining_credit:"\
|
|
289
|
+
" #{@remaining_credit}, allocations: #{@allocations}, applied_amount: #{@applied_amount},"\
|
|
290
|
+
" payments: #{@payments}, has_attachments: #{@has_attachments}, reference: #{@reference},"\
|
|
291
|
+
" attachments: #{@attachments}, additional_properties: #{@additional_properties}>"
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
295
|
+
def inspect
|
|
296
|
+
class_name = self.class.name.split('::').last
|
|
297
|
+
"<#{class_name} type: #{@type.inspect}, contact: #{@contact.inspect}, date:"\
|
|
298
|
+
" #{@date.inspect}, status: #{@status.inspect}, line_amount_types:"\
|
|
299
|
+
" #{@line_amount_types.inspect}, line_items: #{@line_items.inspect}, sub_total:"\
|
|
300
|
+
" #{@sub_total.inspect}, total_tax: #{@total_tax.inspect}, total: #{@total.inspect},"\
|
|
301
|
+
" updated_date_utc: #{@updated_date_utc.inspect}, currency_code: #{@currency_code.inspect},"\
|
|
302
|
+
" overpayment_id: #{@overpayment_id.inspect}, currency_rate: #{@currency_rate.inspect},"\
|
|
303
|
+
" remaining_credit: #{@remaining_credit.inspect}, allocations: #{@allocations.inspect},"\
|
|
304
|
+
" applied_amount: #{@applied_amount.inspect}, payments: #{@payments.inspect},"\
|
|
305
|
+
" has_attachments: #{@has_attachments.inspect}, reference: #{@reference.inspect},"\
|
|
306
|
+
" attachments: #{@attachments.inspect}, additional_properties: #{@additional_properties}>"
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
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
|
+
# Overpayments Model.
|
|
8
|
+
class Overpayments < 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[Overpayment]]
|
|
22
|
+
attr_accessor :overpayments
|
|
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['overpayments'] = 'Overpayments'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
pagination
|
|
37
|
+
warnings
|
|
38
|
+
overpayments
|
|
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, overpayments: 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
|
+
@overpayments = overpayments unless overpayments == 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
|
+
overpayments = nil
|
|
76
|
+
unless hash['Overpayments'].nil?
|
|
77
|
+
overpayments = []
|
|
78
|
+
hash['Overpayments'].each do |structure|
|
|
79
|
+
overpayments << (Overpayment.from_hash(structure) if structure)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
overpayments = SKIP unless hash.key?('Overpayments')
|
|
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
|
+
Overpayments.new(pagination: pagination,
|
|
94
|
+
warnings: warnings,
|
|
95
|
+
overpayments: overpayments,
|
|
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}, overpayments:"\
|
|
103
|
+
" #{@overpayments}, 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
|
+
" overpayments: #{@overpayments.inspect}, additional_properties: #{@additional_properties}>"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
# Pagination Model.
|
|
8
|
+
class Pagination < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_accessor :page
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
attr_accessor :page_size
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :page_count
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [Integer]
|
|
26
|
+
attr_accessor :item_count
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['page'] = 'page'
|
|
32
|
+
@_hash['page_size'] = 'pageSize'
|
|
33
|
+
@_hash['page_count'] = 'pageCount'
|
|
34
|
+
@_hash['item_count'] = 'itemCount'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
%w[
|
|
41
|
+
page
|
|
42
|
+
page_size
|
|
43
|
+
page_count
|
|
44
|
+
item_count
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(page: SKIP, page_size: SKIP, page_count: SKIP,
|
|
54
|
+
item_count: SKIP, additional_properties: nil)
|
|
55
|
+
# Add additional model properties to the instance
|
|
56
|
+
additional_properties = {} if additional_properties.nil?
|
|
57
|
+
|
|
58
|
+
@page = page unless page == SKIP
|
|
59
|
+
@page_size = page_size unless page_size == SKIP
|
|
60
|
+
@page_count = page_count unless page_count == SKIP
|
|
61
|
+
@item_count = item_count unless item_count == SKIP
|
|
62
|
+
@additional_properties = additional_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Creates an instance of the object from a hash.
|
|
66
|
+
def self.from_hash(hash)
|
|
67
|
+
return nil unless hash
|
|
68
|
+
|
|
69
|
+
# Extract variables from the hash.
|
|
70
|
+
page = hash.key?('page') ? hash['page'] : SKIP
|
|
71
|
+
page_size = hash.key?('pageSize') ? hash['pageSize'] : SKIP
|
|
72
|
+
page_count = hash.key?('pageCount') ? hash['pageCount'] : SKIP
|
|
73
|
+
item_count = hash.key?('itemCount') ? hash['itemCount'] : SKIP
|
|
74
|
+
|
|
75
|
+
# Create a new hash for additional properties, removing known properties.
|
|
76
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
77
|
+
|
|
78
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
79
|
+
new_hash, proc { |value| value }
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Create object from extracted values.
|
|
83
|
+
Pagination.new(page: page,
|
|
84
|
+
page_size: page_size,
|
|
85
|
+
page_count: page_count,
|
|
86
|
+
item_count: item_count,
|
|
87
|
+
additional_properties: additional_properties)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} page: #{@page}, page_size: #{@page_size}, page_count: #{@page_count},"\
|
|
94
|
+
" item_count: #{@item_count}, additional_properties: #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} page: #{@page.inspect}, page_size: #{@page_size.inspect}, page_count:"\
|
|
101
|
+
" #{@page_count.inspect}, item_count: #{@item_count.inspect}, additional_properties:"\
|
|
102
|
+
" #{@additional_properties}>"
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|