xero-ruby 1.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -3
- data/build_notes.md +21 -0
- data/docs/accounting/AccountingApi.md +1514 -722
- data/docs/accounting/Allocation.md +11 -1
- data/docs/accounting/BankTransfer.md +1 -1
- data/docs/accounting/BatchPayment.md +1 -1
- data/docs/accounting/Contact.md +2 -2
- data/docs/accounting/CreditNote.md +2 -2
- data/docs/accounting/Invoice.md +2 -2
- data/docs/accounting/Journal.md +1 -1
- data/docs/accounting/ManualJournalLine.md +2 -0
- data/docs/accounting/Organisation.md +3 -1
- data/docs/accounting/Payment.md +6 -4
- data/docs/accounting/Quote.md +5 -1
- data/docs/accounting/Report.md +1 -1
- data/docs/accounting/{TenNinteyNineContact.md → TenNinetyNineContact.md} +2 -2
- data/docs/assets/AssetApi.md +40 -16
- data/docs/assets/AssetType.md +1 -1
- data/docs/projects/Amount.md +19 -0
- data/docs/projects/ChargeType.md +16 -0
- data/docs/projects/CurrencyCode.md +16 -0
- 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/projects/ProjectStatus.md +16 -0
- 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 +22 -3
- data/lib/xero-ruby/api/accounting_api.rb +85 -9
- data/lib/xero-ruby/api/asset_api.rb +3 -3
- data/lib/xero-ruby/api/project_api.rb +1035 -0
- data/lib/xero-ruby/api_client.rb +103 -37
- data/lib/xero-ruby/api_error.rb +2 -2
- data/lib/xero-ruby/configuration.rb +4 -5
- data/lib/xero-ruby/models/accounting/account.rb +61 -20
- data/lib/xero-ruby/models/accounting/account_type.rb +2 -2
- data/lib/xero-ruby/models/accounting/accounts.rb +8 -3
- data/lib/xero-ruby/models/accounting/accounts_payable.rb +11 -5
- data/lib/xero-ruby/models/accounting/accounts_receivable.rb +11 -5
- data/lib/xero-ruby/models/accounting/address.rb +19 -12
- data/lib/xero-ruby/models/accounting/allocation.rb +66 -9
- data/lib/xero-ruby/models/accounting/allocations.rb +8 -3
- data/lib/xero-ruby/models/accounting/attachment.rb +12 -8
- data/lib/xero-ruby/models/accounting/attachments.rb +8 -3
- data/lib/xero-ruby/models/accounting/balances.rb +9 -3
- data/lib/xero-ruby/models/accounting/bank_transaction.rb +43 -24
- data/lib/xero-ruby/models/accounting/bank_transactions.rb +8 -3
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +20 -14
- data/lib/xero-ruby/models/accounting/bank_transfers.rb +8 -3
- data/lib/xero-ruby/models/accounting/batch_payment.rb +29 -19
- data/lib/xero-ruby/models/accounting/batch_payment_details.rb +11 -7
- data/lib/xero-ruby/models/accounting/batch_payments.rb +8 -3
- data/lib/xero-ruby/models/accounting/bill.rb +8 -3
- data/lib/xero-ruby/models/accounting/branding_theme.rb +13 -8
- data/lib/xero-ruby/models/accounting/branding_themes.rb +8 -3
- data/lib/xero-ruby/models/accounting/cis_org_setting.rb +9 -5
- data/lib/xero-ruby/models/accounting/cis_setting.rb +8 -4
- data/lib/xero-ruby/models/accounting/cis_settings.rb +8 -3
- data/lib/xero-ruby/models/accounting/contact.rb +51 -37
- data/lib/xero-ruby/models/accounting/contact_group.rb +12 -6
- data/lib/xero-ruby/models/accounting/contact_groups.rb +8 -3
- data/lib/xero-ruby/models/accounting/contact_person.rb +10 -6
- data/lib/xero-ruby/models/accounting/contacts.rb +8 -3
- data/lib/xero-ruby/models/accounting/country_code.rb +2 -2
- data/lib/xero-ruby/models/accounting/credit_note.rb +47 -30
- data/lib/xero-ruby/models/accounting/credit_notes.rb +8 -3
- data/lib/xero-ruby/models/accounting/currencies.rb +8 -3
- data/lib/xero-ruby/models/accounting/currency.rb +9 -4
- data/lib/xero-ruby/models/accounting/currency_code.rb +4 -4
- data/lib/xero-ruby/models/accounting/element.rb +14 -4
- data/lib/xero-ruby/models/accounting/employee.rb +17 -8
- data/lib/xero-ruby/models/accounting/employees.rb +8 -3
- data/lib/xero-ruby/models/accounting/error.rb +10 -6
- data/lib/xero-ruby/models/accounting/expense_claim.rb +26 -15
- data/lib/xero-ruby/models/accounting/expense_claims.rb +8 -3
- data/lib/xero-ruby/models/accounting/external_link.rb +14 -4
- data/lib/xero-ruby/models/accounting/history_record.rb +10 -6
- data/lib/xero-ruby/models/accounting/history_records.rb +8 -3
- data/lib/xero-ruby/models/accounting/invoice.rb +69 -46
- data/lib/xero-ruby/models/accounting/invoice_reminder.rb +7 -3
- data/lib/xero-ruby/models/accounting/invoice_reminders.rb +8 -3
- data/lib/xero-ruby/models/accounting/invoices.rb +8 -3
- data/lib/xero-ruby/models/accounting/item.rb +24 -18
- data/lib/xero-ruby/models/accounting/items.rb +8 -3
- data/lib/xero-ruby/models/accounting/journal.rb +40 -11
- data/lib/xero-ruby/models/accounting/journal_line.rb +21 -16
- data/lib/xero-ruby/models/accounting/journals.rb +8 -3
- data/lib/xero-ruby/models/accounting/line_amount_types.rb +2 -2
- data/lib/xero-ruby/models/accounting/line_item.rb +25 -21
- data/lib/xero-ruby/models/accounting/line_item_tracking.rb +10 -6
- data/lib/xero-ruby/models/accounting/linked_transaction.rb +25 -13
- data/lib/xero-ruby/models/accounting/linked_transactions.rb +8 -3
- data/lib/xero-ruby/models/accounting/manual_journal.rb +25 -15
- data/lib/xero-ruby/models/accounting/manual_journal_line.rb +26 -12
- data/lib/xero-ruby/models/accounting/manual_journals.rb +8 -3
- data/lib/xero-ruby/models/accounting/online_invoice.rb +7 -3
- data/lib/xero-ruby/models/accounting/online_invoices.rb +8 -3
- data/lib/xero-ruby/models/accounting/organisation.rb +122 -32
- data/lib/xero-ruby/models/accounting/organisations.rb +8 -3
- data/lib/xero-ruby/models/accounting/overpayment.rb +36 -23
- data/lib/xero-ruby/models/accounting/overpayments.rb +8 -3
- data/lib/xero-ruby/models/accounting/payment.rb +57 -24
- data/lib/xero-ruby/models/accounting/payment_delete.rb +7 -3
- data/lib/xero-ruby/models/accounting/payment_service.rb +12 -8
- data/lib/xero-ruby/models/accounting/payment_services.rb +8 -3
- data/lib/xero-ruby/models/accounting/payment_term.rb +9 -3
- data/lib/xero-ruby/models/accounting/payment_term_type.rb +2 -2
- data/lib/xero-ruby/models/accounting/payments.rb +8 -3
- data/lib/xero-ruby/models/accounting/phone.rb +16 -6
- data/lib/xero-ruby/models/accounting/prepayment.rb +37 -23
- data/lib/xero-ruby/models/accounting/prepayments.rb +8 -3
- data/lib/xero-ruby/models/accounting/purchase.rb +11 -7
- data/lib/xero-ruby/models/accounting/purchase_order.rb +45 -33
- data/lib/xero-ruby/models/accounting/purchase_orders.rb +8 -3
- data/lib/xero-ruby/models/accounting/quote.rb +58 -28
- data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +2 -2
- data/lib/xero-ruby/models/accounting/quote_status_codes.rb +3 -2
- data/lib/xero-ruby/models/accounting/quotes.rb +8 -3
- data/lib/xero-ruby/models/accounting/receipt.rb +32 -19
- data/lib/xero-ruby/models/accounting/receipts.rb +8 -3
- data/lib/xero-ruby/models/accounting/repeating_invoice.rb +30 -17
- data/lib/xero-ruby/models/accounting/repeating_invoices.rb +8 -3
- data/lib/xero-ruby/models/accounting/report.rb +15 -9
- data/lib/xero-ruby/models/accounting/report_attribute.rb +9 -3
- data/lib/xero-ruby/models/accounting/report_cell.rb +9 -3
- data/lib/xero-ruby/models/accounting/report_fields.rb +10 -3
- data/lib/xero-ruby/models/accounting/report_row.rb +10 -3
- data/lib/xero-ruby/models/accounting/report_rows.rb +11 -3
- data/lib/xero-ruby/models/accounting/report_with_row.rb +15 -9
- data/lib/xero-ruby/models/accounting/report_with_rows.rb +8 -3
- data/lib/xero-ruby/models/accounting/reports.rb +8 -3
- data/lib/xero-ruby/models/accounting/request_empty.rb +7 -3
- data/lib/xero-ruby/models/accounting/row_type.rb +2 -2
- data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +8 -4
- data/lib/xero-ruby/models/accounting/schedule.rb +23 -11
- data/lib/xero-ruby/models/accounting/tax_component.rb +11 -7
- data/lib/xero-ruby/models/accounting/tax_rate.rb +100 -18
- data/lib/xero-ruby/models/accounting/tax_rates.rb +8 -3
- data/lib/xero-ruby/models/accounting/tax_type.rb +6 -2
- data/lib/xero-ruby/models/accounting/{ten_nintey_nine_contact.rb → ten_ninety_nine_contact.rb} +44 -40
- data/lib/xero-ruby/models/accounting/time_zone.rb +2 -2
- data/lib/xero-ruby/models/accounting/tracking_categories.rb +8 -3
- data/lib/xero-ruby/models/accounting/tracking_category.rb +15 -8
- data/lib/xero-ruby/models/accounting/tracking_option.rb +13 -6
- data/lib/xero-ruby/models/accounting/tracking_options.rb +8 -3
- data/lib/xero-ruby/models/accounting/user.rb +20 -9
- data/lib/xero-ruby/models/accounting/users.rb +8 -3
- data/lib/xero-ruby/models/accounting/validation_error.rb +7 -3
- data/lib/xero-ruby/models/assets/asset.rb +24 -17
- data/lib/xero-ruby/models/assets/asset_status.rb +2 -2
- data/lib/xero-ruby/models/assets/asset_status_query_param.rb +2 -2
- data/lib/xero-ruby/models/assets/asset_type.rb +13 -13
- data/lib/xero-ruby/models/assets/assets.rb +9 -3
- data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +19 -15
- data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +26 -11
- data/lib/xero-ruby/models/assets/error.rb +11 -7
- data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +12 -8
- data/lib/xero-ruby/models/assets/pagination.rb +11 -3
- data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +11 -7
- data/lib/xero-ruby/models/assets/setting.rb +14 -10
- 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/projects/pagination.rb +238 -0
- 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/accounting/api/accounting_api_spec.rb +19 -6
- data/spec/accounting/models/account_spec.rb +1 -1
- data/spec/accounting/models/account_type_spec.rb +1 -1
- data/spec/accounting/models/accounts_payable_spec.rb +1 -1
- data/spec/accounting/models/accounts_receivable_spec.rb +1 -1
- data/spec/accounting/models/accounts_spec.rb +1 -1
- data/spec/accounting/models/address_spec.rb +1 -1
- data/spec/accounting/models/allocation_spec.rb +1 -1
- data/spec/accounting/models/allocations_spec.rb +1 -1
- data/spec/accounting/models/attachment_spec.rb +1 -1
- data/spec/accounting/models/attachments_spec.rb +1 -1
- data/spec/accounting/models/balances_spec.rb +1 -1
- data/spec/accounting/models/bank_transaction_spec.rb +1 -1
- data/spec/accounting/models/bank_transactions_spec.rb +1 -1
- data/spec/accounting/models/bank_transfer_spec.rb +1 -1
- data/spec/accounting/models/bank_transfers_spec.rb +1 -1
- data/spec/accounting/models/batch_payment_details_spec.rb +1 -1
- data/spec/accounting/models/batch_payment_spec.rb +1 -1
- data/spec/accounting/models/batch_payments_spec.rb +1 -1
- data/spec/accounting/models/bill_spec.rb +1 -1
- data/spec/accounting/models/branding_theme_spec.rb +1 -1
- data/spec/accounting/models/branding_themes_spec.rb +1 -1
- data/spec/accounting/models/cis_org_setting_spec.rb +1 -1
- data/spec/accounting/models/cis_setting_spec.rb +1 -1
- data/spec/accounting/models/cis_settings_spec.rb +1 -1
- data/spec/accounting/models/contact_group_spec.rb +1 -1
- data/spec/accounting/models/contact_groups_spec.rb +1 -1
- data/spec/accounting/models/contact_person_spec.rb +1 -1
- data/spec/accounting/models/contact_spec.rb +1 -1
- data/spec/accounting/models/contacts_spec.rb +1 -1
- data/spec/accounting/models/country_code_spec.rb +1 -1
- data/spec/accounting/models/credit_note_spec.rb +1 -1
- data/spec/accounting/models/credit_notes_spec.rb +1 -1
- data/spec/accounting/models/currencies_spec.rb +1 -1
- data/spec/accounting/models/currency_code_spec.rb +1 -1
- data/spec/accounting/models/currency_spec.rb +1 -1
- data/spec/accounting/models/element_spec.rb +1 -1
- data/spec/accounting/models/employee_spec.rb +1 -1
- data/spec/accounting/models/employees_spec.rb +1 -1
- data/spec/accounting/models/error_spec.rb +1 -1
- data/spec/accounting/models/expense_claim_spec.rb +1 -1
- data/spec/accounting/models/expense_claims_spec.rb +1 -1
- data/spec/accounting/models/external_link_spec.rb +1 -1
- data/spec/accounting/models/history_record_spec.rb +1 -1
- data/spec/accounting/models/history_records_spec.rb +1 -1
- data/spec/accounting/models/invoice_reminder_spec.rb +1 -1
- data/spec/accounting/models/invoice_reminders_spec.rb +1 -1
- data/spec/accounting/models/invoice_spec.rb +1 -1
- data/spec/accounting/models/invoices_spec.rb +1 -1
- data/spec/accounting/models/item_spec.rb +1 -1
- data/spec/accounting/models/items_spec.rb +1 -1
- data/spec/accounting/models/journal_line_spec.rb +1 -1
- data/spec/accounting/models/journal_spec.rb +1 -1
- data/spec/accounting/models/journals_spec.rb +1 -1
- data/spec/accounting/models/line_amount_types_spec.rb +1 -1
- data/spec/accounting/models/line_item_spec.rb +1 -1
- data/spec/accounting/models/line_item_tracking_spec.rb +1 -1
- data/spec/accounting/models/linked_transaction_spec.rb +1 -1
- data/spec/accounting/models/linked_transactions_spec.rb +1 -1
- data/spec/accounting/models/manual_journal_line_spec.rb +1 -1
- data/spec/accounting/models/manual_journal_spec.rb +1 -1
- data/spec/accounting/models/manual_journals_spec.rb +1 -1
- data/spec/accounting/models/online_invoice_spec.rb +1 -1
- data/spec/accounting/models/online_invoices_spec.rb +1 -1
- data/spec/accounting/models/organisation_spec.rb +1 -1
- data/spec/accounting/models/organisations_spec.rb +1 -1
- data/spec/accounting/models/overpayment_spec.rb +1 -1
- data/spec/accounting/models/overpayments_spec.rb +1 -1
- data/spec/accounting/models/payment_delete_spec.rb +1 -1
- data/spec/accounting/models/payment_service_spec.rb +1 -1
- data/spec/accounting/models/payment_services_spec.rb +1 -1
- data/spec/accounting/models/payment_spec.rb +7 -1
- data/spec/accounting/models/payment_term_spec.rb +1 -1
- data/spec/accounting/models/payment_term_type_spec.rb +1 -1
- data/spec/accounting/models/payments_spec.rb +1 -1
- data/spec/accounting/models/phone_spec.rb +1 -1
- data/spec/accounting/models/prepayment_spec.rb +1 -1
- data/spec/accounting/models/prepayments_spec.rb +1 -1
- data/spec/accounting/models/purchase_order_spec.rb +1 -1
- data/spec/accounting/models/purchase_orders_spec.rb +1 -1
- data/spec/accounting/models/purchase_spec.rb +1 -1
- data/spec/accounting/models/quote_line_amount_types_spec.rb +1 -1
- data/spec/accounting/models/quote_spec.rb +1 -1
- data/spec/accounting/models/quote_status_codes_spec.rb +1 -1
- data/spec/accounting/models/quotes_spec.rb +1 -1
- data/spec/accounting/models/receipt_spec.rb +1 -1
- data/spec/accounting/models/receipts_spec.rb +1 -1
- data/spec/accounting/models/repeating_invoice_spec.rb +1 -1
- data/spec/accounting/models/repeating_invoices_spec.rb +1 -1
- data/spec/accounting/models/report_attribute_spec.rb +1 -1
- data/spec/accounting/models/report_cell_spec.rb +1 -1
- data/spec/accounting/models/report_fields_spec.rb +1 -1
- data/spec/accounting/models/report_row_spec.rb +1 -1
- data/spec/accounting/models/report_rows_spec.rb +1 -1
- data/spec/accounting/models/report_spec.rb +1 -1
- data/spec/accounting/models/report_with_row_spec.rb +1 -1
- data/spec/accounting/models/report_with_rows_spec.rb +1 -1
- data/spec/accounting/models/reports_spec.rb +1 -1
- data/spec/accounting/models/request_empty_spec.rb +1 -1
- data/spec/accounting/models/row_type_spec.rb +1 -1
- data/spec/accounting/models/sales_tracking_category_spec.rb +1 -1
- data/spec/accounting/models/schedule_spec.rb +1 -1
- data/spec/accounting/models/tax_component_spec.rb +1 -1
- data/spec/accounting/models/tax_rate_spec.rb +2 -2
- data/spec/accounting/models/tax_rates_spec.rb +1 -1
- data/spec/accounting/models/tax_type_spec.rb +1 -1
- data/spec/accounting/models/ten_nintey_nine_contact_spec.rb +7 -7
- data/spec/accounting/models/time_zone_spec.rb +1 -1
- data/spec/accounting/models/tracking_categories_spec.rb +1 -1
- data/spec/accounting/models/tracking_category_spec.rb +1 -1
- data/spec/accounting/models/tracking_option_spec.rb +1 -1
- data/spec/accounting/models/tracking_options_spec.rb +1 -1
- data/spec/accounting/models/user_spec.rb +1 -1
- data/spec/accounting/models/users_spec.rb +1 -1
- data/spec/accounting/models/validation_error_spec.rb +1 -1
- data/spec/api_client_spec.rb +120 -33
- data/spec/assets/api/asset_api_spec.rb +4 -4
- data/spec/assets/models/asset_spec.rb +1 -1
- data/spec/assets/models/asset_status_query_param_spec.rb +1 -1
- data/spec/assets/models/asset_status_spec.rb +1 -1
- data/spec/assets/models/asset_type_spec.rb +1 -1
- data/spec/assets/models/assets_spec.rb +1 -1
- data/spec/assets/models/book_depreciation_detail_spec.rb +1 -1
- data/spec/assets/models/book_depreciation_setting_spec.rb +1 -1
- data/spec/assets/models/error_spec.rb +1 -1
- data/spec/assets/models/field_validation_errors_element_spec.rb +1 -1
- data/spec/assets/models/pagination_spec.rb +1 -1
- data/spec/assets/models/resource_validation_errors_element_spec.rb +1 -1
- data/spec/assets/models/setting_spec.rb +1 -1
- data/spec/configuration_spec.rb +8 -24
- 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 +1 -1
- data/xero-ruby.gemspec +3 -4
- metadata +85 -9
- data/xero-ruby.gem +0 -0
@@ -0,0 +1,220 @@
|
|
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 'time'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
module XeroRuby::Projects
|
17
|
+
require 'bigdecimal'
|
18
|
+
|
19
|
+
class TimeEntries
|
20
|
+
|
21
|
+
attr_accessor :pagination
|
22
|
+
|
23
|
+
|
24
|
+
attr_accessor :items
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'pagination' => :'pagination',
|
30
|
+
:'items' => :'items'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
:'pagination' => :'Pagination',
|
38
|
+
:'items' => :'Array<TimeEntry>'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initializes the object
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
44
|
+
def initialize(attributes = {})
|
45
|
+
if (!attributes.is_a?(Hash))
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TimeEntries` initialize method"
|
47
|
+
end
|
48
|
+
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
51
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TimeEntries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
53
|
+
end
|
54
|
+
h[k.to_sym] = v
|
55
|
+
}
|
56
|
+
|
57
|
+
if attributes.key?(:'pagination')
|
58
|
+
self.pagination = attributes[:'pagination']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.key?(:'items')
|
62
|
+
if (value = attributes[:'items']).is_a?(Array)
|
63
|
+
self.items = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
invalid_properties
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
def valid?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
pagination == o.pagination &&
|
87
|
+
items == o.items
|
88
|
+
end
|
89
|
+
|
90
|
+
# @see the `==` method
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def eql?(o)
|
93
|
+
self == o
|
94
|
+
end
|
95
|
+
|
96
|
+
# Calculates hash code according to all attributes.
|
97
|
+
# @return [Integer] Hash code
|
98
|
+
def hash
|
99
|
+
[pagination, items].hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def self.build_from_hash(attributes)
|
106
|
+
new.build_from_hash(attributes)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
self.class.openapi_types.each_pair do |key, type|
|
115
|
+
if type =~ /\AArray<(.*)>/i
|
116
|
+
# check to ensure the input is an array given that the attribute
|
117
|
+
# is documented as an array but the input is not
|
118
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
119
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
120
|
+
end
|
121
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
122
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
123
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :DateTime
|
136
|
+
DateTime.parse(parse_date(value))
|
137
|
+
when :Date
|
138
|
+
Date.parse(parse_date(value))
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :BigDecimal
|
146
|
+
BigDecimal(value.to_s)
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
# generic object (usually a Hash), return directly
|
155
|
+
value
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each do |k, v|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else # model
|
168
|
+
XeroRuby::Projects.const_get(type).build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
next if value.nil?
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map { |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
# customized data_parser
|
215
|
+
def parse_date(datestring)
|
216
|
+
seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0
|
217
|
+
return Time.at(seconds_since_epoch).to_s
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,324 @@
|
|
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 'time'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
module XeroRuby::Projects
|
17
|
+
require 'bigdecimal'
|
18
|
+
|
19
|
+
class TimeEntry
|
20
|
+
# Identifier of the time entry.
|
21
|
+
attr_accessor :time_entry_id
|
22
|
+
|
23
|
+
# The xero user identifier of the person who logged time.
|
24
|
+
attr_accessor :user_id
|
25
|
+
|
26
|
+
# Identifier of the project, that the task (which the time entry is logged against) belongs to.
|
27
|
+
attr_accessor :project_id
|
28
|
+
|
29
|
+
# Identifier of the task that time entry is logged against.
|
30
|
+
attr_accessor :task_id
|
31
|
+
|
32
|
+
# The date time that time entry is logged on. UTC Date Time in ISO-8601 format.
|
33
|
+
attr_accessor :date_utc
|
34
|
+
|
35
|
+
# The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time.
|
36
|
+
attr_accessor :date_entered_utc
|
37
|
+
|
38
|
+
# The duration of logged minutes.
|
39
|
+
attr_accessor :duration
|
40
|
+
|
41
|
+
# A description of the time entry.
|
42
|
+
attr_accessor :description
|
43
|
+
|
44
|
+
# Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced.
|
45
|
+
attr_accessor :status
|
46
|
+
ACTIVE = "ACTIVE".freeze
|
47
|
+
LOCKED = "LOCKED".freeze
|
48
|
+
|
49
|
+
class EnumAttributeValidator
|
50
|
+
attr_reader :datatype
|
51
|
+
attr_reader :allowable_values
|
52
|
+
|
53
|
+
def initialize(datatype, allowable_values)
|
54
|
+
@allowable_values = allowable_values.map do |value|
|
55
|
+
case datatype.to_s
|
56
|
+
when /Integer/i
|
57
|
+
value.to_i
|
58
|
+
when /Float/i
|
59
|
+
value.to_f
|
60
|
+
else
|
61
|
+
value
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def valid?(value)
|
67
|
+
!value || allowable_values.include?(value)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
72
|
+
def self.attribute_map
|
73
|
+
{
|
74
|
+
:'time_entry_id' => :'timeEntryId',
|
75
|
+
:'user_id' => :'userId',
|
76
|
+
:'project_id' => :'projectId',
|
77
|
+
:'task_id' => :'taskId',
|
78
|
+
:'date_utc' => :'dateUtc',
|
79
|
+
:'date_entered_utc' => :'dateEnteredUtc',
|
80
|
+
:'duration' => :'duration',
|
81
|
+
:'description' => :'description',
|
82
|
+
:'status' => :'status'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Attribute type mapping.
|
87
|
+
def self.openapi_types
|
88
|
+
{
|
89
|
+
:'time_entry_id' => :'String',
|
90
|
+
:'user_id' => :'String',
|
91
|
+
:'project_id' => :'String',
|
92
|
+
:'task_id' => :'String',
|
93
|
+
:'date_utc' => :'DateTime',
|
94
|
+
:'date_entered_utc' => :'DateTime',
|
95
|
+
:'duration' => :'Integer',
|
96
|
+
:'description' => :'String',
|
97
|
+
:'status' => :'String'
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
def initialize(attributes = {})
|
104
|
+
if (!attributes.is_a?(Hash))
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TimeEntry` initialize method"
|
106
|
+
end
|
107
|
+
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
110
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TimeEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
112
|
+
end
|
113
|
+
h[k.to_sym] = v
|
114
|
+
}
|
115
|
+
|
116
|
+
if attributes.key?(:'time_entry_id')
|
117
|
+
self.time_entry_id = attributes[:'time_entry_id']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'user_id')
|
121
|
+
self.user_id = attributes[:'user_id']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'project_id')
|
125
|
+
self.project_id = attributes[:'project_id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'task_id')
|
129
|
+
self.task_id = attributes[:'task_id']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'date_utc')
|
133
|
+
self.date_utc = attributes[:'date_utc']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'date_entered_utc')
|
137
|
+
self.date_entered_utc = attributes[:'date_entered_utc']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'duration')
|
141
|
+
self.duration = attributes[:'duration']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'description')
|
145
|
+
self.description = attributes[:'description']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'status')
|
149
|
+
self.status = attributes[:'status']
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
154
|
+
# @return Array for valid properties with the reasons
|
155
|
+
def list_invalid_properties
|
156
|
+
invalid_properties = Array.new
|
157
|
+
invalid_properties
|
158
|
+
end
|
159
|
+
|
160
|
+
# Check to see if the all the properties in the model are valid
|
161
|
+
# @return true if the model is valid
|
162
|
+
def valid?
|
163
|
+
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED"])
|
164
|
+
return false unless status_validator.valid?(@status)
|
165
|
+
true
|
166
|
+
end
|
167
|
+
|
168
|
+
# Custom attribute writer method checking allowed values (enum).
|
169
|
+
# @param [Object] status Object to be assigned
|
170
|
+
def status=(status)
|
171
|
+
validator = EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED"])
|
172
|
+
unless validator.valid?(status)
|
173
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
174
|
+
end
|
175
|
+
@status = status
|
176
|
+
end
|
177
|
+
|
178
|
+
# Checks equality by comparing each attribute.
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def ==(o)
|
181
|
+
return true if self.equal?(o)
|
182
|
+
self.class == o.class &&
|
183
|
+
time_entry_id == o.time_entry_id &&
|
184
|
+
user_id == o.user_id &&
|
185
|
+
project_id == o.project_id &&
|
186
|
+
task_id == o.task_id &&
|
187
|
+
date_utc == o.date_utc &&
|
188
|
+
date_entered_utc == o.date_entered_utc &&
|
189
|
+
duration == o.duration &&
|
190
|
+
description == o.description &&
|
191
|
+
status == o.status
|
192
|
+
end
|
193
|
+
|
194
|
+
# @see the `==` method
|
195
|
+
# @param [Object] Object to be compared
|
196
|
+
def eql?(o)
|
197
|
+
self == o
|
198
|
+
end
|
199
|
+
|
200
|
+
# Calculates hash code according to all attributes.
|
201
|
+
# @return [Integer] Hash code
|
202
|
+
def hash
|
203
|
+
[time_entry_id, user_id, project_id, task_id, date_utc, date_entered_utc, duration, description, status].hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Builds the object from hash
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
208
|
+
# @return [Object] Returns the model itself
|
209
|
+
def self.build_from_hash(attributes)
|
210
|
+
new.build_from_hash(attributes)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Builds the object from hash
|
214
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
215
|
+
# @return [Object] Returns the model itself
|
216
|
+
def build_from_hash(attributes)
|
217
|
+
return nil unless attributes.is_a?(Hash)
|
218
|
+
self.class.openapi_types.each_pair do |key, type|
|
219
|
+
if type =~ /\AArray<(.*)>/i
|
220
|
+
# check to ensure the input is an array given that the attribute
|
221
|
+
# is documented as an array but the input is not
|
222
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
223
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
224
|
+
end
|
225
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
226
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
227
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
228
|
+
end
|
229
|
+
|
230
|
+
self
|
231
|
+
end
|
232
|
+
|
233
|
+
# Deserializes the data based on type
|
234
|
+
# @param string type Data type
|
235
|
+
# @param string value Value to be deserialized
|
236
|
+
# @return [Object] Deserialized data
|
237
|
+
def _deserialize(type, value)
|
238
|
+
case type.to_sym
|
239
|
+
when :DateTime
|
240
|
+
DateTime.parse(parse_date(value))
|
241
|
+
when :Date
|
242
|
+
Date.parse(parse_date(value))
|
243
|
+
when :String
|
244
|
+
value.to_s
|
245
|
+
when :Integer
|
246
|
+
value.to_i
|
247
|
+
when :Float
|
248
|
+
value.to_f
|
249
|
+
when :BigDecimal
|
250
|
+
BigDecimal(value.to_s)
|
251
|
+
when :Boolean
|
252
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
253
|
+
true
|
254
|
+
else
|
255
|
+
false
|
256
|
+
end
|
257
|
+
when :Object
|
258
|
+
# generic object (usually a Hash), return directly
|
259
|
+
value
|
260
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
261
|
+
inner_type = Regexp.last_match[:inner_type]
|
262
|
+
value.map { |v| _deserialize(inner_type, v) }
|
263
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
264
|
+
k_type = Regexp.last_match[:k_type]
|
265
|
+
v_type = Regexp.last_match[:v_type]
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each do |k, v|
|
268
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
else # model
|
272
|
+
XeroRuby::Projects.const_get(type).build_from_hash(value)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# Returns the string representation of the object
|
277
|
+
# @return [String] String presentation of the object
|
278
|
+
def to_s
|
279
|
+
to_hash.to_s
|
280
|
+
end
|
281
|
+
|
282
|
+
# to_body is an alias to to_hash (backward compatibility)
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
284
|
+
def to_body
|
285
|
+
to_hash
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns the object in the form of hash
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_hash
|
291
|
+
hash = {}
|
292
|
+
self.class.attribute_map.each_pair do |attr, param|
|
293
|
+
value = self.send(attr)
|
294
|
+
next if value.nil?
|
295
|
+
hash[param] = _to_hash(value)
|
296
|
+
end
|
297
|
+
hash
|
298
|
+
end
|
299
|
+
|
300
|
+
# Outputs non-array value in the form of hash
|
301
|
+
# For object, use to_hash. Otherwise, just return the value
|
302
|
+
# @param [Object] value Any valid value
|
303
|
+
# @return [Hash] Returns the value in the form of hash
|
304
|
+
def _to_hash(value)
|
305
|
+
if value.is_a?(Array)
|
306
|
+
value.compact.map { |v| _to_hash(v) }
|
307
|
+
elsif value.is_a?(Hash)
|
308
|
+
{}.tap do |hash|
|
309
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
310
|
+
end
|
311
|
+
elsif value.respond_to? :to_hash
|
312
|
+
value.to_hash
|
313
|
+
else
|
314
|
+
value
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# customized data_parser
|
319
|
+
def parse_date(datestring)
|
320
|
+
seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0
|
321
|
+
return Time.at(seconds_since_epoch).to_s
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|