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
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 2.
|
6
|
+
The version of the OpenAPI document: 2.2.11
|
7
7
|
Contact: api@xero.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -16,7 +16,7 @@ module XeroRuby
|
|
16
16
|
class AccountingApi
|
17
17
|
attr_accessor :api_client
|
18
18
|
|
19
|
-
def initialize(api_client = ApiClient.
|
19
|
+
def initialize(api_client = ApiClient.new)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Allows you to create a new chart of accounts
|
@@ -169,7 +169,7 @@ module XeroRuby
|
|
169
169
|
return data, status_code, headers
|
170
170
|
end
|
171
171
|
|
172
|
-
# Allows you to
|
172
|
+
# Allows you to create an Attachment on BankTransaction by Filename
|
173
173
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
174
174
|
# @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
|
175
175
|
# @param file_name [String] The name of the file being attached
|
@@ -181,7 +181,7 @@ module XeroRuby
|
|
181
181
|
data
|
182
182
|
end
|
183
183
|
|
184
|
-
# Allows you to
|
184
|
+
# Allows you to create an Attachment on BankTransaction by Filename
|
185
185
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
186
186
|
# @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
|
187
187
|
# @param file_name [String] The name of the file being attached
|
@@ -1218,6 +1218,7 @@ module XeroRuby
|
|
1218
1218
|
# @param credit_note_id [String] Unique identifier for a Credit Note
|
1219
1219
|
# @param allocations [Allocations] Allocations with array of Allocation object in body of request.
|
1220
1220
|
# @param [Hash] opts the optional parameters
|
1221
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
|
1221
1222
|
# @return [Allocations]
|
1222
1223
|
def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, opts = {})
|
1223
1224
|
data, _status_code, _headers = create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts)
|
@@ -1229,6 +1230,7 @@ module XeroRuby
|
|
1229
1230
|
# @param credit_note_id [String] Unique identifier for a Credit Note
|
1230
1231
|
# @param allocations [Allocations] Allocations with array of Allocation object in body of request.
|
1231
1232
|
# @param [Hash] opts the optional parameters
|
1233
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
1232
1234
|
# @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers
|
1233
1235
|
def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts = {})
|
1234
1236
|
if @api_client.config.debugging
|
@@ -1251,6 +1253,7 @@ module XeroRuby
|
|
1251
1253
|
|
1252
1254
|
# query parameters
|
1253
1255
|
query_params = opts[:query_params] || {}
|
1256
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
1254
1257
|
|
1255
1258
|
# header parameters
|
1256
1259
|
header_params = opts[:header_params] || {}
|
@@ -1292,12 +1295,12 @@ module XeroRuby
|
|
1292
1295
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1293
1296
|
# @param credit_note_id [String] Unique identifier for a Credit Note
|
1294
1297
|
# @param file_name [String] Name of the file you are attaching to Credit Note
|
1295
|
-
# @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
|
1296
1298
|
# @param body [String] Byte array of file in body of request
|
1297
1299
|
# @param [Hash] opts the optional parameters
|
1300
|
+
# @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
|
1298
1301
|
# @return [Attachments]
|
1299
|
-
def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name,
|
1300
|
-
data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name,
|
1302
|
+
def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {})
|
1303
|
+
data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts)
|
1301
1304
|
data
|
1302
1305
|
end
|
1303
1306
|
|
@@ -1305,11 +1308,11 @@ module XeroRuby
|
|
1305
1308
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1306
1309
|
# @param credit_note_id [String] Unique identifier for a Credit Note
|
1307
1310
|
# @param file_name [String] Name of the file you are attaching to Credit Note
|
1308
|
-
# @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
|
1309
1311
|
# @param body [String] Byte array of file in body of request
|
1310
1312
|
# @param [Hash] opts the optional parameters
|
1313
|
+
# @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
|
1311
1314
|
# @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
|
1312
|
-
def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name,
|
1315
|
+
def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {})
|
1313
1316
|
if @api_client.config.debugging
|
1314
1317
|
@api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...'
|
1315
1318
|
end
|
@@ -1325,19 +1328,16 @@ module XeroRuby
|
|
1325
1328
|
if @api_client.config.client_side_validation && file_name.nil?
|
1326
1329
|
fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name"
|
1327
1330
|
end
|
1328
|
-
# verify the required parameter 'include_online' is set
|
1329
|
-
if @api_client.config.client_side_validation && include_online.nil?
|
1330
|
-
fail ArgumentError, "Missing the required parameter 'include_online' when calling AccountingApi.create_credit_note_attachment_by_file_name"
|
1331
|
-
end
|
1332
1331
|
# verify the required parameter 'body' is set
|
1333
1332
|
if @api_client.config.client_side_validation && body.nil?
|
1334
1333
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name"
|
1335
1334
|
end
|
1336
1335
|
# resource path
|
1337
|
-
local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
|
1336
|
+
local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
|
1338
1337
|
|
1339
1338
|
# query parameters
|
1340
1339
|
query_params = opts[:query_params] || {}
|
1340
|
+
query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil?
|
1341
1341
|
|
1342
1342
|
# header parameters
|
1343
1343
|
header_params = opts[:header_params] || {}
|
@@ -1812,12 +1812,12 @@ module XeroRuby
|
|
1812
1812
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1813
1813
|
# @param invoice_id [String] Unique identifier for an Invoice
|
1814
1814
|
# @param file_name [String] Name of the file you are attaching
|
1815
|
-
# @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
|
1816
1815
|
# @param body [String] Byte array of file in body of request
|
1817
1816
|
# @param [Hash] opts the optional parameters
|
1817
|
+
# @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
|
1818
1818
|
# @return [Attachments]
|
1819
|
-
def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name,
|
1820
|
-
data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name,
|
1819
|
+
def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {})
|
1820
|
+
data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts)
|
1821
1821
|
data
|
1822
1822
|
end
|
1823
1823
|
|
@@ -1825,11 +1825,11 @@ module XeroRuby
|
|
1825
1825
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1826
1826
|
# @param invoice_id [String] Unique identifier for an Invoice
|
1827
1827
|
# @param file_name [String] Name of the file you are attaching
|
1828
|
-
# @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
|
1829
1828
|
# @param body [String] Byte array of file in body of request
|
1830
1829
|
# @param [Hash] opts the optional parameters
|
1830
|
+
# @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
|
1831
1831
|
# @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
|
1832
|
-
def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name,
|
1832
|
+
def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {})
|
1833
1833
|
if @api_client.config.debugging
|
1834
1834
|
@api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_attachment_by_file_name ...'
|
1835
1835
|
end
|
@@ -1845,19 +1845,16 @@ module XeroRuby
|
|
1845
1845
|
if @api_client.config.client_side_validation && file_name.nil?
|
1846
1846
|
fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_invoice_attachment_by_file_name"
|
1847
1847
|
end
|
1848
|
-
# verify the required parameter 'include_online' is set
|
1849
|
-
if @api_client.config.client_side_validation && include_online.nil?
|
1850
|
-
fail ArgumentError, "Missing the required parameter 'include_online' when calling AccountingApi.create_invoice_attachment_by_file_name"
|
1851
|
-
end
|
1852
1848
|
# verify the required parameter 'body' is set
|
1853
1849
|
if @api_client.config.client_side_validation && body.nil?
|
1854
1850
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_invoice_attachment_by_file_name"
|
1855
1851
|
end
|
1856
1852
|
# resource path
|
1857
|
-
local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
|
1853
|
+
local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
|
1858
1854
|
|
1859
1855
|
# query parameters
|
1860
1856
|
query_params = opts[:query_params] || {}
|
1857
|
+
query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil?
|
1861
1858
|
|
1862
1859
|
# header parameters
|
1863
1860
|
header_params = opts[:header_params] || {}
|
@@ -2787,6 +2784,7 @@ module XeroRuby
|
|
2787
2784
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
2788
2785
|
# @param payments [Payments] Payments array with Payment object in body of request
|
2789
2786
|
# @param [Hash] opts the optional parameters
|
2787
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
|
2790
2788
|
# @return [Payments]
|
2791
2789
|
def create_payments(xero_tenant_id, payments, opts = {})
|
2792
2790
|
data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts)
|
@@ -2797,6 +2795,7 @@ module XeroRuby
|
|
2797
2795
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
2798
2796
|
# @param payments [Payments] Payments array with Payment object in body of request
|
2799
2797
|
# @param [Hash] opts the optional parameters
|
2798
|
+
# @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
|
2800
2799
|
# @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
|
2801
2800
|
def create_payments_with_http_info(xero_tenant_id, payments, opts = {})
|
2802
2801
|
if @api_client.config.debugging
|
@@ -2815,6 +2814,7 @@ module XeroRuby
|
|
2815
2814
|
|
2816
2815
|
# query parameters
|
2817
2816
|
query_params = opts[:query_params] || {}
|
2817
|
+
query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
|
2818
2818
|
|
2819
2819
|
# header parameters
|
2820
2820
|
header_params = opts[:header_params] || {}
|
@@ -6173,7 +6173,7 @@ module XeroRuby
|
|
6173
6173
|
return data, status_code, headers
|
6174
6174
|
end
|
6175
6175
|
|
6176
|
-
# Allows you to retrieve
|
6176
|
+
# Allows you to retrieve a single contacts in a Xero organisation
|
6177
6177
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6178
6178
|
# @param contact_id [String] Unique identifier for a Contact
|
6179
6179
|
# @param [Hash] opts the optional parameters
|
@@ -6183,7 +6183,7 @@ module XeroRuby
|
|
6183
6183
|
data
|
6184
6184
|
end
|
6185
6185
|
|
6186
|
-
# Allows you to retrieve
|
6186
|
+
# Allows you to retrieve a single contacts in a Xero organisation
|
6187
6187
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6188
6188
|
# @param contact_id [String] Unique identifier for a Contact
|
6189
6189
|
# @param [Hash] opts the optional parameters
|
@@ -6467,6 +6467,73 @@ module XeroRuby
|
|
6467
6467
|
return data, status_code, headers
|
6468
6468
|
end
|
6469
6469
|
|
6470
|
+
# Allows you to retrieve a single contact by Contact Number in a Xero organisation
|
6471
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6472
|
+
# @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).
|
6473
|
+
# @param [Hash] opts the optional parameters
|
6474
|
+
# @return [Contacts]
|
6475
|
+
def get_contact_by_contact_number(xero_tenant_id, contact_number, opts = {})
|
6476
|
+
data, _status_code, _headers = get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts)
|
6477
|
+
data
|
6478
|
+
end
|
6479
|
+
|
6480
|
+
# Allows you to retrieve a single contact by Contact Number in a Xero organisation
|
6481
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6482
|
+
# @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).
|
6483
|
+
# @param [Hash] opts the optional parameters
|
6484
|
+
# @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
|
6485
|
+
def get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts = {})
|
6486
|
+
if @api_client.config.debugging
|
6487
|
+
@api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_by_contact_number ...'
|
6488
|
+
end
|
6489
|
+
# verify the required parameter 'xero_tenant_id' is set
|
6490
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
6491
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_by_contact_number"
|
6492
|
+
end
|
6493
|
+
# verify the required parameter 'contact_number' is set
|
6494
|
+
if @api_client.config.client_side_validation && contact_number.nil?
|
6495
|
+
fail ArgumentError, "Missing the required parameter 'contact_number' when calling AccountingApi.get_contact_by_contact_number"
|
6496
|
+
end
|
6497
|
+
# resource path
|
6498
|
+
local_var_path = '/Contacts/{ContactNumber}'.sub('{' + 'ContactNumber' + '}', contact_number.to_s)
|
6499
|
+
|
6500
|
+
# query parameters
|
6501
|
+
query_params = opts[:query_params] || {}
|
6502
|
+
|
6503
|
+
# header parameters
|
6504
|
+
header_params = opts[:header_params] || {}
|
6505
|
+
# HTTP header 'Accept' (if needed)
|
6506
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
6507
|
+
header_params[:'xero-tenant-id'] = xero_tenant_id
|
6508
|
+
|
6509
|
+
# form parameters
|
6510
|
+
form_params = opts[:form_params] || {}
|
6511
|
+
|
6512
|
+
# http body (model)
|
6513
|
+
post_body = opts[:body]
|
6514
|
+
|
6515
|
+
# return_type
|
6516
|
+
return_type = opts[:return_type] || 'Contacts'
|
6517
|
+
|
6518
|
+
# auth_names
|
6519
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
6520
|
+
|
6521
|
+
new_options = opts.merge(
|
6522
|
+
:header_params => header_params,
|
6523
|
+
:query_params => query_params,
|
6524
|
+
:form_params => form_params,
|
6525
|
+
:body => post_body,
|
6526
|
+
:auth_names => auth_names,
|
6527
|
+
:return_type => return_type
|
6528
|
+
)
|
6529
|
+
|
6530
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
6531
|
+
if @api_client.config.debugging
|
6532
|
+
@api_client.config.logger.debug "API called: AccountingApi#get_contact_by_contact_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
6533
|
+
end
|
6534
|
+
return data, status_code, headers
|
6535
|
+
end
|
6536
|
+
|
6470
6537
|
# Allows you to retrieve CISSettings for a contact in a Xero organisation
|
6471
6538
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6472
6539
|
# @param contact_id [String] Unique identifier for a Contact
|
@@ -6735,7 +6802,7 @@ module XeroRuby
|
|
6735
6802
|
return data, status_code, headers
|
6736
6803
|
end
|
6737
6804
|
|
6738
|
-
# Allows you to retrieve
|
6805
|
+
# Allows you to retrieve all contacts in a Xero organisation
|
6739
6806
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6740
6807
|
# @param [Hash] opts the optional parameters
|
6741
6808
|
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
@@ -6750,7 +6817,7 @@ module XeroRuby
|
|
6750
6817
|
data
|
6751
6818
|
end
|
6752
6819
|
|
6753
|
-
# Allows you to retrieve
|
6820
|
+
# Allows you to retrieve all contacts in a Xero organisation
|
6754
6821
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6755
6822
|
# @param [Hash] opts the optional parameters
|
6756
6823
|
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
@@ -9781,6 +9848,7 @@ module XeroRuby
|
|
9781
9848
|
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
9782
9849
|
# @option opts [String] :where Filter by an any element
|
9783
9850
|
# @option opts [String] :order Order by an any element
|
9851
|
+
# @option opts [Integer] :page Up to 100 payments will be returned in a single API call
|
9784
9852
|
# @return [Payments]
|
9785
9853
|
def get_payments(xero_tenant_id, opts = {})
|
9786
9854
|
data, _status_code, _headers = get_payments_with_http_info(xero_tenant_id, opts)
|
@@ -9793,6 +9861,7 @@ module XeroRuby
|
|
9793
9861
|
# @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
|
9794
9862
|
# @option opts [String] :where Filter by an any element
|
9795
9863
|
# @option opts [String] :order Order by an any element
|
9864
|
+
# @option opts [Integer] :page Up to 100 payments will be returned in a single API call
|
9796
9865
|
# @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
|
9797
9866
|
def get_payments_with_http_info(xero_tenant_id, opts = {})
|
9798
9867
|
if @api_client.config.debugging
|
@@ -9809,6 +9878,7 @@ module XeroRuby
|
|
9809
9878
|
query_params = opts[:query_params] || {}
|
9810
9879
|
query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
|
9811
9880
|
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
9881
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
9812
9882
|
|
9813
9883
|
# header parameters
|
9814
9884
|
header_params = opts[:header_params] || {}
|
@@ -10122,6 +10192,73 @@ module XeroRuby
|
|
10122
10192
|
return data, status_code, headers
|
10123
10193
|
end
|
10124
10194
|
|
10195
|
+
# Allows you to retrieve purchase orders as PDF files
|
10196
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
10197
|
+
# @param purchase_order_id [String] Unique identifier for an Purchase Order
|
10198
|
+
# @param [Hash] opts the optional parameters
|
10199
|
+
# @return [File]
|
10200
|
+
def get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id, opts = {})
|
10201
|
+
data, _status_code, _headers = get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts)
|
10202
|
+
data
|
10203
|
+
end
|
10204
|
+
|
10205
|
+
# Allows you to retrieve purchase orders as PDF files
|
10206
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
10207
|
+
# @param purchase_order_id [String] Unique identifier for an Purchase Order
|
10208
|
+
# @param [Hash] opts the optional parameters
|
10209
|
+
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
10210
|
+
def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts = {})
|
10211
|
+
if @api_client.config.debugging
|
10212
|
+
@api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_as_pdf ...'
|
10213
|
+
end
|
10214
|
+
# verify the required parameter 'xero_tenant_id' is set
|
10215
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
10216
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_as_pdf"
|
10217
|
+
end
|
10218
|
+
# verify the required parameter 'purchase_order_id' is set
|
10219
|
+
if @api_client.config.client_side_validation && purchase_order_id.nil?
|
10220
|
+
fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_as_pdf"
|
10221
|
+
end
|
10222
|
+
# resource path
|
10223
|
+
local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s)
|
10224
|
+
|
10225
|
+
# query parameters
|
10226
|
+
query_params = opts[:query_params] || {}
|
10227
|
+
|
10228
|
+
# header parameters
|
10229
|
+
header_params = opts[:header_params] || {}
|
10230
|
+
# HTTP header 'Accept' (if needed)
|
10231
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/pdf'])
|
10232
|
+
header_params[:'xero-tenant-id'] = xero_tenant_id
|
10233
|
+
|
10234
|
+
# form parameters
|
10235
|
+
form_params = opts[:form_params] || {}
|
10236
|
+
|
10237
|
+
# http body (model)
|
10238
|
+
post_body = opts[:body]
|
10239
|
+
|
10240
|
+
# return_type
|
10241
|
+
return_type = opts[:return_type] || 'File'
|
10242
|
+
|
10243
|
+
# auth_names
|
10244
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
10245
|
+
|
10246
|
+
new_options = opts.merge(
|
10247
|
+
:header_params => header_params,
|
10248
|
+
:query_params => query_params,
|
10249
|
+
:form_params => form_params,
|
10250
|
+
:body => post_body,
|
10251
|
+
:auth_names => auth_names,
|
10252
|
+
:return_type => return_type
|
10253
|
+
)
|
10254
|
+
|
10255
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
10256
|
+
if @api_client.config.debugging
|
10257
|
+
@api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
10258
|
+
end
|
10259
|
+
return data, status_code, headers
|
10260
|
+
end
|
10261
|
+
|
10125
10262
|
# Allows you to retrieve a specified purchase orders
|
10126
10263
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
10127
10264
|
# @param purchase_order_number [String] Unique identifier for a PurchaseOrder
|
@@ -0,0 +1,452 @@
|
|
1
|
+
=begin
|
2
|
+
#Xero Assets API
|
3
|
+
|
4
|
+
#This is the Xero Assets 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 AssetApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.new)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# adds a fixed asset
|
23
|
+
# Adds an asset to the system
|
24
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
25
|
+
# @param asset [Asset] Fixed asset you are creating
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [Asset]
|
28
|
+
def create_asset(xero_tenant_id, asset, opts = {})
|
29
|
+
data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# adds a fixed asset
|
34
|
+
# Adds an asset to the system
|
35
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
36
|
+
# @param asset [Asset] Fixed asset you are creating
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
|
39
|
+
def create_asset_with_http_info(xero_tenant_id, asset, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.create_asset ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'xero_tenant_id' is set
|
44
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'asset' is set
|
48
|
+
if @api_client.config.client_side_validation && asset.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'asset' when calling AssetApi.create_asset"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/Assets'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = opts[:form_params] || {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = opts[:body] || @api_client.object_to_http_body(asset)
|
70
|
+
|
71
|
+
# return_type
|
72
|
+
return_type = opts[:return_type] || 'Asset'
|
73
|
+
|
74
|
+
# auth_names
|
75
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
76
|
+
|
77
|
+
new_options = opts.merge(
|
78
|
+
:header_params => header_params,
|
79
|
+
:query_params => query_params,
|
80
|
+
:form_params => form_params,
|
81
|
+
:body => post_body,
|
82
|
+
:auth_names => auth_names,
|
83
|
+
:return_type => return_type
|
84
|
+
)
|
85
|
+
|
86
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
87
|
+
if @api_client.config.debugging
|
88
|
+
@api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
89
|
+
end
|
90
|
+
return data, status_code, headers
|
91
|
+
end
|
92
|
+
|
93
|
+
# adds a fixed asset type
|
94
|
+
# Adds an fixed asset type to the system
|
95
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @option opts [AssetType] :asset_type Asset type to add
|
98
|
+
# @return [AssetType]
|
99
|
+
def create_asset_type(xero_tenant_id, opts = {})
|
100
|
+
data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts)
|
101
|
+
data
|
102
|
+
end
|
103
|
+
|
104
|
+
# adds a fixed asset type
|
105
|
+
# Adds an fixed asset type to the system
|
106
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @option opts [AssetType] :asset_type Asset type to add
|
109
|
+
# @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers
|
110
|
+
def create_asset_type_with_http_info(xero_tenant_id, opts = {})
|
111
|
+
if @api_client.config.debugging
|
112
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...'
|
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 AssetApi.create_asset_type"
|
117
|
+
end
|
118
|
+
# resource path
|
119
|
+
local_var_path = '/AssetTypes'
|
120
|
+
|
121
|
+
# query parameters
|
122
|
+
query_params = opts[:query_params] || {}
|
123
|
+
|
124
|
+
# header parameters
|
125
|
+
header_params = opts[:header_params] || {}
|
126
|
+
# HTTP header 'Accept' (if needed)
|
127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
128
|
+
# HTTP header 'Content-Type'
|
129
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
130
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type'])
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:return_type] || 'AssetType'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type
|
151
|
+
)
|
152
|
+
|
153
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
156
|
+
end
|
157
|
+
return data, status_code, headers
|
158
|
+
end
|
159
|
+
|
160
|
+
# retrieves fixed asset by id
|
161
|
+
# By passing in the appropriate asset id, you can search for a specific fixed asset in the system
|
162
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
163
|
+
# @param id [String] fixed asset id for single object
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @return [Asset]
|
166
|
+
def get_asset_by_id(xero_tenant_id, id, opts = {})
|
167
|
+
data, _status_code, _headers = get_asset_by_id_with_http_info(xero_tenant_id, id, opts)
|
168
|
+
data
|
169
|
+
end
|
170
|
+
|
171
|
+
# retrieves fixed asset by id
|
172
|
+
# By passing in the appropriate asset id, you can search for a specific fixed asset in the system
|
173
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
174
|
+
# @param id [String] fixed asset id for single object
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
|
177
|
+
def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {})
|
178
|
+
if @api_client.config.debugging
|
179
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.get_asset_by_id ...'
|
180
|
+
end
|
181
|
+
# verify the required parameter 'xero_tenant_id' is set
|
182
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_by_id"
|
184
|
+
end
|
185
|
+
# verify the required parameter 'id' is set
|
186
|
+
if @api_client.config.client_side_validation && id.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AssetApi.get_asset_by_id"
|
188
|
+
end
|
189
|
+
# resource path
|
190
|
+
local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s)
|
191
|
+
|
192
|
+
# query parameters
|
193
|
+
query_params = opts[:query_params] || {}
|
194
|
+
|
195
|
+
# header parameters
|
196
|
+
header_params = opts[:header_params] || {}
|
197
|
+
# HTTP header 'Accept' (if needed)
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
200
|
+
|
201
|
+
# form parameters
|
202
|
+
form_params = opts[:form_params] || {}
|
203
|
+
|
204
|
+
# http body (model)
|
205
|
+
post_body = opts[:body]
|
206
|
+
|
207
|
+
# return_type
|
208
|
+
return_type = opts[:return_type] || 'Asset'
|
209
|
+
|
210
|
+
# auth_names
|
211
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
212
|
+
|
213
|
+
new_options = opts.merge(
|
214
|
+
:header_params => header_params,
|
215
|
+
:query_params => query_params,
|
216
|
+
:form_params => form_params,
|
217
|
+
:body => post_body,
|
218
|
+
:auth_names => auth_names,
|
219
|
+
:return_type => return_type
|
220
|
+
)
|
221
|
+
|
222
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
223
|
+
if @api_client.config.debugging
|
224
|
+
@api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
225
|
+
end
|
226
|
+
return data, status_code, headers
|
227
|
+
end
|
228
|
+
|
229
|
+
# searches fixed asset settings
|
230
|
+
# By passing in the appropriate options, you can search for available fixed asset types in the system
|
231
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
232
|
+
# @param [Hash] opts the optional parameters
|
233
|
+
# @return [Setting]
|
234
|
+
def get_asset_settings(xero_tenant_id, opts = {})
|
235
|
+
data, _status_code, _headers = get_asset_settings_with_http_info(xero_tenant_id, opts)
|
236
|
+
data
|
237
|
+
end
|
238
|
+
|
239
|
+
# searches fixed asset settings
|
240
|
+
# By passing in the appropriate options, you can search for available fixed asset types in the system
|
241
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
242
|
+
# @param [Hash] opts the optional parameters
|
243
|
+
# @return [Array<(Setting, Integer, Hash)>] Setting data, response status code and response headers
|
244
|
+
def get_asset_settings_with_http_info(xero_tenant_id, opts = {})
|
245
|
+
if @api_client.config.debugging
|
246
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.get_asset_settings ...'
|
247
|
+
end
|
248
|
+
# verify the required parameter 'xero_tenant_id' is set
|
249
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
250
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_settings"
|
251
|
+
end
|
252
|
+
# resource path
|
253
|
+
local_var_path = '/Settings'
|
254
|
+
|
255
|
+
# query parameters
|
256
|
+
query_params = opts[:query_params] || {}
|
257
|
+
|
258
|
+
# header parameters
|
259
|
+
header_params = opts[:header_params] || {}
|
260
|
+
# HTTP header 'Accept' (if needed)
|
261
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
262
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
263
|
+
|
264
|
+
# form parameters
|
265
|
+
form_params = opts[:form_params] || {}
|
266
|
+
|
267
|
+
# http body (model)
|
268
|
+
post_body = opts[:body]
|
269
|
+
|
270
|
+
# return_type
|
271
|
+
return_type = opts[:return_type] || 'Setting'
|
272
|
+
|
273
|
+
# auth_names
|
274
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
275
|
+
|
276
|
+
new_options = opts.merge(
|
277
|
+
:header_params => header_params,
|
278
|
+
:query_params => query_params,
|
279
|
+
:form_params => form_params,
|
280
|
+
:body => post_body,
|
281
|
+
:auth_names => auth_names,
|
282
|
+
:return_type => return_type
|
283
|
+
)
|
284
|
+
|
285
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
286
|
+
if @api_client.config.debugging
|
287
|
+
@api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
288
|
+
end
|
289
|
+
return data, status_code, headers
|
290
|
+
end
|
291
|
+
|
292
|
+
# searches fixed asset types
|
293
|
+
# By passing in the appropriate options, you can search for available fixed asset types in the system
|
294
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
295
|
+
# @param [Hash] opts the optional parameters
|
296
|
+
# @return [Array<AssetType>]
|
297
|
+
def get_asset_types(xero_tenant_id, opts = {})
|
298
|
+
data, _status_code, _headers = get_asset_types_with_http_info(xero_tenant_id, opts)
|
299
|
+
data
|
300
|
+
end
|
301
|
+
|
302
|
+
# searches fixed asset types
|
303
|
+
# By passing in the appropriate options, you can search for available fixed asset types in the system
|
304
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
305
|
+
# @param [Hash] opts the optional parameters
|
306
|
+
# @return [Array<(Array<AssetType>, Integer, Hash)>] Array<AssetType> data, response status code and response headers
|
307
|
+
def get_asset_types_with_http_info(xero_tenant_id, opts = {})
|
308
|
+
if @api_client.config.debugging
|
309
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.get_asset_types ...'
|
310
|
+
end
|
311
|
+
# verify the required parameter 'xero_tenant_id' is set
|
312
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
313
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_types"
|
314
|
+
end
|
315
|
+
# resource path
|
316
|
+
local_var_path = '/AssetTypes'
|
317
|
+
|
318
|
+
# query parameters
|
319
|
+
query_params = opts[:query_params] || {}
|
320
|
+
|
321
|
+
# header parameters
|
322
|
+
header_params = opts[:header_params] || {}
|
323
|
+
# HTTP header 'Accept' (if needed)
|
324
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
325
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
326
|
+
|
327
|
+
# form parameters
|
328
|
+
form_params = opts[:form_params] || {}
|
329
|
+
|
330
|
+
# http body (model)
|
331
|
+
post_body = opts[:body]
|
332
|
+
|
333
|
+
# return_type
|
334
|
+
return_type = opts[:return_type] || 'Array<AssetType>'
|
335
|
+
|
336
|
+
# auth_names
|
337
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
338
|
+
|
339
|
+
new_options = opts.merge(
|
340
|
+
:header_params => header_params,
|
341
|
+
:query_params => query_params,
|
342
|
+
:form_params => form_params,
|
343
|
+
:body => post_body,
|
344
|
+
:auth_names => auth_names,
|
345
|
+
:return_type => return_type
|
346
|
+
)
|
347
|
+
|
348
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
349
|
+
if @api_client.config.debugging
|
350
|
+
@api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
351
|
+
end
|
352
|
+
return data, status_code, headers
|
353
|
+
end
|
354
|
+
|
355
|
+
# searches fixed asset
|
356
|
+
# By passing in the appropriate options, you can search for available fixed asset in the system
|
357
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
358
|
+
# @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes
|
359
|
+
# @param [Hash] opts the optional parameters
|
360
|
+
# @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1.
|
361
|
+
# @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10.
|
362
|
+
# @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
|
363
|
+
# @option opts [String] :sort_direction ASC or DESC
|
364
|
+
# @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.
|
365
|
+
# @return [Assets]
|
366
|
+
def get_assets(xero_tenant_id, status, opts = {})
|
367
|
+
data, _status_code, _headers = get_assets_with_http_info(xero_tenant_id, status, opts)
|
368
|
+
data
|
369
|
+
end
|
370
|
+
|
371
|
+
# searches fixed asset
|
372
|
+
# By passing in the appropriate options, you can search for available fixed asset in the system
|
373
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
374
|
+
# @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes
|
375
|
+
# @param [Hash] opts the optional parameters
|
376
|
+
# @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1.
|
377
|
+
# @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10.
|
378
|
+
# @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
|
379
|
+
# @option opts [String] :sort_direction ASC or DESC
|
380
|
+
# @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.
|
381
|
+
# @return [Array<(Assets, Integer, Hash)>] Assets data, response status code and response headers
|
382
|
+
def get_assets_with_http_info(xero_tenant_id, status, opts = {})
|
383
|
+
if @api_client.config.debugging
|
384
|
+
@api_client.config.logger.debug 'Calling API: AssetApi.get_assets ...'
|
385
|
+
end
|
386
|
+
# verify the required parameter 'xero_tenant_id' is set
|
387
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
388
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_assets"
|
389
|
+
end
|
390
|
+
# verify the required parameter 'status' is set
|
391
|
+
if @api_client.config.client_side_validation && status.nil?
|
392
|
+
fail ArgumentError, "Missing the required parameter 'status' when calling AssetApi.get_assets"
|
393
|
+
end
|
394
|
+
allowable_values = ["AssetType", "AssetName", "AssetNumber", "PurchaseDate", "PurchasePrice", "DisposalDate", "DisposalPrice"]
|
395
|
+
if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by'])
|
396
|
+
fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}"
|
397
|
+
end
|
398
|
+
allowable_values = ["asc", "desc"]
|
399
|
+
if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
|
400
|
+
fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
|
401
|
+
end
|
402
|
+
allowable_values = ["AssetName", "AssetNumber", "Description", "AssetTypeName"]
|
403
|
+
if @api_client.config.client_side_validation && opts[:'filter_by'] && !allowable_values.include?(opts[:'filter_by'])
|
404
|
+
fail ArgumentError, "invalid value for \"filter_by\", must be one of #{allowable_values}"
|
405
|
+
end
|
406
|
+
# resource path
|
407
|
+
local_var_path = '/Assets'
|
408
|
+
|
409
|
+
# query parameters
|
410
|
+
query_params = opts[:query_params] || {}
|
411
|
+
query_params[:'status'] = status
|
412
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
413
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
414
|
+
query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
415
|
+
query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
|
416
|
+
query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?
|
417
|
+
|
418
|
+
# header parameters
|
419
|
+
header_params = opts[:header_params] || {}
|
420
|
+
# HTTP header 'Accept' (if needed)
|
421
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
422
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
423
|
+
|
424
|
+
# form parameters
|
425
|
+
form_params = opts[:form_params] || {}
|
426
|
+
|
427
|
+
# http body (model)
|
428
|
+
post_body = opts[:body]
|
429
|
+
|
430
|
+
# return_type
|
431
|
+
return_type = opts[:return_type] || 'Assets'
|
432
|
+
|
433
|
+
# auth_names
|
434
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
435
|
+
|
436
|
+
new_options = opts.merge(
|
437
|
+
:header_params => header_params,
|
438
|
+
:query_params => query_params,
|
439
|
+
:form_params => form_params,
|
440
|
+
:body => post_body,
|
441
|
+
:auth_names => auth_names,
|
442
|
+
:return_type => return_type
|
443
|
+
)
|
444
|
+
|
445
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
446
|
+
if @api_client.config.debugging
|
447
|
+
@api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
448
|
+
end
|
449
|
+
return data, status_code, headers
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|