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,662 @@
|
|
|
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
|
+
# ProjectApi
|
|
8
|
+
class ProjectApi < BaseApi
|
|
9
|
+
# Allows you to retrieve, create and update projects.
|
|
10
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
11
|
+
# Tenant
|
|
12
|
+
# @param [Array[UUID | String]] project_ids Optional parameter: Search for
|
|
13
|
+
# all projects that match a comma separated list of projectIds
|
|
14
|
+
# @param [UUID | String] contact_id Optional parameter: Filter for projects
|
|
15
|
+
# for a specific contact
|
|
16
|
+
# @param [String] states Optional parameter: Filter for projects in a
|
|
17
|
+
# particular state (INPROGRESS or CLOSED)
|
|
18
|
+
# @param [Integer] page Optional parameter: set to 1 by default. The
|
|
19
|
+
# requested number of the page in paged response - Must be a number greater
|
|
20
|
+
# than 0.
|
|
21
|
+
# @param [Integer] page_size Optional parameter: Optional, it is set to 50
|
|
22
|
+
# by default. The number of items to return per page in a paged response -
|
|
23
|
+
# Must be a number between 1 and 500.
|
|
24
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
25
|
+
def get_projects(xero_tenant_id,
|
|
26
|
+
project_ids: nil,
|
|
27
|
+
contact_id: nil,
|
|
28
|
+
states: nil,
|
|
29
|
+
page: 1,
|
|
30
|
+
page_size: 50)
|
|
31
|
+
@api_call
|
|
32
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
33
|
+
'/Projects',
|
|
34
|
+
Server::DEFAULT4)
|
|
35
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
36
|
+
.is_required(true))
|
|
37
|
+
.query_param(new_parameter(project_ids, key: 'projectIds'))
|
|
38
|
+
.query_param(new_parameter(contact_id, key: 'contactID'))
|
|
39
|
+
.query_param(new_parameter(states, key: 'states'))
|
|
40
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
41
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
42
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
43
|
+
.auth(Single.new('OAuth2')))
|
|
44
|
+
.response(new_response_handler
|
|
45
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
46
|
+
.deserialize_into(Projects.method(:from_hash))
|
|
47
|
+
.is_api_response(true)
|
|
48
|
+
.local_error('400',
|
|
49
|
+
'A failed request due to validation error',
|
|
50
|
+
ErrorError2Exception))
|
|
51
|
+
.execute
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# TODO: type endpoint description here
|
|
55
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
56
|
+
# Tenant
|
|
57
|
+
# @param [ProjectCreateOrUpdate] body Required parameter: Create a new
|
|
58
|
+
# project with ProjectCreateOrUpdate object
|
|
59
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
60
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
61
|
+
# character max.
|
|
62
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
63
|
+
def create_project(xero_tenant_id,
|
|
64
|
+
body,
|
|
65
|
+
idempotency_key: nil)
|
|
66
|
+
@api_call
|
|
67
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
68
|
+
'/Projects',
|
|
69
|
+
Server::DEFAULT4)
|
|
70
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
71
|
+
.is_required(true))
|
|
72
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
73
|
+
.body_param(new_parameter(body)
|
|
74
|
+
.is_required(true))
|
|
75
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
76
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
77
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
78
|
+
.auth(Single.new('OAuth2')))
|
|
79
|
+
.response(new_response_handler
|
|
80
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
81
|
+
.deserialize_into(Project.method(:from_hash))
|
|
82
|
+
.is_api_response(true)
|
|
83
|
+
.local_error('400',
|
|
84
|
+
'A failed request due to validation error',
|
|
85
|
+
ErrorError2Exception))
|
|
86
|
+
.execute
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Allows you to retrieve a specific project using the projectId
|
|
90
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
91
|
+
# Tenant
|
|
92
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
93
|
+
# individual project by appending the projectId to the endpoint
|
|
94
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
95
|
+
def get_project(xero_tenant_id,
|
|
96
|
+
project_id)
|
|
97
|
+
@api_call
|
|
98
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
99
|
+
'/Projects/{projectId}',
|
|
100
|
+
Server::DEFAULT4)
|
|
101
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
102
|
+
.is_required(true))
|
|
103
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
104
|
+
.is_required(true)
|
|
105
|
+
.should_encode(true))
|
|
106
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
107
|
+
.auth(Single.new('OAuth2')))
|
|
108
|
+
.response(new_response_handler
|
|
109
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
110
|
+
.deserialize_into(Project.method(:from_hash))
|
|
111
|
+
.is_api_response(true)
|
|
112
|
+
.local_error('400',
|
|
113
|
+
'A failed request due to validation error',
|
|
114
|
+
ErrorError2Exception))
|
|
115
|
+
.execute
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Allows you to update a specific projects.
|
|
119
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
120
|
+
# Tenant
|
|
121
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
122
|
+
# individual project by appending the projectId to the endpoint
|
|
123
|
+
# @param [ProjectCreateOrUpdate] body Required parameter: Request of type
|
|
124
|
+
# ProjectCreateOrUpdate
|
|
125
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
126
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
127
|
+
# character max.
|
|
128
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
129
|
+
def update_project(xero_tenant_id,
|
|
130
|
+
project_id,
|
|
131
|
+
body,
|
|
132
|
+
idempotency_key: nil)
|
|
133
|
+
@api_call
|
|
134
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
135
|
+
'/Projects/{projectId}',
|
|
136
|
+
Server::DEFAULT4)
|
|
137
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
138
|
+
.is_required(true))
|
|
139
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
140
|
+
.is_required(true)
|
|
141
|
+
.should_encode(true))
|
|
142
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
143
|
+
.body_param(new_parameter(body)
|
|
144
|
+
.is_required(true))
|
|
145
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
146
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
147
|
+
.auth(Single.new('OAuth2')))
|
|
148
|
+
.response(new_response_handler
|
|
149
|
+
.is_response_void(true)
|
|
150
|
+
.is_api_response(true)
|
|
151
|
+
.local_error('400',
|
|
152
|
+
'A failed request due to validation error',
|
|
153
|
+
ErrorError2Exception))
|
|
154
|
+
.execute
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Allows you to update a specific projects.
|
|
158
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
159
|
+
# Tenant
|
|
160
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
161
|
+
# individual project by appending the projectId to the endpoint
|
|
162
|
+
# @param [ProjectPatch] body Required parameter: Update the status of an
|
|
163
|
+
# existing Project
|
|
164
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
165
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
166
|
+
# character max.
|
|
167
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
168
|
+
def patch_project(xero_tenant_id,
|
|
169
|
+
project_id,
|
|
170
|
+
body,
|
|
171
|
+
idempotency_key: nil)
|
|
172
|
+
@api_call
|
|
173
|
+
.request(new_request_builder(HttpMethodEnum::PATCH,
|
|
174
|
+
'/Projects/{projectId}',
|
|
175
|
+
Server::DEFAULT4)
|
|
176
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
177
|
+
.is_required(true))
|
|
178
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
179
|
+
.is_required(true)
|
|
180
|
+
.should_encode(true))
|
|
181
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
182
|
+
.body_param(new_parameter(body)
|
|
183
|
+
.is_required(true))
|
|
184
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
185
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
186
|
+
.auth(Single.new('OAuth2')))
|
|
187
|
+
.response(new_response_handler
|
|
188
|
+
.is_response_void(true)
|
|
189
|
+
.is_api_response(true)
|
|
190
|
+
.local_error('400',
|
|
191
|
+
'A failed request due to validation error',
|
|
192
|
+
ErrorError2Exception))
|
|
193
|
+
.execute
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Allows you to retrieve the users on a projects.
|
|
197
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
198
|
+
# Tenant
|
|
199
|
+
# @param [Integer] page Optional parameter: set to 1 by default. The
|
|
200
|
+
# requested number of the page in paged response - Must be a number greater
|
|
201
|
+
# than 0.
|
|
202
|
+
# @param [Integer] page_size Optional parameter: Optional, it is set to 50
|
|
203
|
+
# by default. The number of items to return per page in a paged response -
|
|
204
|
+
# Must be a number between 1 and 500.
|
|
205
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
206
|
+
def get_project_users(xero_tenant_id,
|
|
207
|
+
page: 1,
|
|
208
|
+
page_size: 50)
|
|
209
|
+
@api_call
|
|
210
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
211
|
+
'/ProjectsUsers',
|
|
212
|
+
Server::DEFAULT4)
|
|
213
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
214
|
+
.is_required(true))
|
|
215
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
216
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
217
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
218
|
+
.auth(Single.new('OAuth2')))
|
|
219
|
+
.response(new_response_handler
|
|
220
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
221
|
+
.deserialize_into(ProjectUsers.method(:from_hash))
|
|
222
|
+
.is_api_response(true)
|
|
223
|
+
.local_error('400',
|
|
224
|
+
'A failed request due to validation error',
|
|
225
|
+
ErrorError2Exception))
|
|
226
|
+
.execute
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Allows you to retrieve a specific project
|
|
230
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
231
|
+
# Tenant
|
|
232
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
233
|
+
# individual project by appending the projectId to the endpoint
|
|
234
|
+
# @param [Integer] page Optional parameter: Set to 1 by default. The
|
|
235
|
+
# requested number of the page in paged response - Must be a number greater
|
|
236
|
+
# than 0.
|
|
237
|
+
# @param [Integer] page_size Optional parameter: Optional, it is set to 50
|
|
238
|
+
# by default. The number of items to return per page in a paged response -
|
|
239
|
+
# Must be a number between 1 and 500.
|
|
240
|
+
# @param [String] task_ids Optional parameter: Search for all tasks that
|
|
241
|
+
# match a comma separated list of taskIds, i.e. GET
|
|
242
|
+
# https://.../tasks?taskIds={taskID},{taskID}
|
|
243
|
+
# @param [ChargeType] charge_type Optional parameter: TODO: type description
|
|
244
|
+
# here
|
|
245
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
246
|
+
def get_tasks(xero_tenant_id,
|
|
247
|
+
project_id,
|
|
248
|
+
page: nil,
|
|
249
|
+
page_size: nil,
|
|
250
|
+
task_ids: nil,
|
|
251
|
+
charge_type: nil)
|
|
252
|
+
@api_call
|
|
253
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
254
|
+
'/Projects/{projectId}/Tasks',
|
|
255
|
+
Server::DEFAULT4)
|
|
256
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
257
|
+
.is_required(true))
|
|
258
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
259
|
+
.is_required(true)
|
|
260
|
+
.should_encode(true))
|
|
261
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
262
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
263
|
+
.query_param(new_parameter(task_ids, key: 'taskIds'))
|
|
264
|
+
.query_param(new_parameter(charge_type, key: 'chargeType'))
|
|
265
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
266
|
+
.auth(Single.new('OAuth2')))
|
|
267
|
+
.response(new_response_handler
|
|
268
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
269
|
+
.deserialize_into(Tasks.method(:from_hash))
|
|
270
|
+
.is_api_response(true)
|
|
271
|
+
.local_error('400',
|
|
272
|
+
'A failed request due to validation error',
|
|
273
|
+
ErrorError2Exception))
|
|
274
|
+
.execute
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Allows you to create a specific task
|
|
278
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
279
|
+
# Tenant
|
|
280
|
+
# @param [UUID | String] project_id Required parameter: You can create a
|
|
281
|
+
# task on a specified projectId
|
|
282
|
+
# @param [TaskCreateOrUpdate] body Required parameter: The task object you
|
|
283
|
+
# are creating
|
|
284
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
285
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
286
|
+
# character max.
|
|
287
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
288
|
+
def create_task(xero_tenant_id,
|
|
289
|
+
project_id,
|
|
290
|
+
body,
|
|
291
|
+
idempotency_key: nil)
|
|
292
|
+
@api_call
|
|
293
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
294
|
+
'/Projects/{projectId}/Tasks',
|
|
295
|
+
Server::DEFAULT4)
|
|
296
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
297
|
+
.is_required(true))
|
|
298
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
299
|
+
.is_required(true)
|
|
300
|
+
.should_encode(true))
|
|
301
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
302
|
+
.body_param(new_parameter(body)
|
|
303
|
+
.is_required(true))
|
|
304
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
305
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
306
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
307
|
+
.auth(Single.new('OAuth2')))
|
|
308
|
+
.response(new_response_handler
|
|
309
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
310
|
+
.deserialize_into(Task.method(:from_hash))
|
|
311
|
+
.is_api_response(true)
|
|
312
|
+
.local_error('400',
|
|
313
|
+
'A failed request due to validation error',
|
|
314
|
+
ErrorError2Exception))
|
|
315
|
+
.execute
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Allows you to retrieve a specific project
|
|
319
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
320
|
+
# Tenant
|
|
321
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
322
|
+
# individual project by appending the projectId to the endpoint
|
|
323
|
+
# @param [UUID | String] task_id Required parameter: You can specify an
|
|
324
|
+
# individual task by appending the taskId to the endpoint, i.e. GET
|
|
325
|
+
# https://.../tasks/{taskID}
|
|
326
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
327
|
+
def get_task(xero_tenant_id,
|
|
328
|
+
project_id,
|
|
329
|
+
task_id)
|
|
330
|
+
@api_call
|
|
331
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
332
|
+
'/Projects/{projectId}/Tasks/{taskId}',
|
|
333
|
+
Server::DEFAULT4)
|
|
334
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
335
|
+
.is_required(true))
|
|
336
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
337
|
+
.is_required(true)
|
|
338
|
+
.should_encode(true))
|
|
339
|
+
.template_param(new_parameter(task_id, key: 'taskId')
|
|
340
|
+
.is_required(true)
|
|
341
|
+
.should_encode(true))
|
|
342
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
343
|
+
.auth(Single.new('OAuth2')))
|
|
344
|
+
.response(new_response_handler
|
|
345
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
346
|
+
.deserialize_into(Task.method(:from_hash))
|
|
347
|
+
.is_api_response(true)
|
|
348
|
+
.local_error('400',
|
|
349
|
+
'A failed request due to validation error',
|
|
350
|
+
ErrorError2Exception))
|
|
351
|
+
.execute
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Allows you to update a specific task
|
|
355
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
356
|
+
# Tenant
|
|
357
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
358
|
+
# individual project by appending the projectId to the endpoint
|
|
359
|
+
# @param [UUID | String] task_id Required parameter: You can specify an
|
|
360
|
+
# individual task by appending the id to the endpoint
|
|
361
|
+
# @param [TaskCreateOrUpdate] body Required parameter: The task object you
|
|
362
|
+
# are updating
|
|
363
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
364
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
365
|
+
# character max.
|
|
366
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
367
|
+
def update_task(xero_tenant_id,
|
|
368
|
+
project_id,
|
|
369
|
+
task_id,
|
|
370
|
+
body,
|
|
371
|
+
idempotency_key: nil)
|
|
372
|
+
@api_call
|
|
373
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
374
|
+
'/Projects/{projectId}/Tasks/{taskId}',
|
|
375
|
+
Server::DEFAULT4)
|
|
376
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
377
|
+
.is_required(true))
|
|
378
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
379
|
+
.is_required(true)
|
|
380
|
+
.should_encode(true))
|
|
381
|
+
.template_param(new_parameter(task_id, key: 'taskId')
|
|
382
|
+
.is_required(true)
|
|
383
|
+
.should_encode(true))
|
|
384
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
385
|
+
.body_param(new_parameter(body)
|
|
386
|
+
.is_required(true))
|
|
387
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
388
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
389
|
+
.auth(Single.new('OAuth2')))
|
|
390
|
+
.response(new_response_handler
|
|
391
|
+
.is_response_void(true)
|
|
392
|
+
.is_api_response(true)
|
|
393
|
+
.local_error('400',
|
|
394
|
+
'A failed request due to validation error',
|
|
395
|
+
ErrorError2Exception))
|
|
396
|
+
.execute
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Allows you to delete a specific task
|
|
400
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
401
|
+
# Tenant
|
|
402
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
403
|
+
# individual project by appending the projectId to the endpoint
|
|
404
|
+
# @param [UUID | String] task_id Required parameter: You can specify an
|
|
405
|
+
# individual task by appending the id to the endpoint
|
|
406
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
407
|
+
def delete_task(xero_tenant_id,
|
|
408
|
+
project_id,
|
|
409
|
+
task_id)
|
|
410
|
+
@api_call
|
|
411
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
412
|
+
'/Projects/{projectId}/Tasks/{taskId}',
|
|
413
|
+
Server::DEFAULT4)
|
|
414
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
415
|
+
.is_required(true))
|
|
416
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
417
|
+
.is_required(true)
|
|
418
|
+
.should_encode(true))
|
|
419
|
+
.template_param(new_parameter(task_id, key: 'taskId')
|
|
420
|
+
.is_required(true)
|
|
421
|
+
.should_encode(true))
|
|
422
|
+
.auth(Single.new('OAuth2')))
|
|
423
|
+
.response(new_response_handler
|
|
424
|
+
.is_response_void(true)
|
|
425
|
+
.is_api_response(true)
|
|
426
|
+
.local_error('400',
|
|
427
|
+
'A failed request due to validation error',
|
|
428
|
+
ErrorError2Exception))
|
|
429
|
+
.execute
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Allows you to retrieve the time entries associated with a specific project
|
|
433
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
434
|
+
# Tenant
|
|
435
|
+
# @param [UUID | String] project_id Required parameter: Identifier of the
|
|
436
|
+
# project, that the task (which the time entry is logged against) belongs
|
|
437
|
+
# to.
|
|
438
|
+
# @param [UUID | String] user_id Optional parameter: The xero user
|
|
439
|
+
# identifier of the person who logged time.
|
|
440
|
+
# @param [UUID | String] task_id Optional parameter: Identifier of the task
|
|
441
|
+
# that time entry is logged against.
|
|
442
|
+
# @param [UUID | String] invoice_id Optional parameter: Finds all time
|
|
443
|
+
# entries for this invoice.
|
|
444
|
+
# @param [UUID | String] contact_id Optional parameter: Finds all time
|
|
445
|
+
# entries for this contact identifier.
|
|
446
|
+
# @param [Integer] page Optional parameter: Set to 1 by default. The
|
|
447
|
+
# requested number of the page in paged response - Must be a number greater
|
|
448
|
+
# than 0.
|
|
449
|
+
# @param [Integer] page_size Optional parameter: Optional, it is set to 50
|
|
450
|
+
# by default. The number of items to return per page in a paged response -
|
|
451
|
+
# Must be a number between 1 and 500.
|
|
452
|
+
# @param [Array[String]] states Optional parameter: Comma-separated list of
|
|
453
|
+
# states to find. Will find all time entries that are in the status of
|
|
454
|
+
# whatever is specified.
|
|
455
|
+
# @param [TrueClass | FalseClass] is_chargeable Optional parameter: Finds
|
|
456
|
+
# all time entries which relate to tasks with the charge type `TIME` or
|
|
457
|
+
# `FIXED`.
|
|
458
|
+
# @param [DateTime] date_after_utc Optional parameter: ISO 8601 UTC date.
|
|
459
|
+
# Finds all time entries on or after this date filtered on the `dateUtc`
|
|
460
|
+
# field.
|
|
461
|
+
# @param [DateTime] date_before_utc Optional parameter: ISO 8601 UTC date.
|
|
462
|
+
# Finds all time entries on or before this date filtered on the `dateUtc`
|
|
463
|
+
# field.
|
|
464
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
465
|
+
def get_time_entries(xero_tenant_id,
|
|
466
|
+
project_id,
|
|
467
|
+
user_id: nil,
|
|
468
|
+
task_id: nil,
|
|
469
|
+
invoice_id: nil,
|
|
470
|
+
contact_id: nil,
|
|
471
|
+
page: nil,
|
|
472
|
+
page_size: nil,
|
|
473
|
+
states: nil,
|
|
474
|
+
is_chargeable: nil,
|
|
475
|
+
date_after_utc: nil,
|
|
476
|
+
date_before_utc: nil)
|
|
477
|
+
@api_call
|
|
478
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
479
|
+
'/Projects/{projectId}/Time',
|
|
480
|
+
Server::DEFAULT4)
|
|
481
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
482
|
+
.is_required(true))
|
|
483
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
484
|
+
.is_required(true)
|
|
485
|
+
.should_encode(true))
|
|
486
|
+
.query_param(new_parameter(user_id, key: 'userId'))
|
|
487
|
+
.query_param(new_parameter(task_id, key: 'taskId'))
|
|
488
|
+
.query_param(new_parameter(invoice_id, key: 'invoiceId'))
|
|
489
|
+
.query_param(new_parameter(contact_id, key: 'contactId'))
|
|
490
|
+
.query_param(new_parameter(page, key: 'page'))
|
|
491
|
+
.query_param(new_parameter(page_size, key: 'pageSize'))
|
|
492
|
+
.query_param(new_parameter(states, key: 'states'))
|
|
493
|
+
.query_param(new_parameter(is_chargeable, key: 'isChargeable'))
|
|
494
|
+
.query_param(new_parameter(date_after_utc, key: 'dateAfterUtc'))
|
|
495
|
+
.query_param(new_parameter(date_before_utc, key: 'dateBeforeUtc'))
|
|
496
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
497
|
+
.auth(Single.new('OAuth2')))
|
|
498
|
+
.response(new_response_handler
|
|
499
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
500
|
+
.deserialize_into(TimeEntries.method(:from_hash))
|
|
501
|
+
.is_api_response(true)
|
|
502
|
+
.local_error('400',
|
|
503
|
+
'A failed request due to validation error',
|
|
504
|
+
ErrorError2Exception))
|
|
505
|
+
.execute
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# Allows you to create a specific task
|
|
509
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
510
|
+
# Tenant
|
|
511
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
512
|
+
# individual project by appending the projectId to the endpoint
|
|
513
|
+
# @param [TimeEntryCreateOrUpdate] body Required parameter: The time entry
|
|
514
|
+
# object you are creating
|
|
515
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
516
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
517
|
+
# character max.
|
|
518
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
519
|
+
def create_time_entry(xero_tenant_id,
|
|
520
|
+
project_id,
|
|
521
|
+
body,
|
|
522
|
+
idempotency_key: nil)
|
|
523
|
+
@api_call
|
|
524
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
525
|
+
'/Projects/{projectId}/Time',
|
|
526
|
+
Server::DEFAULT4)
|
|
527
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
528
|
+
.is_required(true))
|
|
529
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
530
|
+
.is_required(true)
|
|
531
|
+
.should_encode(true))
|
|
532
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
533
|
+
.body_param(new_parameter(body)
|
|
534
|
+
.is_required(true))
|
|
535
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
536
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
537
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
538
|
+
.auth(Single.new('OAuth2')))
|
|
539
|
+
.response(new_response_handler
|
|
540
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
541
|
+
.deserialize_into(TimeEntry.method(:from_hash))
|
|
542
|
+
.is_api_response(true)
|
|
543
|
+
.local_error('400',
|
|
544
|
+
'A failed request due to validation error',
|
|
545
|
+
ErrorError2Exception))
|
|
546
|
+
.execute
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# Allows you to get a single time entry in a project
|
|
550
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
551
|
+
# Tenant
|
|
552
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
553
|
+
# individual project by appending the projectId to the endpoint
|
|
554
|
+
# @param [UUID | String] time_entry_id Required parameter: You can specify
|
|
555
|
+
# an individual time entry by appending the id to the endpoint
|
|
556
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
557
|
+
def get_time_entry(xero_tenant_id,
|
|
558
|
+
project_id,
|
|
559
|
+
time_entry_id)
|
|
560
|
+
@api_call
|
|
561
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
562
|
+
'/Projects/{projectId}/Time/{timeEntryId}',
|
|
563
|
+
Server::DEFAULT4)
|
|
564
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
565
|
+
.is_required(true))
|
|
566
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
567
|
+
.is_required(true)
|
|
568
|
+
.should_encode(true))
|
|
569
|
+
.template_param(new_parameter(time_entry_id, key: 'timeEntryId')
|
|
570
|
+
.is_required(true)
|
|
571
|
+
.should_encode(true))
|
|
572
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
573
|
+
.auth(Single.new('OAuth2')))
|
|
574
|
+
.response(new_response_handler
|
|
575
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
576
|
+
.deserialize_into(TimeEntry.method(:from_hash))
|
|
577
|
+
.is_api_response(true)
|
|
578
|
+
.local_error('400',
|
|
579
|
+
'A failed request due to validation error',
|
|
580
|
+
ErrorError2Exception))
|
|
581
|
+
.execute
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
# Allows you to update time entry in a project
|
|
585
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
586
|
+
# Tenant
|
|
587
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
588
|
+
# individual project by appending the projectId to the endpoint
|
|
589
|
+
# @param [UUID | String] time_entry_id Required parameter: You can specify
|
|
590
|
+
# an individual time entry by appending the id to the endpoint
|
|
591
|
+
# @param [TimeEntryCreateOrUpdate] body Required parameter: The time entry
|
|
592
|
+
# object you are updating
|
|
593
|
+
# @param [String] idempotency_key Optional parameter: This allows you to
|
|
594
|
+
# safely retry requests without the risk of duplicate processing. 128
|
|
595
|
+
# character max.
|
|
596
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
597
|
+
def update_time_entry(xero_tenant_id,
|
|
598
|
+
project_id,
|
|
599
|
+
time_entry_id,
|
|
600
|
+
body,
|
|
601
|
+
idempotency_key: nil)
|
|
602
|
+
@api_call
|
|
603
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
604
|
+
'/Projects/{projectId}/Time/{timeEntryId}',
|
|
605
|
+
Server::DEFAULT4)
|
|
606
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
607
|
+
.is_required(true))
|
|
608
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
609
|
+
.is_required(true)
|
|
610
|
+
.should_encode(true))
|
|
611
|
+
.template_param(new_parameter(time_entry_id, key: 'timeEntryId')
|
|
612
|
+
.is_required(true)
|
|
613
|
+
.should_encode(true))
|
|
614
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
615
|
+
.body_param(new_parameter(body)
|
|
616
|
+
.is_required(true))
|
|
617
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
618
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
619
|
+
.auth(Single.new('OAuth2')))
|
|
620
|
+
.response(new_response_handler
|
|
621
|
+
.is_response_void(true)
|
|
622
|
+
.is_api_response(true)
|
|
623
|
+
.local_error('400',
|
|
624
|
+
'A failed request due to validation error',
|
|
625
|
+
ErrorError2Exception))
|
|
626
|
+
.execute
|
|
627
|
+
end
|
|
628
|
+
|
|
629
|
+
# Allows you to delete a specific time entry
|
|
630
|
+
# @param [String] xero_tenant_id Required parameter: Xero identifier for
|
|
631
|
+
# Tenant
|
|
632
|
+
# @param [UUID | String] project_id Required parameter: You can specify an
|
|
633
|
+
# individual project by appending the projectId to the endpoint
|
|
634
|
+
# @param [UUID | String] time_entry_id Required parameter: You can specify
|
|
635
|
+
# an individual task by appending the id to the endpoint
|
|
636
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
637
|
+
def delete_time_entry(xero_tenant_id,
|
|
638
|
+
project_id,
|
|
639
|
+
time_entry_id)
|
|
640
|
+
@api_call
|
|
641
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
642
|
+
'/Projects/{projectId}/Time/{timeEntryId}',
|
|
643
|
+
Server::DEFAULT4)
|
|
644
|
+
.header_param(new_parameter(xero_tenant_id, key: 'Xero-Tenant-Id')
|
|
645
|
+
.is_required(true))
|
|
646
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
647
|
+
.is_required(true)
|
|
648
|
+
.should_encode(true))
|
|
649
|
+
.template_param(new_parameter(time_entry_id, key: 'timeEntryId')
|
|
650
|
+
.is_required(true)
|
|
651
|
+
.should_encode(true))
|
|
652
|
+
.auth(Single.new('OAuth2')))
|
|
653
|
+
.response(new_response_handler
|
|
654
|
+
.is_response_void(true)
|
|
655
|
+
.is_api_response(true)
|
|
656
|
+
.local_error('400',
|
|
657
|
+
'A failed request due to validation error',
|
|
658
|
+
ErrorError2Exception))
|
|
659
|
+
.execute
|
|
660
|
+
end
|
|
661
|
+
end
|
|
662
|
+
end
|