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,210 @@
|
|
|
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
|
+
# AssetApi
|
|
8
|
+
class AssetApi < BaseApi
|
|
9
|
+
# By passing in the appropriate options, you can search for available fixed
|
|
10
|
+
# asset in the system
|
|
11
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
12
|
+
# Tenant
|
|
13
|
+
# @param [AssetStatusQueryParam] status Required parameter: Required when
|
|
14
|
+
# retrieving a collection of assets. See Asset Status Codes
|
|
15
|
+
# @param [Integer] page Optional parameter: Results are paged. This
|
|
16
|
+
# specifies which page of the results to return. The default page is 1.
|
|
17
|
+
# @param [Integer] page_size Optional parameter: The number of records
|
|
18
|
+
# returned per page. By default the number of records returned is 10.
|
|
19
|
+
# @param [OrderBy] order_by Optional parameter: Requests can be ordered by
|
|
20
|
+
# AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the
|
|
21
|
+
# asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
|
|
22
|
+
# @param [SortDirection] sort_direction Optional parameter: ASC or DESC
|
|
23
|
+
# @param [String] filter_by Optional parameter: A string that can be used to
|
|
24
|
+
# filter the list to only return assets containing the text. Checks it
|
|
25
|
+
# against the AssetName, AssetNumber, Description and AssetTypeName
|
|
26
|
+
# fields.
|
|
27
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
28
|
+
def get_assets(xero_tenant_id,
|
|
29
|
+
status,
|
|
30
|
+
page: nil,
|
|
31
|
+
page_size: nil,
|
|
32
|
+
order_by: nil,
|
|
33
|
+
sort_direction: nil,
|
|
34
|
+
filter_by: nil)
|
|
35
|
+
@api_call
|
|
36
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
37
|
+
'/Assets',
|
|
38
|
+
Server::DEFAULT1)
|
|
39
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
40
|
+
.is_required(true))
|
|
41
|
+
.query_param(new_parameter(status, key: 'status')
|
|
42
|
+
.is_required(true))
|
|
43
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
44
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
45
|
+
.query_param(new_parameter(order_by, key: 'orderBy'))
|
|
46
|
+
.query_param(new_parameter(sort_direction, key: 'sortDirection'))
|
|
47
|
+
.query_param(new_parameter(filter_by, key: 'filterBy'))
|
|
48
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
49
|
+
.auth(Single.new('OAuth2')))
|
|
50
|
+
.response(new_response_handler
|
|
51
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
52
|
+
.deserialize_into(Assets.method(:from_hash))
|
|
53
|
+
.is_api_response(true)
|
|
54
|
+
.local_error('400',
|
|
55
|
+
'bad input parameter',
|
|
56
|
+
APIException))
|
|
57
|
+
.execute
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Adds an asset to the system
|
|
61
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
62
|
+
# Tenant
|
|
63
|
+
# @param [Asset] body Required parameter: Fixed asset you are creating
|
|
64
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
65
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
66
|
+
# character max.
|
|
67
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
68
|
+
def create_asset(xero_tenant_id,
|
|
69
|
+
body,
|
|
70
|
+
idempotency_key: nil)
|
|
71
|
+
@api_call
|
|
72
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
73
|
+
'/Assets',
|
|
74
|
+
Server::DEFAULT1)
|
|
75
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
76
|
+
.is_required(true))
|
|
77
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
78
|
+
.body_param(new_parameter(body)
|
|
79
|
+
.is_required(true))
|
|
80
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
81
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
82
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
83
|
+
.auth(Single.new('OAuth2')))
|
|
84
|
+
.response(new_response_handler
|
|
85
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
86
|
+
.deserialize_into(Asset.method(:from_hash))
|
|
87
|
+
.is_api_response(true)
|
|
88
|
+
.local_error('400',
|
|
89
|
+
'invalid input, object invalid',
|
|
90
|
+
Assets400ErrorException))
|
|
91
|
+
.execute
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# By passing in the appropriate asset id, you can search for
|
|
95
|
+
# a specific fixed asset in the system
|
|
96
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
97
|
+
# Tenant
|
|
98
|
+
# @param [UUID | String] id Required parameter: fixed asset id for single
|
|
99
|
+
# object
|
|
100
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
101
|
+
def get_asset_by_id(xero_tenant_id,
|
|
102
|
+
id)
|
|
103
|
+
@api_call
|
|
104
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
105
|
+
'/Assets/{id}',
|
|
106
|
+
Server::DEFAULT1)
|
|
107
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
108
|
+
.is_required(true))
|
|
109
|
+
.template_param(new_parameter(id, key: 'id')
|
|
110
|
+
.is_required(true)
|
|
111
|
+
.should_encode(true))
|
|
112
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
113
|
+
.auth(Single.new('OAuth2')))
|
|
114
|
+
.response(new_response_handler
|
|
115
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
116
|
+
.deserialize_into(Asset.method(:from_hash))
|
|
117
|
+
.is_api_response(true)
|
|
118
|
+
.local_error('400',
|
|
119
|
+
'bad input parameter',
|
|
120
|
+
APIException))
|
|
121
|
+
.execute
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# By passing in the appropriate options, you can search for available fixed
|
|
125
|
+
# asset types in the system
|
|
126
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
127
|
+
# Tenant
|
|
128
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
129
|
+
def get_asset_types(xero_tenant_id)
|
|
130
|
+
@api_call
|
|
131
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
132
|
+
'/AssetTypes',
|
|
133
|
+
Server::DEFAULT1)
|
|
134
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
135
|
+
.is_required(true))
|
|
136
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
137
|
+
.auth(Single.new('OAuth2')))
|
|
138
|
+
.response(new_response_handler
|
|
139
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
140
|
+
.deserialize_into(AssetType.method(:from_hash))
|
|
141
|
+
.is_api_response(true)
|
|
142
|
+
.is_response_array(true)
|
|
143
|
+
.local_error('400',
|
|
144
|
+
'bad input parameter',
|
|
145
|
+
APIException))
|
|
146
|
+
.execute
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Adds an fixed asset type to the system
|
|
150
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
151
|
+
# Tenant
|
|
152
|
+
# @param [AssetType] body Required parameter: Asset type to add
|
|
153
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
154
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
155
|
+
# character max.
|
|
156
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
157
|
+
def create_asset_type(xero_tenant_id,
|
|
158
|
+
body,
|
|
159
|
+
idempotency_key: nil)
|
|
160
|
+
@api_call
|
|
161
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
162
|
+
'/AssetTypes',
|
|
163
|
+
Server::DEFAULT1)
|
|
164
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
165
|
+
.is_required(true))
|
|
166
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
167
|
+
.body_param(new_parameter(body)
|
|
168
|
+
.is_required(true))
|
|
169
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
170
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
171
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
172
|
+
.auth(Single.new('OAuth2')))
|
|
173
|
+
.response(new_response_handler
|
|
174
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
175
|
+
.deserialize_into(AssetType.method(:from_hash))
|
|
176
|
+
.is_api_response(true)
|
|
177
|
+
.local_error('400',
|
|
178
|
+
'invalid input, object invalid',
|
|
179
|
+
AssetTypes400ErrorException)
|
|
180
|
+
.local_error('409',
|
|
181
|
+
'a type already exists',
|
|
182
|
+
APIException))
|
|
183
|
+
.execute
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# By passing in the appropriate options, you can search for available fixed
|
|
187
|
+
# asset types in the system
|
|
188
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
189
|
+
# Tenant
|
|
190
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
191
|
+
def get_asset_settings(xero_tenant_id)
|
|
192
|
+
@api_call
|
|
193
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
194
|
+
'/Settings',
|
|
195
|
+
Server::DEFAULT1)
|
|
196
|
+
.header_param(new_parameter(xero_tenant_id, key: 'xero-tenant-id')
|
|
197
|
+
.is_required(true))
|
|
198
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
199
|
+
.auth(Single.new('OAuth2')))
|
|
200
|
+
.response(new_response_handler
|
|
201
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
202
|
+
.deserialize_into(Setting.method(:from_hash))
|
|
203
|
+
.is_api_response(true)
|
|
204
|
+
.local_error('400',
|
|
205
|
+
'bad input parameter',
|
|
206
|
+
APIException))
|
|
207
|
+
.execute
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
# BankFeedsApi
|
|
8
|
+
class BankFeedsApi < BaseApi
|
|
9
|
+
# By passing in the appropriate options, you can search for available feed
|
|
10
|
+
# connections in the system.
|
|
11
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
12
|
+
# Tenant
|
|
13
|
+
# @param [Integer] page Optional parameter: Page number which specifies the
|
|
14
|
+
# set of records to retrieve. By default the number of the records per set
|
|
15
|
+
# is 10. Example -
|
|
16
|
+
# https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the
|
|
17
|
+
# second set of the records. When page value is not a number or a negative
|
|
18
|
+
# number, by default, the first set of records is returned.
|
|
19
|
+
# @param [Integer] page_size Optional parameter: Page size which specifies
|
|
20
|
+
# how many records per page will be returned (default 10). Example -
|
|
21
|
+
# https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to
|
|
22
|
+
# specify page size of 100.
|
|
23
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
24
|
+
def get_feed_connections(xero_tenant_id,
|
|
25
|
+
page: nil,
|
|
26
|
+
page_size: nil)
|
|
27
|
+
@api_call
|
|
28
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
29
|
+
'/FeedConnections',
|
|
30
|
+
Server::DEFAULT2)
|
|
31
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
32
|
+
.is_required(true))
|
|
33
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
34
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
35
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
36
|
+
.auth(Single.new('OAuth2')))
|
|
37
|
+
.response(new_response_handler
|
|
38
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
39
|
+
.deserialize_into(FeedConnections.method(:from_hash))
|
|
40
|
+
.is_api_response(true)
|
|
41
|
+
.local_error('400',
|
|
42
|
+
'validation error response',
|
|
43
|
+
APIException))
|
|
44
|
+
.execute
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# By passing in the FeedConnections array object in the body, you can create
|
|
48
|
+
# one or more new feed connections
|
|
49
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
50
|
+
# Tenant
|
|
51
|
+
# @param [FeedConnections] body Required parameter: Feed Connection(s) array
|
|
52
|
+
# object in the body
|
|
53
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
54
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
55
|
+
# character max.
|
|
56
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
57
|
+
def create_feed_connections(xero_tenant_id,
|
|
58
|
+
body,
|
|
59
|
+
idempotency_key: nil)
|
|
60
|
+
@api_call
|
|
61
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
62
|
+
'/FeedConnections',
|
|
63
|
+
Server::DEFAULT2)
|
|
64
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
65
|
+
.is_required(true))
|
|
66
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
67
|
+
.body_param(new_parameter(body)
|
|
68
|
+
.is_required(true))
|
|
69
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
70
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
71
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
72
|
+
.auth(Single.new('OAuth2')))
|
|
73
|
+
.response(new_response_handler
|
|
74
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
75
|
+
.deserialize_into(FeedConnections.method(:from_hash))
|
|
76
|
+
.is_api_response(true)
|
|
77
|
+
.local_error('400',
|
|
78
|
+
'failed to create new feed connection(s)response',
|
|
79
|
+
FeedConnectionsErrorException))
|
|
80
|
+
.execute
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# By passing in a FeedConnection Id options, you can search for matching
|
|
84
|
+
# feed connections
|
|
85
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
86
|
+
# Tenant
|
|
87
|
+
# @param [UUID | String] id Required parameter: Unique identifier for
|
|
88
|
+
# retrieving single object
|
|
89
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
90
|
+
def get_feed_connection(xero_tenant_id,
|
|
91
|
+
id)
|
|
92
|
+
@api_call
|
|
93
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
94
|
+
'/FeedConnections/{id}',
|
|
95
|
+
Server::DEFAULT2)
|
|
96
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
97
|
+
.is_required(true))
|
|
98
|
+
.template_param(new_parameter(id, key: 'id')
|
|
99
|
+
.is_required(true)
|
|
100
|
+
.should_encode(true))
|
|
101
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
102
|
+
.auth(Single.new('OAuth2')))
|
|
103
|
+
.response(new_response_handler
|
|
104
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
105
|
+
.deserialize_into(FeedConnection.method(:from_hash))
|
|
106
|
+
.is_api_response(true)
|
|
107
|
+
.local_error('400',
|
|
108
|
+
'bad input parameter',
|
|
109
|
+
APIException))
|
|
110
|
+
.execute
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# By passing in FeedConnections array object in the body, you can delete a
|
|
114
|
+
# feed connection.
|
|
115
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
116
|
+
# Tenant
|
|
117
|
+
# @param [FeedConnections] body Required parameter: Feed Connections array
|
|
118
|
+
# object in the body
|
|
119
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
120
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
121
|
+
# character max.
|
|
122
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
123
|
+
def delete_feed_connections(xero_tenant_id,
|
|
124
|
+
body,
|
|
125
|
+
idempotency_key: nil)
|
|
126
|
+
@api_call
|
|
127
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
128
|
+
'/FeedConnections/DeleteRequests',
|
|
129
|
+
Server::DEFAULT2)
|
|
130
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
131
|
+
.is_required(true))
|
|
132
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
133
|
+
.body_param(new_parameter(body)
|
|
134
|
+
.is_required(true))
|
|
135
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
136
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
137
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
138
|
+
.auth(Single.new('OAuth2')))
|
|
139
|
+
.response(new_response_handler
|
|
140
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
141
|
+
.deserialize_into(FeedConnections.method(:from_hash))
|
|
142
|
+
.is_api_response(true)
|
|
143
|
+
.local_error('400',
|
|
144
|
+
'bad input parameter',
|
|
145
|
+
APIException))
|
|
146
|
+
.execute
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# By passing in parameters, you can search for matching statements
|
|
150
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
151
|
+
# Tenant
|
|
152
|
+
# @param [Integer] page Optional parameter: unique id for single object
|
|
153
|
+
# @param [Integer] page_size Optional parameter: Page size which specifies
|
|
154
|
+
# how many records per page will be returned (default 10). Example -
|
|
155
|
+
# https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify
|
|
156
|
+
# page size of 100.
|
|
157
|
+
# @param [String] xero_application_id Optional parameter:
|
|
158
|
+
# Example:00000000-0000-0000-0000-0000000010000
|
|
159
|
+
# @param [String] xero_user_id Optional parameter:
|
|
160
|
+
# Example:00000000-0000-0000-0000-0000030000000
|
|
161
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
162
|
+
def get_statements(xero_tenant_id,
|
|
163
|
+
page: nil,
|
|
164
|
+
page_size: nil,
|
|
165
|
+
xero_application_id: '00000000-0000-0000-0000-0000000010000',
|
|
166
|
+
xero_user_id: '00000000-0000-0000-0000-0000030000000')
|
|
167
|
+
@api_call
|
|
168
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
169
|
+
'/Statements',
|
|
170
|
+
Server::DEFAULT2)
|
|
171
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
172
|
+
.is_required(true))
|
|
173
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
174
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
175
|
+
.header_param(new_parameter(xero_application_id, key: 'Xero-Application-Id'))
|
|
176
|
+
.header_param(new_parameter(xero_user_id, key: 'Xero-User-Id'))
|
|
177
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
178
|
+
.auth(Single.new('OAuth2')))
|
|
179
|
+
.response(new_response_handler
|
|
180
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
181
|
+
.deserialize_into(Statements.method(:from_hash))
|
|
182
|
+
.is_api_response(true)
|
|
183
|
+
.local_error('400',
|
|
184
|
+
'bad input parameter',
|
|
185
|
+
StatementsErrorException))
|
|
186
|
+
.execute
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# TODO: type endpoint description here
|
|
190
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
191
|
+
# Tenant
|
|
192
|
+
# @param [Statements] body Required parameter: Statements array of objects
|
|
193
|
+
# in the body
|
|
194
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
195
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
196
|
+
# character max.
|
|
197
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
198
|
+
def create_statements(xero_tenant_id,
|
|
199
|
+
body,
|
|
200
|
+
idempotency_key: nil)
|
|
201
|
+
@api_call
|
|
202
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
203
|
+
'/Statements',
|
|
204
|
+
Server::DEFAULT2)
|
|
205
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
206
|
+
.is_required(true))
|
|
207
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
208
|
+
.body_param(new_parameter(body)
|
|
209
|
+
.is_required(true))
|
|
210
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
211
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
212
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
213
|
+
.auth(Single.new('OAuth2')))
|
|
214
|
+
.response(new_response_handler
|
|
215
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
216
|
+
.deserialize_into(Statements.method(:from_hash))
|
|
217
|
+
.is_api_response(true)
|
|
218
|
+
.local_error('400',
|
|
219
|
+
'Statement failed validation',
|
|
220
|
+
StatementsErrorException)
|
|
221
|
+
.local_error('403',
|
|
222
|
+
'Invalid application or feed connection',
|
|
223
|
+
ErrorError1Exception)
|
|
224
|
+
.local_error('409',
|
|
225
|
+
'Duplicate statement received',
|
|
226
|
+
StatementsErrorException)
|
|
227
|
+
.local_error('413',
|
|
228
|
+
'Statement exceeds size limit',
|
|
229
|
+
StatementsErrorException)
|
|
230
|
+
.local_error('422',
|
|
231
|
+
'Unprocessable Entity',
|
|
232
|
+
StatementsErrorException)
|
|
233
|
+
.local_error('500',
|
|
234
|
+
'Intermittent Xero Error',
|
|
235
|
+
StatementsErrorException))
|
|
236
|
+
.execute
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# By passing in a statement id, you can search for matching statements
|
|
240
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
241
|
+
# Tenant
|
|
242
|
+
# @param [UUID | String] statement_id Required parameter: statement id for
|
|
243
|
+
# single object
|
|
244
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
245
|
+
def get_statement(xero_tenant_id,
|
|
246
|
+
statement_id)
|
|
247
|
+
@api_call
|
|
248
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
249
|
+
'/Statements/{statementId}',
|
|
250
|
+
Server::DEFAULT2)
|
|
251
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
252
|
+
.is_required(true))
|
|
253
|
+
.template_param(new_parameter(statement_id, key: 'statementId')
|
|
254
|
+
.is_required(true)
|
|
255
|
+
.should_encode(true))
|
|
256
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
257
|
+
.auth(Single.new('OAuth2')))
|
|
258
|
+
.response(new_response_handler
|
|
259
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
260
|
+
.deserialize_into(Statement.method(:from_hash))
|
|
261
|
+
.is_api_response(true)
|
|
262
|
+
.local_error('404',
|
|
263
|
+
'Statement not found',
|
|
264
|
+
APIException))
|
|
265
|
+
.execute
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
# BaseApi.
|
|
8
|
+
class BaseApi
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_accessor :config, :http_call_back
|
|
11
|
+
|
|
12
|
+
def self.user_agent
|
|
13
|
+
'Ruby-SDK/1.0.0 (OS: {os-info}, Engine: {engine}/{engine-version})'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.user_agent_parameters
|
|
17
|
+
{
|
|
18
|
+
'{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
|
|
19
|
+
'{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
|
|
20
|
+
'{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
GLOBAL_ERRORS = {
|
|
25
|
+
'default' => ErrorCase.new
|
|
26
|
+
.error_message('HTTP response not OK.')
|
|
27
|
+
.exception_type(APIException)
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
30
|
+
# Initialization constructor.
|
|
31
|
+
# @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
|
|
32
|
+
def initialize(global_configuration)
|
|
33
|
+
@global_configuration = global_configuration
|
|
34
|
+
@config = @global_configuration.client_configuration
|
|
35
|
+
@http_call_back = @config.http_callback
|
|
36
|
+
@api_call = ApiCall.new(@global_configuration)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates a new instance of the request builder.
|
|
40
|
+
# @param [String] http_method The HTTP method to use in the request.
|
|
41
|
+
# @param [String] path The endpoint path to use in the request.
|
|
42
|
+
# @param [String] server The server to extract the base uri for the request.
|
|
43
|
+
# @return [RequestBuilder] The instance of RequestBuilder.
|
|
44
|
+
def new_request_builder(http_method, path, server)
|
|
45
|
+
RequestBuilder.new
|
|
46
|
+
.http_method(http_method)
|
|
47
|
+
.path(path)
|
|
48
|
+
.server(server)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Creates a new instance of the response handler.
|
|
52
|
+
# @return [ResponseHandler] The instance of ResponseHandler.
|
|
53
|
+
def new_response_handler
|
|
54
|
+
ResponseHandler.new
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Creates a new instance of the parameter.
|
|
58
|
+
# @param [String|optional] key The key of the parameter.
|
|
59
|
+
# @param [Object] value The value of the parameter.
|
|
60
|
+
# @return [Parameter] The instance of Parameter.
|
|
61
|
+
def new_parameter(value, key: nil)
|
|
62
|
+
Parameter.new
|
|
63
|
+
.key(key)
|
|
64
|
+
.value(value)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
# IdentityApi
|
|
8
|
+
class IdentityApi < BaseApi
|
|
9
|
+
# Override the base server url that include version
|
|
10
|
+
# @param [UUID | String] auth_event_id Optional parameter: Filter by
|
|
11
|
+
# authEventId
|
|
12
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
13
|
+
def get_connections(auth_event_id: nil)
|
|
14
|
+
@api_call
|
|
15
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
16
|
+
'/Connections',
|
|
17
|
+
Server::DEFAULT3)
|
|
18
|
+
.query_param(new_parameter(auth_event_id, key: 'authEventId'))
|
|
19
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
20
|
+
.auth(Single.new('OAuth2')))
|
|
21
|
+
.response(new_response_handler
|
|
22
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
23
|
+
.deserialize_into(Connection.method(:from_hash))
|
|
24
|
+
.is_api_response(true)
|
|
25
|
+
.is_response_array(true))
|
|
26
|
+
.execute
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Override the base server url that include version
|
|
30
|
+
# @param [UUID | String] id Required parameter: Unique identifier for
|
|
31
|
+
# retrieving single object
|
|
32
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
33
|
+
def delete_connection(id)
|
|
34
|
+
@api_call
|
|
35
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
36
|
+
'/Connections/{id}',
|
|
37
|
+
Server::DEFAULT3)
|
|
38
|
+
.template_param(new_parameter(id, key: 'id')
|
|
39
|
+
.is_required(true)
|
|
40
|
+
.should_encode(true))
|
|
41
|
+
.auth(Single.new('OAuth2')))
|
|
42
|
+
.response(new_response_handler
|
|
43
|
+
.is_response_void(true)
|
|
44
|
+
.is_api_response(true)
|
|
45
|
+
.local_error('404',
|
|
46
|
+
'Resource not found',
|
|
47
|
+
APIException))
|
|
48
|
+
.execute
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|