xero-ruby 2.9.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +133 -97
- data/lib/xero-ruby.rb +3 -0
- data/lib/xero-ruby/api/accounting_api.rb +306 -147
- data/lib/xero-ruby/api_client.rb +57 -8
- data/lib/xero-ruby/models/accounting/account.rb +11 -7
- data/lib/xero-ruby/models/accounting/accounts.rb +11 -7
- data/lib/xero-ruby/models/accounting/accounts_payable.rb +11 -7
- data/lib/xero-ruby/models/accounting/accounts_receivable.rb +11 -7
- data/lib/xero-ruby/models/accounting/action.rb +11 -7
- data/lib/xero-ruby/models/accounting/actions.rb +11 -7
- data/lib/xero-ruby/models/accounting/address.rb +11 -7
- data/lib/xero-ruby/models/accounting/address_for_organisation.rb +11 -7
- data/lib/xero-ruby/models/accounting/allocation.rb +11 -7
- data/lib/xero-ruby/models/accounting/allocations.rb +11 -7
- data/lib/xero-ruby/models/accounting/attachment.rb +11 -7
- data/lib/xero-ruby/models/accounting/attachments.rb +11 -7
- data/lib/xero-ruby/models/accounting/balance_details.rb +11 -7
- data/lib/xero-ruby/models/accounting/balances.rb +11 -7
- data/lib/xero-ruby/models/accounting/bank_transaction.rb +11 -7
- data/lib/xero-ruby/models/accounting/bank_transactions.rb +11 -7
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +11 -7
- data/lib/xero-ruby/models/accounting/bank_transfers.rb +11 -7
- data/lib/xero-ruby/models/accounting/batch_payment.rb +11 -7
- data/lib/xero-ruby/models/accounting/batch_payment_details.rb +11 -7
- data/lib/xero-ruby/models/accounting/batch_payments.rb +11 -7
- data/lib/xero-ruby/models/accounting/bill.rb +11 -7
- data/lib/xero-ruby/models/accounting/branding_theme.rb +11 -7
- data/lib/xero-ruby/models/accounting/branding_themes.rb +11 -7
- data/lib/xero-ruby/models/accounting/budget.rb +321 -0
- data/lib/xero-ruby/models/accounting/budget_lines.rb +265 -0
- data/lib/xero-ruby/models/accounting/budgets.rb +222 -0
- data/lib/xero-ruby/models/accounting/cis_org_setting.rb +11 -7
- data/lib/xero-ruby/models/accounting/cis_org_settings.rb +11 -7
- data/lib/xero-ruby/models/accounting/cis_setting.rb +11 -7
- data/lib/xero-ruby/models/accounting/cis_settings.rb +11 -7
- data/lib/xero-ruby/models/accounting/contact.rb +11 -7
- data/lib/xero-ruby/models/accounting/contact_group.rb +11 -7
- data/lib/xero-ruby/models/accounting/contact_groups.rb +11 -7
- data/lib/xero-ruby/models/accounting/contact_person.rb +11 -7
- data/lib/xero-ruby/models/accounting/contacts.rb +11 -7
- data/lib/xero-ruby/models/accounting/conversion_balances.rb +11 -7
- data/lib/xero-ruby/models/accounting/conversion_date.rb +11 -7
- data/lib/xero-ruby/models/accounting/credit_note.rb +11 -7
- data/lib/xero-ruby/models/accounting/credit_notes.rb +11 -7
- data/lib/xero-ruby/models/accounting/currencies.rb +11 -7
- data/lib/xero-ruby/models/accounting/currency.rb +11 -7
- data/lib/xero-ruby/models/accounting/element.rb +11 -7
- data/lib/xero-ruby/models/accounting/employee.rb +11 -7
- data/lib/xero-ruby/models/accounting/employees.rb +11 -7
- data/lib/xero-ruby/models/accounting/error.rb +11 -7
- data/lib/xero-ruby/models/accounting/expense_claim.rb +11 -7
- data/lib/xero-ruby/models/accounting/expense_claims.rb +11 -7
- data/lib/xero-ruby/models/accounting/external_link.rb +11 -7
- data/lib/xero-ruby/models/accounting/history_record.rb +11 -7
- data/lib/xero-ruby/models/accounting/history_records.rb +11 -7
- data/lib/xero-ruby/models/accounting/import_summary.rb +11 -7
- data/lib/xero-ruby/models/accounting/import_summary_accounts.rb +11 -7
- data/lib/xero-ruby/models/accounting/import_summary_object.rb +11 -7
- data/lib/xero-ruby/models/accounting/import_summary_organisation.rb +11 -7
- data/lib/xero-ruby/models/accounting/invoice.rb +11 -7
- data/lib/xero-ruby/models/accounting/invoice_reminder.rb +11 -7
- data/lib/xero-ruby/models/accounting/invoice_reminders.rb +11 -7
- data/lib/xero-ruby/models/accounting/invoices.rb +11 -7
- data/lib/xero-ruby/models/accounting/item.rb +11 -7
- data/lib/xero-ruby/models/accounting/items.rb +11 -7
- data/lib/xero-ruby/models/accounting/journal.rb +11 -7
- data/lib/xero-ruby/models/accounting/journal_line.rb +11 -7
- data/lib/xero-ruby/models/accounting/journals.rb +11 -7
- data/lib/xero-ruby/models/accounting/line_item.rb +22 -8
- data/lib/xero-ruby/models/accounting/line_item_tracking.rb +11 -7
- data/lib/xero-ruby/models/accounting/linked_transaction.rb +11 -7
- data/lib/xero-ruby/models/accounting/linked_transactions.rb +11 -7
- data/lib/xero-ruby/models/accounting/manual_journal.rb +11 -7
- data/lib/xero-ruby/models/accounting/manual_journal_line.rb +11 -7
- data/lib/xero-ruby/models/accounting/manual_journals.rb +11 -7
- data/lib/xero-ruby/models/accounting/online_invoice.rb +11 -7
- data/lib/xero-ruby/models/accounting/online_invoices.rb +11 -7
- data/lib/xero-ruby/models/accounting/organisation.rb +11 -7
- data/lib/xero-ruby/models/accounting/organisations.rb +11 -7
- data/lib/xero-ruby/models/accounting/overpayment.rb +11 -7
- data/lib/xero-ruby/models/accounting/overpayments.rb +11 -7
- data/lib/xero-ruby/models/accounting/payment.rb +11 -7
- data/lib/xero-ruby/models/accounting/payment_delete.rb +11 -7
- data/lib/xero-ruby/models/accounting/payment_service.rb +11 -7
- data/lib/xero-ruby/models/accounting/payment_services.rb +11 -7
- data/lib/xero-ruby/models/accounting/payment_term.rb +11 -7
- data/lib/xero-ruby/models/accounting/payments.rb +11 -7
- data/lib/xero-ruby/models/accounting/phone.rb +11 -7
- data/lib/xero-ruby/models/accounting/prepayment.rb +24 -8
- data/lib/xero-ruby/models/accounting/prepayments.rb +11 -7
- data/lib/xero-ruby/models/accounting/purchase.rb +11 -7
- data/lib/xero-ruby/models/accounting/purchase_order.rb +11 -7
- data/lib/xero-ruby/models/accounting/purchase_orders.rb +11 -7
- data/lib/xero-ruby/models/accounting/quote.rb +11 -7
- data/lib/xero-ruby/models/accounting/quotes.rb +11 -7
- data/lib/xero-ruby/models/accounting/receipt.rb +11 -7
- data/lib/xero-ruby/models/accounting/receipts.rb +11 -7
- data/lib/xero-ruby/models/accounting/repeating_invoice.rb +11 -7
- data/lib/xero-ruby/models/accounting/repeating_invoices.rb +11 -7
- data/lib/xero-ruby/models/accounting/report.rb +12 -18
- data/lib/xero-ruby/models/accounting/report_attribute.rb +11 -7
- data/lib/xero-ruby/models/accounting/report_cell.rb +11 -7
- data/lib/xero-ruby/models/accounting/report_fields.rb +11 -7
- data/lib/xero-ruby/models/accounting/report_row.rb +11 -7
- data/lib/xero-ruby/models/accounting/report_rows.rb +11 -7
- data/lib/xero-ruby/models/accounting/report_with_row.rb +12 -8
- data/lib/xero-ruby/models/accounting/report_with_rows.rb +11 -7
- data/lib/xero-ruby/models/accounting/reports.rb +11 -7
- data/lib/xero-ruby/models/accounting/request_empty.rb +11 -7
- data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +11 -7
- data/lib/xero-ruby/models/accounting/schedule.rb +11 -7
- data/lib/xero-ruby/models/accounting/setup.rb +11 -7
- data/lib/xero-ruby/models/accounting/tax_component.rb +11 -7
- data/lib/xero-ruby/models/accounting/tax_rate.rb +11 -7
- data/lib/xero-ruby/models/accounting/tax_rates.rb +11 -7
- data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +11 -7
- data/lib/xero-ruby/models/accounting/tracking_categories.rb +11 -7
- data/lib/xero-ruby/models/accounting/tracking_category.rb +11 -7
- data/lib/xero-ruby/models/accounting/tracking_option.rb +11 -7
- data/lib/xero-ruby/models/accounting/tracking_options.rb +11 -7
- data/lib/xero-ruby/models/accounting/user.rb +11 -7
- data/lib/xero-ruby/models/accounting/users.rb +11 -7
- data/lib/xero-ruby/models/accounting/validation_error.rb +11 -7
- data/lib/xero-ruby/models/assets/asset.rb +11 -7
- data/lib/xero-ruby/models/assets/asset_type.rb +11 -7
- data/lib/xero-ruby/models/assets/assets.rb +11 -7
- data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +11 -7
- data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +11 -7
- data/lib/xero-ruby/models/assets/error.rb +11 -7
- data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +11 -7
- data/lib/xero-ruby/models/assets/pagination.rb +11 -7
- data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +11 -7
- data/lib/xero-ruby/models/assets/setting.rb +11 -7
- data/lib/xero-ruby/models/files/association.rb +11 -7
- data/lib/xero-ruby/models/files/file_object.rb +11 -7
- data/lib/xero-ruby/models/files/files.rb +11 -7
- data/lib/xero-ruby/models/files/folder.rb +11 -7
- data/lib/xero-ruby/models/files/folders.rb +11 -7
- data/lib/xero-ruby/models/files/upload_object.rb +11 -7
- data/lib/xero-ruby/models/files/user.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/account.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/api_exception.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/bank_account.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/deduction_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/deduction_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/employee.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/employees.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/home_address.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_application.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_applications.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_lines.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_period.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/leave_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/opening_balances.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/pay_item.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/pay_items.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/pay_run.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/pay_runs.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/pay_template.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payroll_calendars.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payslip.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payslip_lines.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payslip_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payslip_summary.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/payslips.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/reimbursement_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/reimbursement_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/settings.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/settings_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_fund.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_fund_product.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_fund_products.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_funds.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/super_membership.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/superannuation_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/tax_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/timesheet.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/timesheet_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/timesheet_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/timesheets.rb +11 -7
- data/lib/xero-ruby/models/payroll_au/validation_error.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/account.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/accounts.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/address.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/bank_account.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/benefit.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/deduction.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/deduction_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/deduction_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/deductions.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_order.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_orders.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_rate.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_rates.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_template.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_leaves.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_tax.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employees.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employment.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/employment_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/invalid_field.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_period.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_periods.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_type_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/leave_types.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pagination.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_run.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_run_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_runs.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_slip.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/pay_slips.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/payment_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/payment_method.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/payment_method_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/problem.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/reimbursement.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/reimbursements.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/settings.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/superannuation_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/superannuation_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/superannuations.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/tax_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/tax_settings.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheet.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheet_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheet_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/timesheets.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/tracking_categories.rb +11 -7
- data/lib/xero-ruby/models/payroll_nz/tracking_category.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/account.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/accounts.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/address.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/bank_account.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/benefit.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/benefit_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/benefit_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/benefits.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/court_order_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/deduction.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/deduction_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/deduction_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/deductions.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_order.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_orders.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_rates.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_template.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_leaves.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_tax.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employees.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employment.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/employment_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/invalid_field.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_period.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_periods.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_type.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_type_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/leave_types.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pagination.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_run.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_run_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/pay_runs.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payment_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payment_method.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payment_method_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payslip.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payslip_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/payslips.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/problem.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/reimbursement.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/reimbursements.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/settings.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/tax_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheet.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheet_line.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheet_object.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/timesheets.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/tracking_categories.rb +11 -7
- data/lib/xero-ruby/models/payroll_uk/tracking_category.rb +11 -7
- data/lib/xero-ruby/models/projects/amount.rb +11 -7
- data/lib/xero-ruby/models/projects/error.rb +11 -7
- data/lib/xero-ruby/models/projects/pagination.rb +11 -7
- data/lib/xero-ruby/models/projects/project.rb +11 -7
- data/lib/xero-ruby/models/projects/project_create_or_update.rb +11 -7
- data/lib/xero-ruby/models/projects/project_patch.rb +11 -7
- data/lib/xero-ruby/models/projects/project_user.rb +11 -7
- data/lib/xero-ruby/models/projects/project_users.rb +11 -7
- data/lib/xero-ruby/models/projects/projects.rb +11 -7
- data/lib/xero-ruby/models/projects/task.rb +11 -7
- data/lib/xero-ruby/models/projects/task_create_or_update.rb +11 -7
- data/lib/xero-ruby/models/projects/tasks.rb +11 -7
- data/lib/xero-ruby/models/projects/time_entries.rb +11 -7
- data/lib/xero-ruby/models/projects/time_entry.rb +14 -9
- data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +11 -7
- data/lib/xero-ruby/version.rb +2 -2
- data/spec/api_client_spec.rb +84 -9
- data/spec/helper_methods_spec.rb +28 -0
- metadata +29 -6
@@ -247,7 +247,7 @@ module XeroRuby::Accounting
|
|
247
247
|
value = self.send(attr)
|
248
248
|
next if value.nil?
|
249
249
|
key = downcase ? attr : param
|
250
|
-
hash[key] = _to_hash(value)
|
250
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
251
251
|
end
|
252
252
|
hash
|
253
253
|
end
|
@@ -261,15 +261,17 @@ module XeroRuby::Accounting
|
|
261
261
|
# For object, use to_hash. Otherwise, just return the value
|
262
262
|
# @param [Object] value Any valid value
|
263
263
|
# @return [Hash] Returns the value in the form of hash
|
264
|
-
def _to_hash(value)
|
264
|
+
def _to_hash(value, downcase: false)
|
265
265
|
if value.is_a?(Array)
|
266
|
-
value.
|
266
|
+
value.map do |v|
|
267
|
+
v.to_hash(downcase: downcase)
|
268
|
+
end
|
267
269
|
elsif value.is_a?(Hash)
|
268
270
|
{}.tap do |hash|
|
269
|
-
value.
|
271
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
270
272
|
end
|
271
273
|
elsif value.respond_to? :to_hash
|
272
|
-
value.to_hash
|
274
|
+
value.to_hash(downcase: downcase)
|
273
275
|
else
|
274
276
|
value
|
275
277
|
end
|
@@ -277,8 +279,10 @@ module XeroRuby::Accounting
|
|
277
279
|
|
278
280
|
def parse_date(datestring)
|
279
281
|
if datestring.include?('Date')
|
280
|
-
|
281
|
-
|
282
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
283
|
+
original, date, timezone = *date_pattern.match(datestring)
|
284
|
+
date = (date.to_i / 1000)
|
285
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
282
286
|
else # handle date 'types' for small subset of payroll API's
|
283
287
|
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
284
288
|
end
|
@@ -178,7 +178,7 @@ module XeroRuby::Accounting
|
|
178
178
|
value = self.send(attr)
|
179
179
|
next if value.nil?
|
180
180
|
key = downcase ? attr : param
|
181
|
-
hash[key] = _to_hash(value)
|
181
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
182
182
|
end
|
183
183
|
hash
|
184
184
|
end
|
@@ -192,15 +192,17 @@ module XeroRuby::Accounting
|
|
192
192
|
# For object, use to_hash. Otherwise, just return the value
|
193
193
|
# @param [Object] value Any valid value
|
194
194
|
# @return [Hash] Returns the value in the form of hash
|
195
|
-
def _to_hash(value)
|
195
|
+
def _to_hash(value, downcase: false)
|
196
196
|
if value.is_a?(Array)
|
197
|
-
value.
|
197
|
+
value.map do |v|
|
198
|
+
v.to_hash(downcase: downcase)
|
199
|
+
end
|
198
200
|
elsif value.is_a?(Hash)
|
199
201
|
{}.tap do |hash|
|
200
|
-
value.
|
202
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
201
203
|
end
|
202
204
|
elsif value.respond_to? :to_hash
|
203
|
-
value.to_hash
|
205
|
+
value.to_hash(downcase: downcase)
|
204
206
|
else
|
205
207
|
value
|
206
208
|
end
|
@@ -208,8 +210,10 @@ module XeroRuby::Accounting
|
|
208
210
|
|
209
211
|
def parse_date(datestring)
|
210
212
|
if datestring.include?('Date')
|
211
|
-
|
212
|
-
|
213
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
214
|
+
original, date, timezone = *date_pattern.match(datestring)
|
215
|
+
date = (date.to_i / 1000)
|
216
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
213
217
|
else # handle date 'types' for small subset of payroll API's
|
214
218
|
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
215
219
|
end
|
@@ -186,7 +186,7 @@ module XeroRuby::Accounting
|
|
186
186
|
value = self.send(attr)
|
187
187
|
next if value.nil?
|
188
188
|
key = downcase ? attr : param
|
189
|
-
hash[key] = _to_hash(value)
|
189
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
190
190
|
end
|
191
191
|
hash
|
192
192
|
end
|
@@ -200,15 +200,17 @@ module XeroRuby::Accounting
|
|
200
200
|
# For object, use to_hash. Otherwise, just return the value
|
201
201
|
# @param [Object] value Any valid value
|
202
202
|
# @return [Hash] Returns the value in the form of hash
|
203
|
-
def _to_hash(value)
|
203
|
+
def _to_hash(value, downcase: false)
|
204
204
|
if value.is_a?(Array)
|
205
|
-
value.
|
205
|
+
value.map do |v|
|
206
|
+
v.to_hash(downcase: downcase)
|
207
|
+
end
|
206
208
|
elsif value.is_a?(Hash)
|
207
209
|
{}.tap do |hash|
|
208
|
-
value.
|
210
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
209
211
|
end
|
210
212
|
elsif value.respond_to? :to_hash
|
211
|
-
value.to_hash
|
213
|
+
value.to_hash(downcase: downcase)
|
212
214
|
else
|
213
215
|
value
|
214
216
|
end
|
@@ -216,8 +218,10 @@ module XeroRuby::Accounting
|
|
216
218
|
|
217
219
|
def parse_date(datestring)
|
218
220
|
if datestring.include?('Date')
|
219
|
-
|
220
|
-
|
221
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
222
|
+
original, date, timezone = *date_pattern.match(datestring)
|
223
|
+
date = (date.to_i / 1000)
|
224
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
221
225
|
else # handle date 'types' for small subset of payroll API's
|
222
226
|
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
223
227
|
end
|
@@ -261,7 +261,7 @@ module XeroRuby::Accounting
|
|
261
261
|
value = self.send(attr)
|
262
262
|
next if value.nil?
|
263
263
|
key = downcase ? attr : param
|
264
|
-
hash[key] = _to_hash(value)
|
264
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
265
265
|
end
|
266
266
|
hash
|
267
267
|
end
|
@@ -275,15 +275,17 @@ module XeroRuby::Accounting
|
|
275
275
|
# For object, use to_hash. Otherwise, just return the value
|
276
276
|
# @param [Object] value Any valid value
|
277
277
|
# @return [Hash] Returns the value in the form of hash
|
278
|
-
def _to_hash(value)
|
278
|
+
def _to_hash(value, downcase: false)
|
279
279
|
if value.is_a?(Array)
|
280
|
-
value.
|
280
|
+
value.map do |v|
|
281
|
+
v.to_hash(downcase: downcase)
|
282
|
+
end
|
281
283
|
elsif value.is_a?(Hash)
|
282
284
|
{}.tap do |hash|
|
283
|
-
value.
|
285
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
284
286
|
end
|
285
287
|
elsif value.respond_to? :to_hash
|
286
|
-
value.to_hash
|
288
|
+
value.to_hash(downcase: downcase)
|
287
289
|
else
|
288
290
|
value
|
289
291
|
end
|
@@ -291,8 +293,10 @@ module XeroRuby::Accounting
|
|
291
293
|
|
292
294
|
def parse_date(datestring)
|
293
295
|
if datestring.include?('Date')
|
294
|
-
|
295
|
-
|
296
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
297
|
+
original, date, timezone = *date_pattern.match(datestring)
|
298
|
+
date = (date.to_i / 1000)
|
299
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
296
300
|
else # handle date 'types' for small subset of payroll API's
|
297
301
|
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
298
302
|
end
|
@@ -178,7 +178,7 @@ module XeroRuby::Accounting
|
|
178
178
|
value = self.send(attr)
|
179
179
|
next if value.nil?
|
180
180
|
key = downcase ? attr : param
|
181
|
-
hash[key] = _to_hash(value)
|
181
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
182
182
|
end
|
183
183
|
hash
|
184
184
|
end
|
@@ -192,15 +192,17 @@ module XeroRuby::Accounting
|
|
192
192
|
# For object, use to_hash. Otherwise, just return the value
|
193
193
|
# @param [Object] value Any valid value
|
194
194
|
# @return [Hash] Returns the value in the form of hash
|
195
|
-
def _to_hash(value)
|
195
|
+
def _to_hash(value, downcase: false)
|
196
196
|
if value.is_a?(Array)
|
197
|
-
value.
|
197
|
+
value.map do |v|
|
198
|
+
v.to_hash(downcase: downcase)
|
199
|
+
end
|
198
200
|
elsif value.is_a?(Hash)
|
199
201
|
{}.tap do |hash|
|
200
|
-
value.
|
202
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
201
203
|
end
|
202
204
|
elsif value.respond_to? :to_hash
|
203
|
-
value.to_hash
|
205
|
+
value.to_hash(downcase: downcase)
|
204
206
|
else
|
205
207
|
value
|
206
208
|
end
|
@@ -208,8 +210,10 @@ module XeroRuby::Accounting
|
|
208
210
|
|
209
211
|
def parse_date(datestring)
|
210
212
|
if datestring.include?('Date')
|
211
|
-
|
212
|
-
|
213
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
214
|
+
original, date, timezone = *date_pattern.match(datestring)
|
215
|
+
date = (date.to_i / 1000)
|
216
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
213
217
|
else # handle date 'types' for small subset of payroll API's
|
214
218
|
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
215
219
|
end
|
@@ -0,0 +1,321 @@
|
|
1
|
+
=begin
|
2
|
+
#Xero Accounting API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
Contact: api@xero.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 4.3.1
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'time'
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module XeroRuby::Accounting
|
16
|
+
require 'bigdecimal'
|
17
|
+
|
18
|
+
class Budget
|
19
|
+
# Xero identifier
|
20
|
+
attr_accessor :budget_id
|
21
|
+
|
22
|
+
# Type of Budget. OVERALL or TRACKING
|
23
|
+
attr_accessor :type
|
24
|
+
OVERALL = "OVERALL".freeze
|
25
|
+
TRACKING = "TRACKING".freeze
|
26
|
+
|
27
|
+
# The Budget description
|
28
|
+
attr_accessor :description
|
29
|
+
|
30
|
+
# UTC timestamp of last update to budget
|
31
|
+
attr_accessor :updated_date_utc
|
32
|
+
|
33
|
+
|
34
|
+
attr_accessor :budget_lines
|
35
|
+
|
36
|
+
|
37
|
+
attr_accessor :tracking
|
38
|
+
|
39
|
+
class EnumAttributeValidator
|
40
|
+
attr_reader :datatype
|
41
|
+
attr_reader :allowable_values
|
42
|
+
|
43
|
+
def initialize(datatype, allowable_values)
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
45
|
+
case datatype.to_s
|
46
|
+
when /Integer/i
|
47
|
+
value.to_i
|
48
|
+
when /Float/i
|
49
|
+
value.to_f
|
50
|
+
else
|
51
|
+
value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def valid?(value)
|
57
|
+
!value || allowable_values.include?(value)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
62
|
+
def self.attribute_map
|
63
|
+
{
|
64
|
+
:'budget_id' => :'BudgetID',
|
65
|
+
:'type' => :'Type',
|
66
|
+
:'description' => :'Description',
|
67
|
+
:'updated_date_utc' => :'UpdatedDateUTC',
|
68
|
+
:'budget_lines' => :'BudgetLines',
|
69
|
+
:'tracking' => :'Tracking'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Attribute type mapping.
|
74
|
+
def self.openapi_types
|
75
|
+
{
|
76
|
+
:'budget_id' => :'String',
|
77
|
+
:'type' => :'String',
|
78
|
+
:'description' => :'String',
|
79
|
+
:'updated_date_utc' => :'DateTime',
|
80
|
+
:'budget_lines' => :'BudgetLines',
|
81
|
+
:'tracking' => :'TrackingCategory'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Initializes the object
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
def initialize(attributes = {})
|
88
|
+
if (!attributes.is_a?(Hash))
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Budget` initialize method"
|
90
|
+
end
|
91
|
+
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Budget`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
96
|
+
end
|
97
|
+
h[k.to_sym] = v
|
98
|
+
}
|
99
|
+
|
100
|
+
if attributes.key?(:'budget_id')
|
101
|
+
self.budget_id = attributes[:'budget_id']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'type')
|
105
|
+
self.type = attributes[:'type']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'description')
|
109
|
+
self.description = attributes[:'description']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'updated_date_utc')
|
113
|
+
self.updated_date_utc = attributes[:'updated_date_utc']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'budget_lines')
|
117
|
+
self.budget_lines = attributes[:'budget_lines']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'tracking')
|
121
|
+
self.tracking = attributes[:'tracking']
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
126
|
+
# @return Array for valid properties with the reasons
|
127
|
+
def list_invalid_properties
|
128
|
+
invalid_properties = Array.new
|
129
|
+
if !@description.nil? && @description.to_s.length > 255
|
130
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
|
131
|
+
end
|
132
|
+
|
133
|
+
invalid_properties
|
134
|
+
end
|
135
|
+
|
136
|
+
# Check to see if the all the properties in the model are valid
|
137
|
+
# @return true if the model is valid
|
138
|
+
def valid?
|
139
|
+
type_validator = EnumAttributeValidator.new('String', ["OVERALL", "TRACKING"])
|
140
|
+
return false unless type_validator.valid?(@type)
|
141
|
+
return false if !@description.nil? && @description.to_s.length > 255
|
142
|
+
true
|
143
|
+
end
|
144
|
+
|
145
|
+
# Custom attribute writer method checking allowed values (enum).
|
146
|
+
# @param [Object] type Object to be assigned
|
147
|
+
def type=(type)
|
148
|
+
validator = EnumAttributeValidator.new('String', ["OVERALL", "TRACKING"])
|
149
|
+
unless validator.valid?(type)
|
150
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
151
|
+
end
|
152
|
+
@type = type
|
153
|
+
end
|
154
|
+
|
155
|
+
# Custom attribute writer method with validation
|
156
|
+
# @param [Object] description Value to be assigned
|
157
|
+
def description=(description)
|
158
|
+
if !description.nil? && description.to_s.length > 255
|
159
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
|
160
|
+
end
|
161
|
+
|
162
|
+
@description = description
|
163
|
+
end
|
164
|
+
|
165
|
+
# Checks equality by comparing each attribute.
|
166
|
+
# @param [Object] Object to be compared
|
167
|
+
def ==(o)
|
168
|
+
return true if self.equal?(o)
|
169
|
+
self.class == o.class &&
|
170
|
+
budget_id == o.budget_id &&
|
171
|
+
type == o.type &&
|
172
|
+
description == o.description &&
|
173
|
+
updated_date_utc == o.updated_date_utc &&
|
174
|
+
budget_lines == o.budget_lines &&
|
175
|
+
tracking == o.tracking
|
176
|
+
end
|
177
|
+
|
178
|
+
# @see the `==` method
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def eql?(o)
|
181
|
+
self == o
|
182
|
+
end
|
183
|
+
|
184
|
+
# Calculates hash code according to all attributes.
|
185
|
+
# @return [Integer] Hash code
|
186
|
+
def hash
|
187
|
+
[budget_id, type, description, updated_date_utc, budget_lines, tracking].hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Builds the object from hash
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
+
# @return [Object] Returns the model itself
|
193
|
+
def self.build_from_hash(attributes)
|
194
|
+
new.build_from_hash(attributes)
|
195
|
+
end
|
196
|
+
|
197
|
+
# Builds the object from hash
|
198
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
+
# @return [Object] Returns the model itself
|
200
|
+
def build_from_hash(attributes)
|
201
|
+
return nil unless attributes.is_a?(Hash)
|
202
|
+
self.class.openapi_types.each_pair do |key, type|
|
203
|
+
if type =~ /\AArray<(.*)>/i
|
204
|
+
# check to ensure the input is an array given that the attribute
|
205
|
+
# is documented as an array but the input is not
|
206
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
207
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
208
|
+
end
|
209
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
210
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
211
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
212
|
+
end
|
213
|
+
|
214
|
+
self
|
215
|
+
end
|
216
|
+
|
217
|
+
# Deserializes the data based on type
|
218
|
+
# @param string type Data type
|
219
|
+
# @param string value Value to be deserialized
|
220
|
+
# @return [Object] Deserialized data
|
221
|
+
def _deserialize(type, value)
|
222
|
+
case type.to_sym
|
223
|
+
when :DateTime
|
224
|
+
DateTime.parse(parse_date(value))
|
225
|
+
when :Date
|
226
|
+
Date.parse(parse_date(value))
|
227
|
+
when :String
|
228
|
+
value.to_s
|
229
|
+
when :Integer
|
230
|
+
value.to_i
|
231
|
+
when :Float
|
232
|
+
value.to_f
|
233
|
+
when :BigDecimal
|
234
|
+
BigDecimal(value.to_s)
|
235
|
+
when :Boolean
|
236
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
237
|
+
true
|
238
|
+
else
|
239
|
+
false
|
240
|
+
end
|
241
|
+
when :Object
|
242
|
+
# generic object (usually a Hash), return directly
|
243
|
+
value
|
244
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
245
|
+
inner_type = Regexp.last_match[:inner_type]
|
246
|
+
value.map { |v| _deserialize(inner_type, v) }
|
247
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
248
|
+
k_type = Regexp.last_match[:k_type]
|
249
|
+
v_type = Regexp.last_match[:v_type]
|
250
|
+
{}.tap do |hash|
|
251
|
+
value.each do |k, v|
|
252
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
else # model
|
256
|
+
XeroRuby::Accounting.const_get(type).build_from_hash(value)
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Returns the string representation of the object
|
261
|
+
# @return [String] String presentation of the object
|
262
|
+
def to_s
|
263
|
+
to_hash.to_s
|
264
|
+
end
|
265
|
+
|
266
|
+
# to_body is an alias to to_hash (backward compatibility)
|
267
|
+
# @return [Hash] Returns the object in the form of hash
|
268
|
+
def to_body
|
269
|
+
to_hash
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the object in the form of hash
|
273
|
+
# @return [Hash] Returns the object in the form of hash
|
274
|
+
def to_hash(downcase: false)
|
275
|
+
hash = {}
|
276
|
+
self.class.attribute_map.each_pair do |attr, param|
|
277
|
+
value = self.send(attr)
|
278
|
+
next if value.nil?
|
279
|
+
key = downcase ? attr : param
|
280
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
281
|
+
end
|
282
|
+
hash
|
283
|
+
end
|
284
|
+
|
285
|
+
# Returns the object in the form of hash with snake_case
|
286
|
+
def to_attributes
|
287
|
+
to_hash(downcase: true)
|
288
|
+
end
|
289
|
+
|
290
|
+
# Outputs non-array value in the form of hash
|
291
|
+
# For object, use to_hash. Otherwise, just return the value
|
292
|
+
# @param [Object] value Any valid value
|
293
|
+
# @return [Hash] Returns the value in the form of hash
|
294
|
+
def _to_hash(value, downcase: false)
|
295
|
+
if value.is_a?(Array)
|
296
|
+
value.map do |v|
|
297
|
+
v.to_hash(downcase: downcase)
|
298
|
+
end
|
299
|
+
elsif value.is_a?(Hash)
|
300
|
+
{}.tap do |hash|
|
301
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
302
|
+
end
|
303
|
+
elsif value.respond_to? :to_hash
|
304
|
+
value.to_hash(downcase: downcase)
|
305
|
+
else
|
306
|
+
value
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
def parse_date(datestring)
|
311
|
+
if datestring.include?('Date')
|
312
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
313
|
+
original, date, timezone = *date_pattern.match(datestring)
|
314
|
+
date = (date.to_i / 1000)
|
315
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
316
|
+
else # handle date 'types' for small subset of payroll API's
|
317
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|