xero-ruby 0.2.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +82 -0
- data/Gemfile.lock +68 -0
- data/LICENSE +21 -0
- data/README.md +155 -436
- data/build_notes.md +17 -0
- data/docs/{Account.md → accounting/Account.md} +3 -3
- data/docs/accounting/AccountType.md +16 -0
- data/docs/{AccountingApi.md → accounting/AccountingApi.md} +4990 -1787
- data/docs/{Accounts.md → accounting/Accounts.md} +3 -3
- data/docs/{AccountsPayable.md → accounting/AccountsPayable.md} +3 -3
- data/docs/{AccountsReceivable.md → accounting/AccountsReceivable.md} +3 -3
- data/docs/{Address.md → accounting/Address.md} +3 -3
- data/docs/accounting/Allocation.md +31 -0
- data/docs/{Allocations.md → accounting/Allocations.md} +3 -3
- data/docs/{Attachment.md → accounting/Attachment.md} +3 -3
- data/docs/{Attachments.md → accounting/Attachments.md} +3 -3
- data/docs/{Balances.md → accounting/Balances.md} +3 -3
- data/docs/{BankTransaction.md → accounting/BankTransaction.md} +3 -3
- data/docs/{BankTransactions.md → accounting/BankTransactions.md} +3 -3
- data/docs/{BankTransfer.md → accounting/BankTransfer.md} +4 -4
- data/docs/{BankTransfers.md → accounting/BankTransfers.md} +3 -3
- data/docs/{BatchPayment.md → accounting/BatchPayment.md} +4 -4
- data/docs/{BatchPaymentDetails.md → accounting/BatchPaymentDetails.md} +3 -3
- data/docs/{BatchPayments.md → accounting/BatchPayments.md} +3 -3
- data/docs/{Bill.md → accounting/Bill.md} +3 -3
- data/docs/{BrandingTheme.md → accounting/BrandingTheme.md} +3 -3
- data/docs/{BrandingThemes.md → accounting/BrandingThemes.md} +3 -3
- data/docs/{CISOrgSetting.md → accounting/CISOrgSetting.md} +3 -3
- data/docs/{CISSetting.md → accounting/CISSetting.md} +3 -3
- data/docs/{CISSettings.md → accounting/CISSettings.md} +3 -3
- data/docs/{Contact.md → accounting/Contact.md} +5 -5
- data/docs/{ContactGroup.md → accounting/ContactGroup.md} +3 -3
- data/docs/{ContactGroups.md → accounting/ContactGroups.md} +3 -3
- data/docs/{ContactPerson.md → accounting/ContactPerson.md} +3 -3
- data/docs/{Contacts.md → accounting/Contacts.md} +3 -3
- data/docs/accounting/CountryCode.md +16 -0
- data/docs/{CreditNote.md → accounting/CreditNote.md} +5 -5
- data/docs/{CreditNotes.md → accounting/CreditNotes.md} +3 -3
- data/docs/{Currencies.md → accounting/Currencies.md} +3 -3
- data/docs/{Currency.md → accounting/Currency.md} +3 -3
- data/docs/accounting/CurrencyCode.md +16 -0
- data/docs/{Element.md → accounting/Element.md} +3 -3
- data/docs/{Employee.md → accounting/Employee.md} +3 -3
- data/docs/{Employees.md → accounting/Employees.md} +3 -3
- data/docs/{Error.md → accounting/Error.md} +3 -3
- data/docs/{ExpenseClaim.md → accounting/ExpenseClaim.md} +3 -3
- data/docs/{ExpenseClaims.md → accounting/ExpenseClaims.md} +3 -3
- data/docs/{ExternalLink.md → accounting/ExternalLink.md} +3 -3
- data/docs/{HistoryRecord.md → accounting/HistoryRecord.md} +3 -3
- data/docs/{HistoryRecords.md → accounting/HistoryRecords.md} +3 -3
- data/docs/{Invoice.md → accounting/Invoice.md} +5 -5
- data/docs/{InvoiceReminder.md → accounting/InvoiceReminder.md} +3 -3
- data/docs/{InvoiceReminders.md → accounting/InvoiceReminders.md} +3 -3
- data/docs/{Invoices.md → accounting/Invoices.md} +3 -3
- data/docs/{Item.md → accounting/Item.md} +3 -3
- data/docs/{Items.md → accounting/Items.md} +3 -3
- data/docs/{Journal.md → accounting/Journal.md} +4 -4
- data/docs/{JournalLine.md → accounting/JournalLine.md} +3 -3
- data/docs/{Journals.md → accounting/Journals.md} +3 -3
- data/docs/accounting/LineAmountTypes.md +16 -0
- data/docs/{LineItem.md → accounting/LineItem.md} +3 -3
- data/docs/{LineItemTracking.md → accounting/LineItemTracking.md} +3 -3
- data/docs/{LinkedTransaction.md → accounting/LinkedTransaction.md} +3 -3
- data/docs/{LinkedTransactions.md → accounting/LinkedTransactions.md} +3 -3
- data/docs/{ManualJournal.md → accounting/ManualJournal.md} +3 -3
- data/docs/{ManualJournalLine.md → accounting/ManualJournalLine.md} +5 -3
- data/docs/{ManualJournals.md → accounting/ManualJournals.md} +3 -3
- data/docs/{OnlineInvoice.md → accounting/OnlineInvoice.md} +3 -3
- data/docs/{OnlineInvoices.md → accounting/OnlineInvoices.md} +3 -3
- data/docs/{Organisation.md → accounting/Organisation.md} +6 -4
- data/docs/{Organisations.md → accounting/Organisations.md} +3 -3
- data/docs/{Overpayment.md → accounting/Overpayment.md} +3 -3
- data/docs/{Overpayments.md → accounting/Overpayments.md} +3 -3
- data/docs/{Payment.md → accounting/Payment.md} +9 -7
- data/docs/{PaymentDelete.md → accounting/PaymentDelete.md} +3 -3
- data/docs/{PaymentService.md → accounting/PaymentService.md} +3 -3
- data/docs/{PaymentServices.md → accounting/PaymentServices.md} +3 -3
- data/docs/{PaymentTerm.md → accounting/PaymentTerm.md} +3 -3
- data/docs/{PaymentTermType.md → accounting/PaymentTermType.md} +3 -3
- data/docs/{Payments.md → accounting/Payments.md} +3 -3
- data/docs/{Phone.md → accounting/Phone.md} +3 -3
- data/docs/{Prepayment.md → accounting/Prepayment.md} +3 -3
- data/docs/{Prepayments.md → accounting/Prepayments.md} +3 -3
- data/docs/{Purchase.md → accounting/Purchase.md} +3 -3
- data/docs/{PurchaseOrder.md → accounting/PurchaseOrder.md} +3 -3
- data/docs/{PurchaseOrders.md → accounting/PurchaseOrders.md} +3 -3
- data/docs/{Quote.md → accounting/Quote.md} +10 -6
- data/docs/{QuoteLineAmountTypes.md → accounting/QuoteLineAmountTypes.md} +3 -3
- data/docs/{QuoteStatusCodes.md → accounting/QuoteStatusCodes.md} +3 -3
- data/docs/{Quotes.md → accounting/Quotes.md} +3 -3
- data/docs/{Receipt.md → accounting/Receipt.md} +3 -3
- data/docs/{Receipts.md → accounting/Receipts.md} +3 -3
- data/docs/{RepeatingInvoice.md → accounting/RepeatingInvoice.md} +3 -3
- data/docs/{RepeatingInvoices.md → accounting/RepeatingInvoices.md} +3 -3
- data/docs/{Report.md → accounting/Report.md} +4 -4
- data/docs/{ReportAttribute.md → accounting/ReportAttribute.md} +3 -3
- data/docs/{ReportCell.md → accounting/ReportCell.md} +3 -3
- data/docs/{ReportFields.md → accounting/ReportFields.md} +3 -3
- data/docs/{ReportRow.md → accounting/ReportRow.md} +3 -3
- data/docs/{ReportRows.md → accounting/ReportRows.md} +3 -3
- data/docs/{ReportWithRow.md → accounting/ReportWithRow.md} +3 -3
- data/docs/{ReportWithRows.md → accounting/ReportWithRows.md} +3 -3
- data/docs/{Reports.md → accounting/Reports.md} +3 -3
- data/docs/{RequestEmpty.md → accounting/RequestEmpty.md} +3 -3
- data/docs/{RowType.md → accounting/RowType.md} +3 -3
- data/docs/{SalesTrackingCategory.md → accounting/SalesTrackingCategory.md} +3 -3
- data/docs/{Schedule.md → accounting/Schedule.md} +3 -3
- data/docs/{TaxComponent.md → accounting/TaxComponent.md} +3 -3
- data/docs/{TaxRate.md → accounting/TaxRate.md} +3 -3
- data/docs/{TaxRates.md → accounting/TaxRates.md} +3 -3
- data/docs/{TaxType.md → accounting/TaxType.md} +3 -3
- data/docs/{TenNinteyNineContact.md → accounting/TenNinetyNineContact.md} +3 -3
- data/docs/{TimeZone.md → accounting/TimeZone.md} +3 -3
- data/docs/{TrackingCategories.md → accounting/TrackingCategories.md} +3 -3
- data/docs/{TrackingCategory.md → accounting/TrackingCategory.md} +3 -3
- data/docs/{TrackingOption.md → accounting/TrackingOption.md} +3 -3
- data/docs/{TrackingOptions.md → accounting/TrackingOptions.md} +3 -3
- data/docs/{User.md → accounting/User.md} +3 -3
- data/docs/{Users.md → accounting/Users.md} +3 -3
- data/docs/{ValidationError.md → accounting/ValidationError.md} +3 -3
- data/docs/assets/Asset.md +45 -0
- data/docs/assets/AssetApi.md +438 -0
- data/docs/{CurrencyCode.md → assets/AssetStatus.md} +3 -3
- data/docs/assets/AssetStatusQueryParam.md +16 -0
- data/docs/assets/AssetType.md +29 -0
- data/docs/assets/Assets.md +19 -0
- data/docs/assets/BookDepreciationDetail.md +29 -0
- data/docs/assets/BookDepreciationSetting.md +31 -0
- data/docs/assets/Error.md +25 -0
- data/docs/assets/FieldValidationErrorsElement.md +27 -0
- data/docs/assets/Pagination.md +23 -0
- data/docs/assets/ResourceValidationErrorsElement.md +25 -0
- data/docs/assets/Setting.md +31 -0
- data/docs/projects/Amount.md +19 -0
- data/docs/{AccountType.md → projects/ChargeType.md} +3 -3
- data/docs/{CountryCode.md → projects/CurrencyCode.md} +3 -3
- data/docs/projects/Error.md +19 -0
- data/docs/projects/Pagination.md +23 -0
- data/docs/projects/Project.md +59 -0
- data/docs/projects/ProjectApi.md +979 -0
- data/docs/projects/ProjectCreateOrUpdate.md +23 -0
- data/docs/projects/ProjectPatch.md +17 -0
- data/docs/{LineAmountTypes.md → projects/ProjectStatus.md} +3 -3
- data/docs/projects/ProjectUser.md +21 -0
- data/docs/projects/ProjectUsers.md +19 -0
- data/docs/projects/Projects.md +19 -0
- data/docs/projects/Task.md +45 -0
- data/docs/projects/TaskCreateOrUpdate.md +23 -0
- data/docs/projects/Tasks.md +19 -0
- data/docs/projects/TimeEntries.md +19 -0
- data/docs/projects/TimeEntry.md +33 -0
- data/docs/projects/TimeEntryCreateOrUpdate.md +25 -0
- data/lib/xero-ruby.rb +148 -122
- data/lib/xero-ruby/api/accounting_api.rb +166 -29
- data/lib/xero-ruby/api/asset_api.rb +452 -0
- data/lib/xero-ruby/api/project_api.rb +1035 -0
- data/lib/xero-ruby/api_client.rb +237 -74
- data/lib/xero-ruby/api_error.rb +2 -2
- data/lib/xero-ruby/configuration.rb +35 -25
- data/lib/xero-ruby/models/{account.rb → accounting/account.rb} +65 -24
- data/lib/xero-ruby/models/{account_type.rb → accounting/account_type.rb} +3 -3
- data/lib/xero-ruby/models/{accounts.rb → accounting/accounts.rb} +12 -7
- data/lib/xero-ruby/models/{accounts_payable.rb → accounting/accounts_payable.rb} +15 -9
- data/lib/xero-ruby/models/{accounts_receivable.rb → accounting/accounts_receivable.rb} +15 -9
- data/lib/xero-ruby/models/{address.rb → accounting/address.rb} +23 -16
- data/lib/xero-ruby/models/accounting/allocation.rb +295 -0
- data/lib/xero-ruby/models/{allocations.rb → accounting/allocations.rb} +12 -7
- data/lib/xero-ruby/models/{attachment.rb → accounting/attachment.rb} +16 -12
- data/lib/xero-ruby/models/{attachments.rb → accounting/attachments.rb} +12 -7
- data/lib/xero-ruby/models/{balances.rb → accounting/balances.rb} +13 -7
- data/lib/xero-ruby/models/{bank_transaction.rb → accounting/bank_transaction.rb} +47 -28
- data/lib/xero-ruby/models/{bank_transactions.rb → accounting/bank_transactions.rb} +12 -7
- data/lib/xero-ruby/models/{bank_transfer.rb → accounting/bank_transfer.rb} +24 -18
- data/lib/xero-ruby/models/{bank_transfers.rb → accounting/bank_transfers.rb} +12 -7
- data/lib/xero-ruby/models/{batch_payment.rb → accounting/batch_payment.rb} +33 -23
- data/lib/xero-ruby/models/{batch_payment_details.rb → accounting/batch_payment_details.rb} +15 -11
- data/lib/xero-ruby/models/{batch_payments.rb → accounting/batch_payments.rb} +12 -7
- data/lib/xero-ruby/models/{bill.rb → accounting/bill.rb} +12 -7
- data/lib/xero-ruby/models/{branding_theme.rb → accounting/branding_theme.rb} +17 -12
- data/lib/xero-ruby/models/{branding_themes.rb → accounting/branding_themes.rb} +12 -7
- data/lib/xero-ruby/models/{cis_org_setting.rb → accounting/cis_org_setting.rb} +13 -9
- data/lib/xero-ruby/models/{cis_setting.rb → accounting/cis_setting.rb} +12 -8
- data/lib/xero-ruby/models/{cis_settings.rb → accounting/cis_settings.rb} +12 -7
- data/lib/xero-ruby/models/{contact.rb → accounting/contact.rb} +55 -41
- data/lib/xero-ruby/models/{contact_group.rb → accounting/contact_group.rb} +16 -10
- data/lib/xero-ruby/models/{contact_groups.rb → accounting/contact_groups.rb} +12 -7
- data/lib/xero-ruby/models/{contact_person.rb → accounting/contact_person.rb} +14 -10
- data/lib/xero-ruby/models/{contacts.rb → accounting/contacts.rb} +12 -7
- data/lib/xero-ruby/models/{country_code.rb → accounting/country_code.rb} +3 -3
- data/lib/xero-ruby/models/{credit_note.rb → accounting/credit_note.rb} +51 -34
- data/lib/xero-ruby/models/{credit_notes.rb → accounting/credit_notes.rb} +12 -7
- data/lib/xero-ruby/models/{currencies.rb → accounting/currencies.rb} +12 -7
- data/lib/xero-ruby/models/{currency.rb → accounting/currency.rb} +13 -8
- data/lib/xero-ruby/models/{currency_code.rb → accounting/currency_code.rb} +5 -5
- data/lib/xero-ruby/models/{element.rb → accounting/element.rb} +18 -8
- data/lib/xero-ruby/models/{employee.rb → accounting/employee.rb} +21 -12
- data/lib/xero-ruby/models/{employees.rb → accounting/employees.rb} +12 -7
- data/lib/xero-ruby/models/{error.rb → accounting/error.rb} +14 -10
- data/lib/xero-ruby/models/{expense_claim.rb → accounting/expense_claim.rb} +30 -19
- data/lib/xero-ruby/models/{expense_claims.rb → accounting/expense_claims.rb} +12 -7
- data/lib/xero-ruby/models/{external_link.rb → accounting/external_link.rb} +18 -8
- data/lib/xero-ruby/models/{history_record.rb → accounting/history_record.rb} +14 -10
- data/lib/xero-ruby/models/{history_records.rb → accounting/history_records.rb} +12 -7
- data/lib/xero-ruby/models/{invoice.rb → accounting/invoice.rb} +73 -50
- data/lib/xero-ruby/models/{invoice_reminder.rb → accounting/invoice_reminder.rb} +11 -7
- data/lib/xero-ruby/models/{invoice_reminders.rb → accounting/invoice_reminders.rb} +12 -7
- data/lib/xero-ruby/models/{invoices.rb → accounting/invoices.rb} +12 -7
- data/lib/xero-ruby/models/{item.rb → accounting/item.rb} +28 -22
- data/lib/xero-ruby/models/{items.rb → accounting/items.rb} +12 -7
- data/lib/xero-ruby/models/{journal.rb → accounting/journal.rb} +44 -15
- data/lib/xero-ruby/models/{journal_line.rb → accounting/journal_line.rb} +25 -20
- data/lib/xero-ruby/models/{journals.rb → accounting/journals.rb} +12 -7
- data/lib/xero-ruby/models/{line_amount_types.rb → accounting/line_amount_types.rb} +3 -3
- data/lib/xero-ruby/models/{line_item.rb → accounting/line_item.rb} +29 -25
- data/lib/xero-ruby/models/{line_item_tracking.rb → accounting/line_item_tracking.rb} +14 -10
- data/lib/xero-ruby/models/{linked_transaction.rb → accounting/linked_transaction.rb} +29 -17
- data/lib/xero-ruby/models/{linked_transactions.rb → accounting/linked_transactions.rb} +12 -7
- data/lib/xero-ruby/models/{manual_journal.rb → accounting/manual_journal.rb} +29 -19
- data/lib/xero-ruby/models/{manual_journal_line.rb → accounting/manual_journal_line.rb} +30 -16
- data/lib/xero-ruby/models/{manual_journals.rb → accounting/manual_journals.rb} +12 -7
- data/lib/xero-ruby/models/{online_invoice.rb → accounting/online_invoice.rb} +11 -7
- data/lib/xero-ruby/models/{online_invoices.rb → accounting/online_invoices.rb} +12 -7
- data/lib/xero-ruby/models/{organisation.rb → accounting/organisation.rb} +126 -36
- data/lib/xero-ruby/models/{organisations.rb → accounting/organisations.rb} +12 -7
- data/lib/xero-ruby/models/{overpayment.rb → accounting/overpayment.rb} +40 -27
- data/lib/xero-ruby/models/{overpayments.rb → accounting/overpayments.rb} +12 -7
- data/lib/xero-ruby/models/{payment.rb → accounting/payment.rb} +61 -28
- data/lib/xero-ruby/models/{payment_delete.rb → accounting/payment_delete.rb} +11 -7
- data/lib/xero-ruby/models/{payment_service.rb → accounting/payment_service.rb} +16 -12
- data/lib/xero-ruby/models/{payment_services.rb → accounting/payment_services.rb} +12 -7
- data/lib/xero-ruby/models/{payment_term.rb → accounting/payment_term.rb} +13 -7
- data/lib/xero-ruby/models/{payment_term_type.rb → accounting/payment_term_type.rb} +3 -3
- data/lib/xero-ruby/models/{payments.rb → accounting/payments.rb} +12 -7
- data/lib/xero-ruby/models/{phone.rb → accounting/phone.rb} +20 -10
- data/lib/xero-ruby/models/{prepayment.rb → accounting/prepayment.rb} +41 -27
- data/lib/xero-ruby/models/{prepayments.rb → accounting/prepayments.rb} +12 -7
- data/lib/xero-ruby/models/{purchase.rb → accounting/purchase.rb} +15 -11
- data/lib/xero-ruby/models/{purchase_order.rb → accounting/purchase_order.rb} +49 -37
- data/lib/xero-ruby/models/{purchase_orders.rb → accounting/purchase_orders.rb} +12 -7
- data/lib/xero-ruby/models/{quote.rb → accounting/quote.rb} +63 -33
- data/lib/xero-ruby/models/{quote_line_amount_types.rb → accounting/quote_line_amount_types.rb} +3 -3
- data/lib/xero-ruby/models/{quote_status_codes.rb → accounting/quote_status_codes.rb} +4 -3
- data/lib/xero-ruby/models/{quotes.rb → accounting/quotes.rb} +12 -7
- data/lib/xero-ruby/models/{receipt.rb → accounting/receipt.rb} +36 -23
- data/lib/xero-ruby/models/{receipts.rb → accounting/receipts.rb} +12 -7
- data/lib/xero-ruby/models/{repeating_invoice.rb → accounting/repeating_invoice.rb} +34 -21
- data/lib/xero-ruby/models/{repeating_invoices.rb → accounting/repeating_invoices.rb} +12 -7
- data/lib/xero-ruby/models/{report.rb → accounting/report.rb} +19 -13
- data/lib/xero-ruby/models/{report_attribute.rb → accounting/report_attribute.rb} +13 -7
- data/lib/xero-ruby/models/{report_cell.rb → accounting/report_cell.rb} +13 -7
- data/lib/xero-ruby/models/{report_fields.rb → accounting/report_fields.rb} +14 -7
- data/lib/xero-ruby/models/{report_row.rb → accounting/report_row.rb} +14 -7
- data/lib/xero-ruby/models/{report_rows.rb → accounting/report_rows.rb} +15 -7
- data/lib/xero-ruby/models/{report_with_row.rb → accounting/report_with_row.rb} +19 -13
- data/lib/xero-ruby/models/{report_with_rows.rb → accounting/report_with_rows.rb} +12 -7
- data/lib/xero-ruby/models/{reports.rb → accounting/reports.rb} +12 -7
- data/lib/xero-ruby/models/{request_empty.rb → accounting/request_empty.rb} +11 -7
- data/lib/xero-ruby/models/{row_type.rb → accounting/row_type.rb} +3 -3
- data/lib/xero-ruby/models/{sales_tracking_category.rb → accounting/sales_tracking_category.rb} +12 -8
- data/lib/xero-ruby/models/{schedule.rb → accounting/schedule.rb} +27 -15
- data/lib/xero-ruby/models/{tax_component.rb → accounting/tax_component.rb} +15 -11
- data/lib/xero-ruby/models/{tax_rate.rb → accounting/tax_rate.rb} +104 -22
- data/lib/xero-ruby/models/{tax_rates.rb → accounting/tax_rates.rb} +12 -7
- data/lib/xero-ruby/models/{tax_type.rb → accounting/tax_type.rb} +7 -3
- data/lib/xero-ruby/models/{ten_nintey_nine_contact.rb → accounting/ten_ninety_nine_contact.rb} +46 -42
- data/lib/xero-ruby/models/{time_zone.rb → accounting/time_zone.rb} +3 -3
- data/lib/xero-ruby/models/{tracking_categories.rb → accounting/tracking_categories.rb} +12 -7
- data/lib/xero-ruby/models/{tracking_category.rb → accounting/tracking_category.rb} +19 -12
- data/lib/xero-ruby/models/{tracking_option.rb → accounting/tracking_option.rb} +17 -10
- data/lib/xero-ruby/models/{tracking_options.rb → accounting/tracking_options.rb} +12 -7
- data/lib/xero-ruby/models/{user.rb → accounting/user.rb} +24 -13
- data/lib/xero-ruby/models/{users.rb → accounting/users.rb} +12 -7
- data/lib/xero-ruby/models/{validation_error.rb → accounting/validation_error.rb} +11 -7
- data/lib/xero-ruby/models/assets/asset.rb +353 -0
- data/lib/xero-ruby/models/assets/asset_status.rb +38 -0
- data/lib/xero-ruby/models/assets/asset_status_query_param.rb +38 -0
- data/lib/xero-ruby/models/assets/asset_type.rb +278 -0
- data/lib/xero-ruby/models/assets/assets.rb +220 -0
- data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +268 -0
- data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +347 -0
- data/lib/xero-ruby/models/assets/error.rb +252 -0
- data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +258 -0
- data/lib/xero-ruby/models/assets/pagination.rb +238 -0
- data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +248 -0
- data/lib/xero-ruby/models/assets/setting.rb +278 -0
- data/lib/xero-ruby/models/projects/amount.rb +218 -0
- data/lib/xero-ruby/models/projects/charge_type.rb +38 -0
- data/lib/xero-ruby/models/projects/currency_code.rb +199 -0
- data/lib/xero-ruby/models/projects/error.rb +218 -0
- data/lib/xero-ruby/models/{allocation.rb → projects/pagination.rb} +48 -48
- data/lib/xero-ruby/models/projects/project.rb +423 -0
- data/lib/xero-ruby/models/projects/project_create_or_update.rb +243 -0
- data/lib/xero-ruby/models/projects/project_patch.rb +213 -0
- data/lib/xero-ruby/models/projects/project_status.rb +37 -0
- data/lib/xero-ruby/models/projects/project_user.rb +228 -0
- data/lib/xero-ruby/models/projects/project_users.rb +220 -0
- data/lib/xero-ruby/models/projects/projects.rb +220 -0
- data/lib/xero-ruby/models/projects/task.rb +385 -0
- data/lib/xero-ruby/models/projects/task_create_or_update.rb +253 -0
- data/lib/xero-ruby/models/projects/tasks.rb +220 -0
- data/lib/xero-ruby/models/projects/time_entries.rb +220 -0
- data/lib/xero-ruby/models/projects/time_entry.rb +324 -0
- data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +268 -0
- data/lib/xero-ruby/version.rb +3 -3
- data/spec/{api → accounting/api}/accounting_api_spec.rb +31 -6
- data/spec/{models → accounting/models}/account_spec.rb +5 -5
- data/spec/{models → accounting/models}/account_type_spec.rb +5 -5
- data/spec/{models → accounting/models}/accounts_payable_spec.rb +5 -5
- data/spec/{models → accounting/models}/accounts_receivable_spec.rb +5 -5
- data/spec/{models → accounting/models}/accounts_spec.rb +5 -5
- data/spec/{models → accounting/models}/address_spec.rb +5 -5
- data/spec/{models → accounting/models}/allocation_spec.rb +5 -5
- data/spec/{models → accounting/models}/allocations_spec.rb +5 -5
- data/spec/{models → accounting/models}/attachment_spec.rb +5 -5
- data/spec/{models → accounting/models}/attachments_spec.rb +5 -5
- data/spec/{models → accounting/models}/balances_spec.rb +5 -5
- data/spec/{models → accounting/models}/bank_transaction_spec.rb +5 -5
- data/spec/{models → accounting/models}/bank_transactions_spec.rb +5 -5
- data/spec/{models → accounting/models}/bank_transfer_spec.rb +5 -5
- data/spec/{models → accounting/models}/bank_transfers_spec.rb +5 -5
- data/spec/{models → accounting/models}/batch_payment_details_spec.rb +5 -5
- data/spec/{models → accounting/models}/batch_payment_spec.rb +5 -5
- data/spec/{models → accounting/models}/batch_payments_spec.rb +5 -5
- data/spec/{models → accounting/models}/bill_spec.rb +5 -5
- data/spec/{models → accounting/models}/branding_theme_spec.rb +5 -5
- data/spec/{models → accounting/models}/branding_themes_spec.rb +5 -5
- data/spec/{models → accounting/models}/cis_org_setting_spec.rb +5 -5
- data/spec/{models → accounting/models}/cis_setting_spec.rb +5 -5
- data/spec/{models → accounting/models}/cis_settings_spec.rb +5 -5
- data/spec/{models → accounting/models}/contact_group_spec.rb +5 -5
- data/spec/{models → accounting/models}/contact_groups_spec.rb +5 -5
- data/spec/{models → accounting/models}/contact_person_spec.rb +5 -5
- data/spec/{models → accounting/models}/contact_spec.rb +5 -5
- data/spec/{models → accounting/models}/contacts_spec.rb +5 -5
- data/spec/{models → accounting/models}/country_code_spec.rb +5 -5
- data/spec/{models → accounting/models}/credit_note_spec.rb +5 -5
- data/spec/{models → accounting/models}/credit_notes_spec.rb +5 -5
- data/spec/{models → accounting/models}/currencies_spec.rb +5 -5
- data/spec/{models → accounting/models}/currency_code_spec.rb +5 -5
- data/spec/{models → accounting/models}/currency_spec.rb +5 -5
- data/spec/{models → accounting/models}/element_spec.rb +5 -5
- data/spec/{models → accounting/models}/employee_spec.rb +5 -5
- data/spec/{models → accounting/models}/employees_spec.rb +5 -5
- data/spec/{models → accounting/models}/error_spec.rb +5 -5
- data/spec/{models → accounting/models}/expense_claim_spec.rb +5 -5
- data/spec/{models → accounting/models}/expense_claims_spec.rb +5 -5
- data/spec/{models → accounting/models}/external_link_spec.rb +5 -5
- data/spec/{models → accounting/models}/history_record_spec.rb +5 -5
- data/spec/{models → accounting/models}/history_records_spec.rb +5 -5
- data/spec/{models → accounting/models}/invoice_reminder_spec.rb +5 -5
- data/spec/{models → accounting/models}/invoice_reminders_spec.rb +5 -5
- data/spec/{models → accounting/models}/invoice_spec.rb +5 -5
- data/spec/{models → accounting/models}/invoices_spec.rb +5 -5
- data/spec/{models → accounting/models}/item_spec.rb +5 -5
- data/spec/{models → accounting/models}/items_spec.rb +5 -5
- data/spec/{models → accounting/models}/journal_line_spec.rb +5 -5
- data/spec/{models → accounting/models}/journal_spec.rb +5 -5
- data/spec/{models → accounting/models}/journals_spec.rb +5 -5
- data/spec/{models → accounting/models}/line_amount_types_spec.rb +5 -5
- data/spec/{models → accounting/models}/line_item_spec.rb +5 -5
- data/spec/{models → accounting/models}/line_item_tracking_spec.rb +5 -5
- data/spec/{models → accounting/models}/linked_transaction_spec.rb +5 -5
- data/spec/{models → accounting/models}/linked_transactions_spec.rb +5 -5
- data/spec/{models → accounting/models}/manual_journal_line_spec.rb +5 -5
- data/spec/{models → accounting/models}/manual_journal_spec.rb +5 -5
- data/spec/{models → accounting/models}/manual_journals_spec.rb +5 -5
- data/spec/{models → accounting/models}/online_invoice_spec.rb +5 -5
- data/spec/{models → accounting/models}/online_invoices_spec.rb +5 -5
- data/spec/{models → accounting/models}/organisation_spec.rb +5 -5
- data/spec/{models → accounting/models}/organisations_spec.rb +5 -5
- data/spec/{models → accounting/models}/overpayment_spec.rb +5 -5
- data/spec/{models → accounting/models}/overpayments_spec.rb +5 -5
- data/spec/{models → accounting/models}/payment_delete_spec.rb +5 -5
- data/spec/{models → accounting/models}/payment_service_spec.rb +5 -5
- data/spec/{models → accounting/models}/payment_services_spec.rb +5 -5
- data/spec/{models → accounting/models}/payment_spec.rb +11 -5
- data/spec/{models → accounting/models}/payment_term_spec.rb +5 -5
- data/spec/{models → accounting/models}/payment_term_type_spec.rb +5 -5
- data/spec/{models → accounting/models}/payments_spec.rb +5 -5
- data/spec/{models → accounting/models}/phone_spec.rb +5 -5
- data/spec/{models → accounting/models}/prepayment_spec.rb +5 -5
- data/spec/{models → accounting/models}/prepayments_spec.rb +5 -5
- data/spec/{models → accounting/models}/purchase_order_spec.rb +5 -5
- data/spec/{models → accounting/models}/purchase_orders_spec.rb +5 -5
- data/spec/{models → accounting/models}/purchase_spec.rb +5 -5
- data/spec/{models → accounting/models}/quote_line_amount_types_spec.rb +5 -5
- data/spec/{models → accounting/models}/quote_spec.rb +5 -5
- data/spec/{models → accounting/models}/quote_status_codes_spec.rb +5 -5
- data/spec/{models → accounting/models}/quotes_spec.rb +5 -5
- data/spec/{models → accounting/models}/receipt_spec.rb +5 -5
- data/spec/{models → accounting/models}/receipts_spec.rb +5 -5
- data/spec/{models → accounting/models}/repeating_invoice_spec.rb +5 -5
- data/spec/{models → accounting/models}/repeating_invoices_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_attribute_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_cell_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_fields_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_row_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_rows_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_with_row_spec.rb +5 -5
- data/spec/{models → accounting/models}/report_with_rows_spec.rb +5 -5
- data/spec/{models → accounting/models}/reports_spec.rb +5 -5
- data/spec/{models → accounting/models}/request_empty_spec.rb +5 -5
- data/spec/{models → accounting/models}/row_type_spec.rb +5 -5
- data/spec/{models → accounting/models}/sales_tracking_category_spec.rb +5 -5
- data/spec/{models → accounting/models}/schedule_spec.rb +5 -5
- data/spec/{models → accounting/models}/tax_component_spec.rb +5 -5
- data/spec/{models → accounting/models}/tax_rate_spec.rb +6 -6
- data/spec/{models → accounting/models}/tax_rates_spec.rb +5 -5
- data/spec/{models → accounting/models}/tax_type_spec.rb +5 -5
- data/spec/{models → accounting/models}/ten_nintey_nine_contact_spec.rb +8 -8
- data/spec/{models → accounting/models}/time_zone_spec.rb +5 -5
- data/spec/{models → accounting/models}/tracking_categories_spec.rb +5 -5
- data/spec/{models → accounting/models}/tracking_category_spec.rb +5 -5
- data/spec/{models → accounting/models}/tracking_option_spec.rb +5 -5
- data/spec/{models → accounting/models}/tracking_options_spec.rb +5 -5
- data/spec/{models → accounting/models}/user_spec.rb +5 -5
- data/spec/{models → accounting/models}/users_spec.rb +5 -5
- data/spec/{models → accounting/models}/validation_error_spec.rb +5 -5
- data/spec/api_client_spec.rb +12 -52
- data/spec/assets/api/asset_api_spec.rb +116 -0
- data/spec/assets/models/asset_spec.rb +125 -0
- data/spec/assets/models/asset_status_query_param_spec.rb +35 -0
- data/spec/assets/models/asset_status_spec.rb +35 -0
- data/spec/assets/models/asset_type_spec.rb +77 -0
- data/spec/assets/models/assets_spec.rb +47 -0
- data/spec/assets/models/book_depreciation_detail_spec.rb +77 -0
- data/spec/assets/models/book_depreciation_setting_spec.rb +95 -0
- data/spec/assets/models/error_spec.rb +65 -0
- data/spec/assets/models/field_validation_errors_element_spec.rb +71 -0
- data/spec/assets/models/pagination_spec.rb +59 -0
- data/spec/assets/models/resource_validation_errors_element_spec.rb +65 -0
- data/spec/assets/models/setting_spec.rb +83 -0
- data/spec/configuration_spec.rb +7 -23
- data/spec/projects/api/project_api_spec.rb +229 -0
- data/spec/projects/models/amount_spec.rb +47 -0
- data/spec/projects/models/charge_type_spec.rb +35 -0
- data/spec/projects/models/currency_code_spec.rb +35 -0
- data/spec/projects/models/error_spec.rb +47 -0
- data/spec/projects/models/pagination_spec.rb +59 -0
- data/spec/projects/models/project_create_or_update_spec.rb +59 -0
- data/spec/projects/models/project_patch_spec.rb +41 -0
- data/spec/projects/models/project_spec.rb +167 -0
- data/spec/projects/models/project_status_spec.rb +35 -0
- data/spec/projects/models/project_user_spec.rb +53 -0
- data/spec/projects/models/project_users_spec.rb +47 -0
- data/spec/projects/models/projects_spec.rb +47 -0
- data/spec/projects/models/task_create_or_update_spec.rb +59 -0
- data/spec/projects/models/task_spec.rb +129 -0
- data/spec/projects/models/tasks_spec.rb +47 -0
- data/spec/projects/models/time_entries_spec.rb +47 -0
- data/spec/projects/models/time_entry_create_or_update_spec.rb +65 -0
- data/spec/projects/models/time_entry_spec.rb +93 -0
- data/spec/spec_helper.rb +2 -2
- data/xero-ruby.gemspec +4 -5
- metadata +611 -482
- data/docs/Allocation.md +0 -21
- data/lib/.DS_Store +0 -0
- data/pkg/xero-ruby-0.1.3.gem +0 -0
- data/pkg/xero-ruby-0.2.2.gem +0 -0
- data/pkg/xero-ruby-0.2.3.gem +0 -0
@@ -0,0 +1,1035 @@
|
|
1
|
+
=begin
|
2
|
+
#Xero Projects API
|
3
|
+
|
4
|
+
#This is the Xero Projects API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.2.11
|
7
|
+
Contact: api@xero.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module XeroRuby
|
16
|
+
class ProjectApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.new)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# create one or more new projects
|
23
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
24
|
+
# @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Project]
|
27
|
+
def create_project(xero_tenant_id, project_create_or_update, opts = {})
|
28
|
+
data, _status_code, _headers = create_project_with_http_info(xero_tenant_id, project_create_or_update, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# create one or more new projects
|
33
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
34
|
+
# @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
|
37
|
+
def create_project_with_http_info(xero_tenant_id, project_create_or_update, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'xero_tenant_id' is set
|
42
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_project"
|
44
|
+
end
|
45
|
+
# verify the required parameter 'project_create_or_update' is set
|
46
|
+
if @api_client.config.client_side_validation && project_create_or_update.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.create_project"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/projects'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
|
55
|
+
# header parameters
|
56
|
+
header_params = opts[:header_params] || {}
|
57
|
+
# HTTP header 'Accept' (if needed)
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
61
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = opts[:form_params] || {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
|
68
|
+
|
69
|
+
# return_type
|
70
|
+
return_type = opts[:return_type] || 'Project'
|
71
|
+
|
72
|
+
# auth_names
|
73
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
74
|
+
|
75
|
+
new_options = opts.merge(
|
76
|
+
:header_params => header_params,
|
77
|
+
:query_params => query_params,
|
78
|
+
:form_params => form_params,
|
79
|
+
:body => post_body,
|
80
|
+
:auth_names => auth_names,
|
81
|
+
:return_type => return_type
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
# Allows you to create a task
|
92
|
+
# Allows you to create a specific task
|
93
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
94
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
95
|
+
# @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [TimeEntry]
|
98
|
+
def create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
|
99
|
+
data, _status_code, _headers = create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts)
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
# Allows you to create a task
|
104
|
+
# Allows you to create a specific task
|
105
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
106
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
107
|
+
# @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
|
110
|
+
def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
|
111
|
+
if @api_client.config.debugging
|
112
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.create_time_entry ...'
|
113
|
+
end
|
114
|
+
# verify the required parameter 'xero_tenant_id' is set
|
115
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_time_entry"
|
117
|
+
end
|
118
|
+
# verify the required parameter 'project_id' is set
|
119
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_time_entry"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'time_entry_create_or_update' is set
|
123
|
+
if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.create_time_entry"
|
125
|
+
end
|
126
|
+
# resource path
|
127
|
+
local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
|
128
|
+
|
129
|
+
# query parameters
|
130
|
+
query_params = opts[:query_params] || {}
|
131
|
+
|
132
|
+
# header parameters
|
133
|
+
header_params = opts[:header_params] || {}
|
134
|
+
# HTTP header 'Accept' (if needed)
|
135
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
136
|
+
# HTTP header 'Content-Type'
|
137
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
138
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
139
|
+
|
140
|
+
# form parameters
|
141
|
+
form_params = opts[:form_params] || {}
|
142
|
+
|
143
|
+
# http body (model)
|
144
|
+
post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
|
145
|
+
|
146
|
+
# return_type
|
147
|
+
return_type = opts[:return_type] || 'TimeEntry'
|
148
|
+
|
149
|
+
# auth_names
|
150
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
151
|
+
|
152
|
+
new_options = opts.merge(
|
153
|
+
:header_params => header_params,
|
154
|
+
:query_params => query_params,
|
155
|
+
:form_params => form_params,
|
156
|
+
:body => post_body,
|
157
|
+
:auth_names => auth_names,
|
158
|
+
:return_type => return_type
|
159
|
+
)
|
160
|
+
|
161
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
162
|
+
if @api_client.config.debugging
|
163
|
+
@api_client.config.logger.debug "API called: ProjectApi#create_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
164
|
+
end
|
165
|
+
return data, status_code, headers
|
166
|
+
end
|
167
|
+
|
168
|
+
# Allows you to delete a time entry
|
169
|
+
# Allows you to delete a specific time entry
|
170
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
171
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
172
|
+
# @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint
|
173
|
+
# @param [Hash] opts the optional parameters
|
174
|
+
# @return [nil]
|
175
|
+
def delete_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
|
176
|
+
delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
|
177
|
+
nil
|
178
|
+
end
|
179
|
+
|
180
|
+
# Allows you to delete a time entry
|
181
|
+
# Allows you to delete a specific time entry
|
182
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
183
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
184
|
+
# @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint
|
185
|
+
# @param [Hash] opts the optional parameters
|
186
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
187
|
+
def delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
|
188
|
+
if @api_client.config.debugging
|
189
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.delete_time_entry ...'
|
190
|
+
end
|
191
|
+
# verify the required parameter 'xero_tenant_id' is set
|
192
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
193
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.delete_time_entry"
|
194
|
+
end
|
195
|
+
# verify the required parameter 'project_id' is set
|
196
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
197
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_time_entry"
|
198
|
+
end
|
199
|
+
# verify the required parameter 'time_entry_id' is set
|
200
|
+
if @api_client.config.client_side_validation && time_entry_id.nil?
|
201
|
+
fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.delete_time_entry"
|
202
|
+
end
|
203
|
+
# resource path
|
204
|
+
local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
|
205
|
+
|
206
|
+
# query parameters
|
207
|
+
query_params = opts[:query_params] || {}
|
208
|
+
|
209
|
+
# header parameters
|
210
|
+
header_params = opts[:header_params] || {}
|
211
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
212
|
+
|
213
|
+
# form parameters
|
214
|
+
form_params = opts[:form_params] || {}
|
215
|
+
|
216
|
+
# http body (model)
|
217
|
+
post_body = opts[:body]
|
218
|
+
|
219
|
+
# return_type
|
220
|
+
return_type = opts[:return_type]
|
221
|
+
|
222
|
+
# auth_names
|
223
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
224
|
+
|
225
|
+
new_options = opts.merge(
|
226
|
+
:header_params => header_params,
|
227
|
+
:query_params => query_params,
|
228
|
+
:form_params => form_params,
|
229
|
+
:body => post_body,
|
230
|
+
:auth_names => auth_names,
|
231
|
+
:return_type => return_type
|
232
|
+
)
|
233
|
+
|
234
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
235
|
+
if @api_client.config.debugging
|
236
|
+
@api_client.config.logger.debug "API called: ProjectApi#delete_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
237
|
+
end
|
238
|
+
return data, status_code, headers
|
239
|
+
end
|
240
|
+
|
241
|
+
# Allows you to retrieve a single project
|
242
|
+
# Allows you to retrieve a specific project
|
243
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
244
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
245
|
+
# @param [Hash] opts the optional parameters
|
246
|
+
# @return [Project]
|
247
|
+
def get_project(xero_tenant_id, project_id, opts = {})
|
248
|
+
data, _status_code, _headers = get_project_with_http_info(xero_tenant_id, project_id, opts)
|
249
|
+
data
|
250
|
+
end
|
251
|
+
|
252
|
+
# Allows you to retrieve a single project
|
253
|
+
# Allows you to retrieve a specific project
|
254
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
255
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
256
|
+
# @param [Hash] opts the optional parameters
|
257
|
+
# @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
|
258
|
+
def get_project_with_http_info(xero_tenant_id, project_id, opts = {})
|
259
|
+
if @api_client.config.debugging
|
260
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...'
|
261
|
+
end
|
262
|
+
# verify the required parameter 'xero_tenant_id' is set
|
263
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
264
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project"
|
265
|
+
end
|
266
|
+
# verify the required parameter 'project_id' is set
|
267
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
268
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project"
|
269
|
+
end
|
270
|
+
# resource path
|
271
|
+
local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
|
272
|
+
|
273
|
+
# query parameters
|
274
|
+
query_params = opts[:query_params] || {}
|
275
|
+
|
276
|
+
# header parameters
|
277
|
+
header_params = opts[:header_params] || {}
|
278
|
+
# HTTP header 'Accept' (if needed)
|
279
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
280
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
281
|
+
|
282
|
+
# form parameters
|
283
|
+
form_params = opts[:form_params] || {}
|
284
|
+
|
285
|
+
# http body (model)
|
286
|
+
post_body = opts[:body]
|
287
|
+
|
288
|
+
# return_type
|
289
|
+
return_type = opts[:return_type] || 'Project'
|
290
|
+
|
291
|
+
# auth_names
|
292
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
293
|
+
|
294
|
+
new_options = opts.merge(
|
295
|
+
:header_params => header_params,
|
296
|
+
:query_params => query_params,
|
297
|
+
:form_params => form_params,
|
298
|
+
:body => post_body,
|
299
|
+
:auth_names => auth_names,
|
300
|
+
:return_type => return_type
|
301
|
+
)
|
302
|
+
|
303
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
304
|
+
if @api_client.config.debugging
|
305
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
306
|
+
end
|
307
|
+
return data, status_code, headers
|
308
|
+
end
|
309
|
+
|
310
|
+
# list all project users
|
311
|
+
# Allows you to retrieve the users on a projects.
|
312
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
313
|
+
# @param [Hash] opts the optional parameters
|
314
|
+
# @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. (default to 1)
|
315
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. (default to 50)
|
316
|
+
# @return [ProjectUsers]
|
317
|
+
def get_project_users(xero_tenant_id, opts = {})
|
318
|
+
data, _status_code, _headers = get_project_users_with_http_info(xero_tenant_id, opts)
|
319
|
+
data
|
320
|
+
end
|
321
|
+
|
322
|
+
# list all project users
|
323
|
+
# Allows you to retrieve the users on a projects.
|
324
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
325
|
+
# @param [Hash] opts the optional parameters
|
326
|
+
# @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
327
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
328
|
+
# @return [Array<(ProjectUsers, Integer, Hash)>] ProjectUsers data, response status code and response headers
|
329
|
+
def get_project_users_with_http_info(xero_tenant_id, opts = {})
|
330
|
+
if @api_client.config.debugging
|
331
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_project_users ...'
|
332
|
+
end
|
333
|
+
# verify the required parameter 'xero_tenant_id' is set
|
334
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
335
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project_users"
|
336
|
+
end
|
337
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
|
338
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be smaller than or equal to 500.'
|
339
|
+
end
|
340
|
+
|
341
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
342
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be greater than or equal to 1.'
|
343
|
+
end
|
344
|
+
|
345
|
+
# resource path
|
346
|
+
local_var_path = '/projectsusers'
|
347
|
+
|
348
|
+
# query parameters
|
349
|
+
query_params = opts[:query_params] || {}
|
350
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
351
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
352
|
+
|
353
|
+
# header parameters
|
354
|
+
header_params = opts[:header_params] || {}
|
355
|
+
# HTTP header 'Accept' (if needed)
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
357
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
358
|
+
|
359
|
+
# form parameters
|
360
|
+
form_params = opts[:form_params] || {}
|
361
|
+
|
362
|
+
# http body (model)
|
363
|
+
post_body = opts[:body]
|
364
|
+
|
365
|
+
# return_type
|
366
|
+
return_type = opts[:return_type] || 'ProjectUsers'
|
367
|
+
|
368
|
+
# auth_names
|
369
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
370
|
+
|
371
|
+
new_options = opts.merge(
|
372
|
+
:header_params => header_params,
|
373
|
+
:query_params => query_params,
|
374
|
+
:form_params => form_params,
|
375
|
+
:body => post_body,
|
376
|
+
:auth_names => auth_names,
|
377
|
+
:return_type => return_type
|
378
|
+
)
|
379
|
+
|
380
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
381
|
+
if @api_client.config.debugging
|
382
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_project_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
383
|
+
end
|
384
|
+
return data, status_code, headers
|
385
|
+
end
|
386
|
+
|
387
|
+
# list all projects
|
388
|
+
# Allows you to retrieve, create and update projects.
|
389
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
390
|
+
# @param [Hash] opts the optional parameters
|
391
|
+
# @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
|
392
|
+
# @option opts [String] :contact_id Filter for projects for a specific contact
|
393
|
+
# @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
|
394
|
+
# @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. (default to 1)
|
395
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. (default to 50)
|
396
|
+
# @return [Projects]
|
397
|
+
def get_projects(xero_tenant_id, opts = {})
|
398
|
+
data, _status_code, _headers = get_projects_with_http_info(xero_tenant_id, opts)
|
399
|
+
data
|
400
|
+
end
|
401
|
+
|
402
|
+
# list all projects
|
403
|
+
# Allows you to retrieve, create and update projects.
|
404
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
405
|
+
# @param [Hash] opts the optional parameters
|
406
|
+
# @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
|
407
|
+
# @option opts [String] :contact_id Filter for projects for a specific contact
|
408
|
+
# @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
|
409
|
+
# @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
410
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
411
|
+
# @return [Array<(Projects, Integer, Hash)>] Projects data, response status code and response headers
|
412
|
+
def get_projects_with_http_info(xero_tenant_id, opts = {})
|
413
|
+
if @api_client.config.debugging
|
414
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...'
|
415
|
+
end
|
416
|
+
# verify the required parameter 'xero_tenant_id' is set
|
417
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
418
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_projects"
|
419
|
+
end
|
420
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
|
421
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be smaller than or equal to 500.'
|
422
|
+
end
|
423
|
+
|
424
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
425
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be greater than or equal to 1.'
|
426
|
+
end
|
427
|
+
|
428
|
+
# resource path
|
429
|
+
local_var_path = '/projects'
|
430
|
+
|
431
|
+
# query parameters
|
432
|
+
query_params = opts[:query_params] || {}
|
433
|
+
query_params[:'projectIds'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
|
434
|
+
query_params[:'contactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
|
435
|
+
query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
|
436
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
437
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
438
|
+
|
439
|
+
# header parameters
|
440
|
+
header_params = opts[:header_params] || {}
|
441
|
+
# HTTP header 'Accept' (if needed)
|
442
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
443
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
444
|
+
|
445
|
+
# form parameters
|
446
|
+
form_params = opts[:form_params] || {}
|
447
|
+
|
448
|
+
# http body (model)
|
449
|
+
post_body = opts[:body]
|
450
|
+
|
451
|
+
# return_type
|
452
|
+
return_type = opts[:return_type] || 'Projects'
|
453
|
+
|
454
|
+
# auth_names
|
455
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
456
|
+
|
457
|
+
new_options = opts.merge(
|
458
|
+
:header_params => header_params,
|
459
|
+
:query_params => query_params,
|
460
|
+
:form_params => form_params,
|
461
|
+
:body => post_body,
|
462
|
+
:auth_names => auth_names,
|
463
|
+
:return_type => return_type
|
464
|
+
)
|
465
|
+
|
466
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
467
|
+
if @api_client.config.debugging
|
468
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
469
|
+
end
|
470
|
+
return data, status_code, headers
|
471
|
+
end
|
472
|
+
|
473
|
+
# Allows you to retrieve a single project
|
474
|
+
# Allows you to retrieve a specific project
|
475
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
476
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
477
|
+
# @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
|
478
|
+
# @param [Hash] opts the optional parameters
|
479
|
+
# @return [Task]
|
480
|
+
def get_task(xero_tenant_id, project_id, task_id, opts = {})
|
481
|
+
data, _status_code, _headers = get_task_with_http_info(xero_tenant_id, project_id, task_id, opts)
|
482
|
+
data
|
483
|
+
end
|
484
|
+
|
485
|
+
# Allows you to retrieve a single project
|
486
|
+
# Allows you to retrieve a specific project
|
487
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
488
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
489
|
+
# @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
|
490
|
+
# @param [Hash] opts the optional parameters
|
491
|
+
# @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers
|
492
|
+
def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {})
|
493
|
+
if @api_client.config.debugging
|
494
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_task ...'
|
495
|
+
end
|
496
|
+
# verify the required parameter 'xero_tenant_id' is set
|
497
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
498
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_task"
|
499
|
+
end
|
500
|
+
# verify the required parameter 'project_id' is set
|
501
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
502
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_task"
|
503
|
+
end
|
504
|
+
# verify the required parameter 'task_id' is set
|
505
|
+
if @api_client.config.client_side_validation && task_id.nil?
|
506
|
+
fail ArgumentError, "Missing the required parameter 'task_id' when calling ProjectApi.get_task"
|
507
|
+
end
|
508
|
+
# resource path
|
509
|
+
local_var_path = '/projects/{projectId}/tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s)
|
510
|
+
|
511
|
+
# query parameters
|
512
|
+
query_params = opts[:query_params] || {}
|
513
|
+
|
514
|
+
# header parameters
|
515
|
+
header_params = opts[:header_params] || {}
|
516
|
+
# HTTP header 'Accept' (if needed)
|
517
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
518
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
519
|
+
|
520
|
+
# form parameters
|
521
|
+
form_params = opts[:form_params] || {}
|
522
|
+
|
523
|
+
# http body (model)
|
524
|
+
post_body = opts[:body]
|
525
|
+
|
526
|
+
# return_type
|
527
|
+
return_type = opts[:return_type] || 'Task'
|
528
|
+
|
529
|
+
# auth_names
|
530
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
531
|
+
|
532
|
+
new_options = opts.merge(
|
533
|
+
:header_params => header_params,
|
534
|
+
:query_params => query_params,
|
535
|
+
:form_params => form_params,
|
536
|
+
:body => post_body,
|
537
|
+
:auth_names => auth_names,
|
538
|
+
:return_type => return_type
|
539
|
+
)
|
540
|
+
|
541
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
542
|
+
if @api_client.config.debugging
|
543
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
544
|
+
end
|
545
|
+
return data, status_code, headers
|
546
|
+
end
|
547
|
+
|
548
|
+
# Allows you to retrieve a single project
|
549
|
+
# Allows you to retrieve a specific project
|
550
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
551
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
552
|
+
# @param [Hash] opts the optional parameters
|
553
|
+
# @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
554
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
555
|
+
# @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId}
|
556
|
+
# @return [Tasks]
|
557
|
+
def get_tasks(xero_tenant_id, project_id, opts = {})
|
558
|
+
data, _status_code, _headers = get_tasks_with_http_info(xero_tenant_id, project_id, opts)
|
559
|
+
data
|
560
|
+
end
|
561
|
+
|
562
|
+
# Allows you to retrieve a single project
|
563
|
+
# Allows you to retrieve a specific project
|
564
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
565
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
566
|
+
# @param [Hash] opts the optional parameters
|
567
|
+
# @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
568
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
569
|
+
# @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId}
|
570
|
+
# @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers
|
571
|
+
def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {})
|
572
|
+
if @api_client.config.debugging
|
573
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_tasks ...'
|
574
|
+
end
|
575
|
+
# verify the required parameter 'xero_tenant_id' is set
|
576
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
577
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_tasks"
|
578
|
+
end
|
579
|
+
# verify the required parameter 'project_id' is set
|
580
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
581
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_tasks"
|
582
|
+
end
|
583
|
+
# resource path
|
584
|
+
local_var_path = '/projects/{projectId}/tasks'.sub('{' + 'projectId' + '}', project_id.to_s)
|
585
|
+
|
586
|
+
# query parameters
|
587
|
+
query_params = opts[:query_params] || {}
|
588
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
589
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
590
|
+
query_params[:'taskIds'] = opts[:'task_ids'] if !opts[:'task_ids'].nil?
|
591
|
+
|
592
|
+
# header parameters
|
593
|
+
header_params = opts[:header_params] || {}
|
594
|
+
# HTTP header 'Accept' (if needed)
|
595
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
596
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
597
|
+
|
598
|
+
# form parameters
|
599
|
+
form_params = opts[:form_params] || {}
|
600
|
+
|
601
|
+
# http body (model)
|
602
|
+
post_body = opts[:body]
|
603
|
+
|
604
|
+
# return_type
|
605
|
+
return_type = opts[:return_type] || 'Tasks'
|
606
|
+
|
607
|
+
# auth_names
|
608
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
609
|
+
|
610
|
+
new_options = opts.merge(
|
611
|
+
:header_params => header_params,
|
612
|
+
:query_params => query_params,
|
613
|
+
:form_params => form_params,
|
614
|
+
:body => post_body,
|
615
|
+
:auth_names => auth_names,
|
616
|
+
:return_type => return_type
|
617
|
+
)
|
618
|
+
|
619
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
620
|
+
if @api_client.config.debugging
|
621
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
622
|
+
end
|
623
|
+
return data, status_code, headers
|
624
|
+
end
|
625
|
+
|
626
|
+
# Allows you to retrieve the time entries associated with a specific project
|
627
|
+
# Allows you to retrieve the time entries associated with a specific project
|
628
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
629
|
+
# @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
|
630
|
+
# @param [Hash] opts the optional parameters
|
631
|
+
# @option opts [String] :user_id The xero user identifier of the person who logged time.
|
632
|
+
# @option opts [String] :task_id Identifier of the task that time entry is logged against.
|
633
|
+
# @option opts [String] :invoice_id Finds all time entries for this invoice.
|
634
|
+
# @option opts [String] :contact_id Finds all time entries for this contact identifier.
|
635
|
+
# @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
636
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
637
|
+
# @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified.
|
638
|
+
# @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`.
|
639
|
+
# @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field.
|
640
|
+
# @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field.
|
641
|
+
# @return [TimeEntries]
|
642
|
+
def get_time_entries(xero_tenant_id, project_id, opts = {})
|
643
|
+
data, _status_code, _headers = get_time_entries_with_http_info(xero_tenant_id, project_id, opts)
|
644
|
+
data
|
645
|
+
end
|
646
|
+
|
647
|
+
# Allows you to retrieve the time entries associated with a specific project
|
648
|
+
# Allows you to retrieve the time entries associated with a specific project
|
649
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
650
|
+
# @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
|
651
|
+
# @param [Hash] opts the optional parameters
|
652
|
+
# @option opts [String] :user_id The xero user identifier of the person who logged time.
|
653
|
+
# @option opts [String] :task_id Identifier of the task that time entry is logged against.
|
654
|
+
# @option opts [String] :invoice_id Finds all time entries for this invoice.
|
655
|
+
# @option opts [String] :contact_id Finds all time entries for this contact identifier.
|
656
|
+
# @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
|
657
|
+
# @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
|
658
|
+
# @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified.
|
659
|
+
# @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`.
|
660
|
+
# @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field.
|
661
|
+
# @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field.
|
662
|
+
# @return [Array<(TimeEntries, Integer, Hash)>] TimeEntries data, response status code and response headers
|
663
|
+
def get_time_entries_with_http_info(xero_tenant_id, project_id, opts = {})
|
664
|
+
if @api_client.config.debugging
|
665
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entries ...'
|
666
|
+
end
|
667
|
+
# verify the required parameter 'xero_tenant_id' is set
|
668
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
669
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entries"
|
670
|
+
end
|
671
|
+
# verify the required parameter 'project_id' is set
|
672
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
673
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entries"
|
674
|
+
end
|
675
|
+
# resource path
|
676
|
+
local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
|
677
|
+
|
678
|
+
# query parameters
|
679
|
+
query_params = opts[:query_params] || {}
|
680
|
+
query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
|
681
|
+
query_params[:'taskId'] = opts[:'task_id'] if !opts[:'task_id'].nil?
|
682
|
+
query_params[:'invoiceId'] = opts[:'invoice_id'] if !opts[:'invoice_id'].nil?
|
683
|
+
query_params[:'contactId'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
|
684
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
685
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
686
|
+
query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
|
687
|
+
query_params[:'isChargeable'] = opts[:'is_chargeable'] if !opts[:'is_chargeable'].nil?
|
688
|
+
query_params[:'dateAfterUtc'] = opts[:'date_after_utc'] if !opts[:'date_after_utc'].nil?
|
689
|
+
query_params[:'dateBeforeUtc'] = opts[:'date_before_utc'] if !opts[:'date_before_utc'].nil?
|
690
|
+
|
691
|
+
# header parameters
|
692
|
+
header_params = opts[:header_params] || {}
|
693
|
+
# HTTP header 'Accept' (if needed)
|
694
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
695
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
696
|
+
|
697
|
+
# form parameters
|
698
|
+
form_params = opts[:form_params] || {}
|
699
|
+
|
700
|
+
# http body (model)
|
701
|
+
post_body = opts[:body]
|
702
|
+
|
703
|
+
# return_type
|
704
|
+
return_type = opts[:return_type] || 'TimeEntries'
|
705
|
+
|
706
|
+
# auth_names
|
707
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
708
|
+
|
709
|
+
new_options = opts.merge(
|
710
|
+
:header_params => header_params,
|
711
|
+
:query_params => query_params,
|
712
|
+
:form_params => form_params,
|
713
|
+
:body => post_body,
|
714
|
+
:auth_names => auth_names,
|
715
|
+
:return_type => return_type
|
716
|
+
)
|
717
|
+
|
718
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
719
|
+
if @api_client.config.debugging
|
720
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_time_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
721
|
+
end
|
722
|
+
return data, status_code, headers
|
723
|
+
end
|
724
|
+
|
725
|
+
# Allows you to get a single time entry in a project
|
726
|
+
# Allows you to upget a single time entry in a project
|
727
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
728
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
729
|
+
# @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
|
730
|
+
# @param [Hash] opts the optional parameters
|
731
|
+
# @return [TimeEntry]
|
732
|
+
def get_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
|
733
|
+
data, _status_code, _headers = get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
|
734
|
+
data
|
735
|
+
end
|
736
|
+
|
737
|
+
# Allows you to get a single time entry in a project
|
738
|
+
# Allows you to upget a single time entry in a project
|
739
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
740
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
741
|
+
# @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
|
742
|
+
# @param [Hash] opts the optional parameters
|
743
|
+
# @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
|
744
|
+
def get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
|
745
|
+
if @api_client.config.debugging
|
746
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entry ...'
|
747
|
+
end
|
748
|
+
# verify the required parameter 'xero_tenant_id' is set
|
749
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
750
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entry"
|
751
|
+
end
|
752
|
+
# verify the required parameter 'project_id' is set
|
753
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
754
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entry"
|
755
|
+
end
|
756
|
+
# verify the required parameter 'time_entry_id' is set
|
757
|
+
if @api_client.config.client_side_validation && time_entry_id.nil?
|
758
|
+
fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.get_time_entry"
|
759
|
+
end
|
760
|
+
# resource path
|
761
|
+
local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
|
762
|
+
|
763
|
+
# query parameters
|
764
|
+
query_params = opts[:query_params] || {}
|
765
|
+
|
766
|
+
# header parameters
|
767
|
+
header_params = opts[:header_params] || {}
|
768
|
+
# HTTP header 'Accept' (if needed)
|
769
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
770
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
771
|
+
|
772
|
+
# form parameters
|
773
|
+
form_params = opts[:form_params] || {}
|
774
|
+
|
775
|
+
# http body (model)
|
776
|
+
post_body = opts[:body]
|
777
|
+
|
778
|
+
# return_type
|
779
|
+
return_type = opts[:return_type] || 'TimeEntry'
|
780
|
+
|
781
|
+
# auth_names
|
782
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
783
|
+
|
784
|
+
new_options = opts.merge(
|
785
|
+
:header_params => header_params,
|
786
|
+
:query_params => query_params,
|
787
|
+
:form_params => form_params,
|
788
|
+
:body => post_body,
|
789
|
+
:auth_names => auth_names,
|
790
|
+
:return_type => return_type
|
791
|
+
)
|
792
|
+
|
793
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
794
|
+
if @api_client.config.debugging
|
795
|
+
@api_client.config.logger.debug "API called: ProjectApi#get_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
796
|
+
end
|
797
|
+
return data, status_code, headers
|
798
|
+
end
|
799
|
+
|
800
|
+
# creates a project for the specified contact
|
801
|
+
# Allows you to update a specific projects.
|
802
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
803
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
804
|
+
# @param project_patch [ProjectPatch] Update the status of an existing Project
|
805
|
+
# @param [Hash] opts the optional parameters
|
806
|
+
# @return [nil]
|
807
|
+
def patch_project(xero_tenant_id, project_id, project_patch, opts = {})
|
808
|
+
patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts)
|
809
|
+
nil
|
810
|
+
end
|
811
|
+
|
812
|
+
# creates a project for the specified contact
|
813
|
+
# Allows you to update a specific projects.
|
814
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
815
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
816
|
+
# @param project_patch [ProjectPatch] Update the status of an existing Project
|
817
|
+
# @param [Hash] opts the optional parameters
|
818
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
819
|
+
def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts = {})
|
820
|
+
if @api_client.config.debugging
|
821
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...'
|
822
|
+
end
|
823
|
+
# verify the required parameter 'xero_tenant_id' is set
|
824
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
825
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.patch_project"
|
826
|
+
end
|
827
|
+
# verify the required parameter 'project_id' is set
|
828
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
829
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project"
|
830
|
+
end
|
831
|
+
# verify the required parameter 'project_patch' is set
|
832
|
+
if @api_client.config.client_side_validation && project_patch.nil?
|
833
|
+
fail ArgumentError, "Missing the required parameter 'project_patch' when calling ProjectApi.patch_project"
|
834
|
+
end
|
835
|
+
# resource path
|
836
|
+
local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
|
837
|
+
|
838
|
+
# query parameters
|
839
|
+
query_params = opts[:query_params] || {}
|
840
|
+
|
841
|
+
# header parameters
|
842
|
+
header_params = opts[:header_params] || {}
|
843
|
+
# HTTP header 'Accept' (if needed)
|
844
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
845
|
+
# HTTP header 'Content-Type'
|
846
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
847
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
848
|
+
|
849
|
+
# form parameters
|
850
|
+
form_params = opts[:form_params] || {}
|
851
|
+
|
852
|
+
# http body (model)
|
853
|
+
post_body = opts[:body] || @api_client.object_to_http_body(project_patch)
|
854
|
+
|
855
|
+
# return_type
|
856
|
+
return_type = opts[:return_type]
|
857
|
+
|
858
|
+
# auth_names
|
859
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
860
|
+
|
861
|
+
new_options = opts.merge(
|
862
|
+
:header_params => header_params,
|
863
|
+
:query_params => query_params,
|
864
|
+
:form_params => form_params,
|
865
|
+
:body => post_body,
|
866
|
+
:auth_names => auth_names,
|
867
|
+
:return_type => return_type
|
868
|
+
)
|
869
|
+
|
870
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
871
|
+
if @api_client.config.debugging
|
872
|
+
@api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
873
|
+
end
|
874
|
+
return data, status_code, headers
|
875
|
+
end
|
876
|
+
|
877
|
+
# update a specific project
|
878
|
+
# Allows you to update a specific projects.
|
879
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
880
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
881
|
+
# @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
|
882
|
+
# @param [Hash] opts the optional parameters
|
883
|
+
# @return [nil]
|
884
|
+
def update_project(xero_tenant_id, project_id, project_create_or_update, opts = {})
|
885
|
+
update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts)
|
886
|
+
nil
|
887
|
+
end
|
888
|
+
|
889
|
+
# update a specific project
|
890
|
+
# Allows you to update a specific projects.
|
891
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
892
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
893
|
+
# @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
|
894
|
+
# @param [Hash] opts the optional parameters
|
895
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
896
|
+
def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts = {})
|
897
|
+
if @api_client.config.debugging
|
898
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...'
|
899
|
+
end
|
900
|
+
# verify the required parameter 'xero_tenant_id' is set
|
901
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
902
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_project"
|
903
|
+
end
|
904
|
+
# verify the required parameter 'project_id' is set
|
905
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
906
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_project"
|
907
|
+
end
|
908
|
+
# verify the required parameter 'project_create_or_update' is set
|
909
|
+
if @api_client.config.client_side_validation && project_create_or_update.nil?
|
910
|
+
fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.update_project"
|
911
|
+
end
|
912
|
+
# resource path
|
913
|
+
local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
|
914
|
+
|
915
|
+
# query parameters
|
916
|
+
query_params = opts[:query_params] || {}
|
917
|
+
|
918
|
+
# header parameters
|
919
|
+
header_params = opts[:header_params] || {}
|
920
|
+
# HTTP header 'Accept' (if needed)
|
921
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
922
|
+
# HTTP header 'Content-Type'
|
923
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
924
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
925
|
+
|
926
|
+
# form parameters
|
927
|
+
form_params = opts[:form_params] || {}
|
928
|
+
|
929
|
+
# http body (model)
|
930
|
+
post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
|
931
|
+
|
932
|
+
# return_type
|
933
|
+
return_type = opts[:return_type]
|
934
|
+
|
935
|
+
# auth_names
|
936
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
937
|
+
|
938
|
+
new_options = opts.merge(
|
939
|
+
:header_params => header_params,
|
940
|
+
:query_params => query_params,
|
941
|
+
:form_params => form_params,
|
942
|
+
:body => post_body,
|
943
|
+
:auth_names => auth_names,
|
944
|
+
:return_type => return_type
|
945
|
+
)
|
946
|
+
|
947
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
948
|
+
if @api_client.config.debugging
|
949
|
+
@api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
950
|
+
end
|
951
|
+
return data, status_code, headers
|
952
|
+
end
|
953
|
+
|
954
|
+
# Allows you to update time entry in a project
|
955
|
+
# Allows you to update time entry in a project
|
956
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
957
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
958
|
+
# @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
|
959
|
+
# @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
|
960
|
+
# @param [Hash] opts the optional parameters
|
961
|
+
# @return [nil]
|
962
|
+
def update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
|
963
|
+
update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts)
|
964
|
+
nil
|
965
|
+
end
|
966
|
+
|
967
|
+
# Allows you to update time entry in a project
|
968
|
+
# Allows you to update time entry in a project
|
969
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
970
|
+
# @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
|
971
|
+
# @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
|
972
|
+
# @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
|
973
|
+
# @param [Hash] opts the optional parameters
|
974
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
975
|
+
def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
|
976
|
+
if @api_client.config.debugging
|
977
|
+
@api_client.config.logger.debug 'Calling API: ProjectApi.update_time_entry ...'
|
978
|
+
end
|
979
|
+
# verify the required parameter 'xero_tenant_id' is set
|
980
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
981
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_time_entry"
|
982
|
+
end
|
983
|
+
# verify the required parameter 'project_id' is set
|
984
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
985
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_time_entry"
|
986
|
+
end
|
987
|
+
# verify the required parameter 'time_entry_id' is set
|
988
|
+
if @api_client.config.client_side_validation && time_entry_id.nil?
|
989
|
+
fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.update_time_entry"
|
990
|
+
end
|
991
|
+
# verify the required parameter 'time_entry_create_or_update' is set
|
992
|
+
if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
|
993
|
+
fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.update_time_entry"
|
994
|
+
end
|
995
|
+
# resource path
|
996
|
+
local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
|
997
|
+
|
998
|
+
# query parameters
|
999
|
+
query_params = opts[:query_params] || {}
|
1000
|
+
|
1001
|
+
# header parameters
|
1002
|
+
header_params = opts[:header_params] || {}
|
1003
|
+
# HTTP header 'Content-Type'
|
1004
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1005
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
1006
|
+
|
1007
|
+
# form parameters
|
1008
|
+
form_params = opts[:form_params] || {}
|
1009
|
+
|
1010
|
+
# http body (model)
|
1011
|
+
post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
|
1012
|
+
|
1013
|
+
# return_type
|
1014
|
+
return_type = opts[:return_type]
|
1015
|
+
|
1016
|
+
# auth_names
|
1017
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
1018
|
+
|
1019
|
+
new_options = opts.merge(
|
1020
|
+
:header_params => header_params,
|
1021
|
+
:query_params => query_params,
|
1022
|
+
:form_params => form_params,
|
1023
|
+
:body => post_body,
|
1024
|
+
:auth_names => auth_names,
|
1025
|
+
:return_type => return_type
|
1026
|
+
)
|
1027
|
+
|
1028
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
1029
|
+
if @api_client.config.debugging
|
1030
|
+
@api_client.config.logger.debug "API called: ProjectApi#update_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1031
|
+
end
|
1032
|
+
return data, status_code, headers
|
1033
|
+
end
|
1034
|
+
end
|
1035
|
+
end
|