From 34cd170e4df9e1621da279bb683ac86b114a494c Mon Sep 17 00:00:00 2001 From: serknight Date: Mon, 26 Oct 2020 16:23:19 -0600 Subject: [PATCH 1/5] files + 3 regional payroll apis --- README.md | 86 +- docs/accounting/AccountingApi.md | 3188 +++++----- docs/accounting/Action.md | 19 + docs/accounting/Actions.md | 17 + docs/assets/AssetApi.md | 72 +- docs/files/Association.md | 23 + docs/files/FileObject.md | 31 + docs/files/FileResponse204.md | 17 + docs/files/Files.md | 23 + docs/files/FilesApi.md | 1116 ++++ docs/files/Folder.md | 25 + docs/files/Folders.md | 17 + docs/files/InlineObject.md | 23 + docs/files/ObjectGroup.md | 16 + docs/files/ObjectType.md | 16 + docs/files/User.md | 29 + docs/payroll_au/APIException.md | 21 + docs/payroll_au/Account.md | 23 + docs/payroll_au/AccountType.md | 16 + docs/payroll_au/AllowanceType.md | 16 + docs/payroll_au/BankAccount.md | 27 + docs/payroll_au/CalendarType.md | 16 + docs/payroll_au/DeductionLine.md | 25 + docs/payroll_au/DeductionType.md | 33 + .../DeductionTypeCalculationType.md | 16 + docs/payroll_au/EarningsLine.md | 33 + docs/payroll_au/EarningsRate.md | 49 + .../payroll_au/EarningsRateCalculationType.md | 16 + docs/payroll_au/EarningsType.md | 16 + docs/payroll_au/Employee.md | 77 + docs/payroll_au/EmployeeStatus.md | 16 + docs/payroll_au/Employees.md | 17 + docs/payroll_au/EmploymentBasis.md | 16 + .../EmploymentTerminationPaymentType.md | 16 + .../EntitlementFinalPayPayoutType.md | 16 + docs/payroll_au/HomeAddress.md | 27 + docs/payroll_au/LeaveAccrualLine.md | 21 + docs/payroll_au/LeaveApplication.md | 35 + docs/payroll_au/LeaveApplications.md | 17 + docs/payroll_au/LeaveBalance.md | 23 + docs/payroll_au/LeaveEarningsLine.md | 21 + docs/payroll_au/LeaveLine.md | 31 + docs/payroll_au/LeaveLineCalculationType.md | 16 + docs/payroll_au/LeaveLines.md | 17 + docs/payroll_au/LeavePeriod.md | 23 + docs/payroll_au/LeavePeriodStatus.md | 16 + docs/payroll_au/LeaveType.md | 33 + docs/payroll_au/LeaveTypeContributionType.md | 16 + docs/payroll_au/ManualTaxType.md | 16 + docs/payroll_au/OpeningBalances.md | 29 + docs/payroll_au/PayItem.md | 23 + docs/payroll_au/PayItems.md | 17 + docs/payroll_au/PayRun.md | 47 + docs/payroll_au/PayRunStatus.md | 16 + docs/payroll_au/PayRuns.md | 17 + docs/payroll_au/PayTemplate.md | 25 + docs/payroll_au/PaymentFrequencyType.md | 16 + docs/payroll_au/PayrollAuApi.md | 2018 ++++++ docs/payroll_au/PayrollCalendar.md | 29 + docs/payroll_au/PayrollCalendars.md | 17 + docs/payroll_au/Payslip.md | 53 + docs/payroll_au/PayslipLines.md | 31 + docs/payroll_au/PayslipObject.md | 17 + docs/payroll_au/PayslipSummary.md | 39 + docs/payroll_au/Payslips.md | 17 + docs/payroll_au/RateType.md | 16 + docs/payroll_au/ReimbursementLine.md | 23 + docs/payroll_au/ReimbursementLines.md | 17 + docs/payroll_au/ReimbursementType.md | 25 + docs/payroll_au/ResidencyStatus.md | 16 + docs/payroll_au/Settings.md | 21 + docs/payroll_au/SettingsObject.md | 17 + docs/payroll_au/SettingsTrackingCategories.md | 19 + ...ettingsTrackingCategoriesEmployeeGroups.md | 19 + ...gsTrackingCategoriesTimesheetCategories.md | 19 + docs/payroll_au/State.md | 16 + docs/payroll_au/SuperFund.md | 41 + docs/payroll_au/SuperFundProduct.md | 23 + docs/payroll_au/SuperFundProducts.md | 17 + docs/payroll_au/SuperFundType.md | 16 + docs/payroll_au/SuperFunds.md | 17 + docs/payroll_au/SuperLine.md | 31 + docs/payroll_au/SuperMembership.md | 21 + .../SuperannuationCalculationType.md | 16 + .../SuperannuationContributionType.md | 16 + docs/payroll_au/SuperannuationLine.md | 33 + docs/payroll_au/TFNExemptionType.md | 16 + docs/payroll_au/TaxDeclaration.md | 47 + docs/payroll_au/TaxLine.md | 27 + docs/payroll_au/Timesheet.md | 33 + docs/payroll_au/TimesheetLine.md | 23 + docs/payroll_au/TimesheetObject.md | 17 + docs/payroll_au/TimesheetStatus.md | 16 + docs/payroll_au/Timesheets.md | 17 + docs/payroll_au/ValidationError.md | 17 + docs/payroll_nz/Account.md | 23 + docs/payroll_nz/Accounts.md | 17 + docs/payroll_nz/Address.md | 27 + docs/payroll_nz/BankAccount.md | 31 + docs/payroll_nz/Benefit.md | 35 + docs/payroll_nz/Deduction.md | 27 + docs/payroll_nz/DeductionLine.md | 25 + docs/payroll_nz/DeductionObject.md | 21 + docs/payroll_nz/Deductions.md | 21 + docs/payroll_nz/EarningsLine.md | 35 + docs/payroll_nz/EarningsOrder.md | 25 + docs/payroll_nz/EarningsOrderObject.md | 21 + docs/payroll_nz/EarningsOrders.md | 21 + docs/payroll_nz/EarningsRate.md | 35 + docs/payroll_nz/EarningsRateObject.md | 21 + docs/payroll_nz/EarningsRates.md | 21 + docs/payroll_nz/EarningsTemplate.md | 27 + docs/payroll_nz/EarningsTemplateObject.md | 21 + docs/payroll_nz/Employee.md | 43 + docs/payroll_nz/EmployeeEarningsTemplates.md | 21 + docs/payroll_nz/EmployeeLeave.md | 29 + docs/payroll_nz/EmployeeLeaveBalance.md | 23 + docs/payroll_nz/EmployeeLeaveBalances.md | 21 + docs/payroll_nz/EmployeeLeaveObject.md | 21 + docs/payroll_nz/EmployeeLeaveSetup.md | 29 + docs/payroll_nz/EmployeeLeaveSetupObject.md | 21 + docs/payroll_nz/EmployeeLeaveType.md | 35 + docs/payroll_nz/EmployeeLeaveTypeObject.md | 21 + docs/payroll_nz/EmployeeLeaveTypes.md | 21 + docs/payroll_nz/EmployeeLeaves.md | 21 + docs/payroll_nz/EmployeeObject.md | 21 + docs/payroll_nz/EmployeeOpeningBalance.md | 23 + .../EmployeeOpeningBalancesObject.md | 21 + docs/payroll_nz/EmployeePayTemplate.md | 19 + docs/payroll_nz/EmployeePayTemplateObject.md | 21 + docs/payroll_nz/EmployeePayTemplates.md | 21 + .../EmployeeStatutoryLeaveBalance.md | 21 + .../EmployeeStatutoryLeaveBalanceObject.md | 21 + .../EmployeeStatutoryLeaveSummary.md | 29 + .../EmployeeStatutoryLeavesSummaries.md | 21 + docs/payroll_nz/EmployeeStatutorySickLeave.md | 47 + .../EmployeeStatutorySickLeaveObject.md | 21 + .../payroll_nz/EmployeeStatutorySickLeaves.md | 21 + docs/payroll_nz/EmployeeTax.md | 47 + docs/payroll_nz/EmployeeTaxObject.md | 21 + docs/payroll_nz/Employees.md | 21 + docs/payroll_nz/Employment.md | 21 + docs/payroll_nz/EmploymentObject.md | 21 + docs/payroll_nz/GrossEarningsHistory.md | 19 + docs/payroll_nz/InvalidField.md | 19 + docs/payroll_nz/LeaveAccrualLine.md | 19 + docs/payroll_nz/LeaveEarningsLine.md | 35 + docs/payroll_nz/LeavePeriod.md | 23 + docs/payroll_nz/LeavePeriods.md | 21 + docs/payroll_nz/LeaveType.md | 27 + docs/payroll_nz/LeaveTypeObject.md | 21 + docs/payroll_nz/LeaveTypes.md | 21 + docs/payroll_nz/Pagination.md | 23 + docs/payroll_nz/PayRun.md | 39 + docs/payroll_nz/PayRunCalendar.md | 29 + docs/payroll_nz/PayRunCalendarObject.md | 21 + docs/payroll_nz/PayRunCalendars.md | 21 + docs/payroll_nz/PayRunObject.md | 21 + docs/payroll_nz/PayRuns.md | 21 + docs/payroll_nz/PaySlip.md | 75 + docs/payroll_nz/PaySlipObject.md | 21 + docs/payroll_nz/PaySlips.md | 21 + docs/payroll_nz/PaymentLine.md | 25 + docs/payroll_nz/PaymentMethod.md | 19 + docs/payroll_nz/PaymentMethodObject.md | 21 + docs/payroll_nz/PayrollNzApi.md | 4544 ++++++++++++++ docs/payroll_nz/Problem.md | 27 + docs/payroll_nz/Reimbursement.md | 33 + docs/payroll_nz/ReimbursementLine.md | 25 + docs/payroll_nz/ReimbursementObject.md | 21 + docs/payroll_nz/Reimbursements.md | 21 + docs/payroll_nz/SalaryAndWage.md | 35 + docs/payroll_nz/SalaryAndWageObject.md | 21 + docs/payroll_nz/SalaryAndWages.md | 21 + docs/payroll_nz/Settings.md | 21 + docs/payroll_nz/StatutoryDeduction.md | 25 + docs/payroll_nz/StatutoryDeductionCategory.md | 16 + docs/payroll_nz/StatutoryDeductionLine.md | 23 + docs/payroll_nz/StatutoryDeductionObject.md | 21 + docs/payroll_nz/StatutoryDeductions.md | 21 + docs/payroll_nz/SuperannuationLine.md | 27 + docs/payroll_nz/SuperannuationObject.md | 21 + docs/payroll_nz/Superannuations.md | 21 + docs/payroll_nz/TaxCode.md | 16 + docs/payroll_nz/TaxLine.md | 25 + docs/payroll_nz/TaxSettings.md | 27 + docs/payroll_nz/Timesheet.md | 33 + docs/payroll_nz/TimesheetEarningsLine.md | 35 + docs/payroll_nz/TimesheetLine.md | 25 + docs/payroll_nz/TimesheetLineObject.md | 21 + docs/payroll_nz/TimesheetObject.md | 21 + docs/payroll_nz/Timesheets.md | 21 + docs/payroll_nz/TrackingCategories.md | 21 + docs/payroll_nz/TrackingCategory.md | 19 + docs/payroll_uk/Account.md | 23 + docs/payroll_uk/Accounts.md | 17 + docs/payroll_uk/Address.md | 25 + docs/payroll_uk/BankAccount.md | 21 + docs/payroll_uk/Benefit.md | 43 + docs/payroll_uk/BenefitLine.md | 25 + docs/payroll_uk/BenefitObject.md | 21 + docs/payroll_uk/Benefits.md | 21 + docs/payroll_uk/CourtOrderLine.md | 19 + docs/payroll_uk/Deduction.md | 47 + docs/payroll_uk/DeductionLine.md | 23 + docs/payroll_uk/DeductionObject.md | 21 + docs/payroll_uk/Deductions.md | 21 + docs/payroll_uk/EarningsLine.md | 33 + docs/payroll_uk/EarningsOrder.md | 25 + docs/payroll_uk/EarningsOrderObject.md | 21 + docs/payroll_uk/EarningsOrders.md | 21 + docs/payroll_uk/EarningsRate.md | 35 + docs/payroll_uk/EarningsRateObject.md | 21 + docs/payroll_uk/EarningsRates.md | 21 + docs/payroll_uk/EarningsTemplate.md | 27 + docs/payroll_uk/EarningsTemplateObject.md | 21 + docs/payroll_uk/Employee.md | 45 + docs/payroll_uk/EmployeeLeave.md | 29 + docs/payroll_uk/EmployeeLeaveBalance.md | 23 + docs/payroll_uk/EmployeeLeaveBalances.md | 21 + docs/payroll_uk/EmployeeLeaveObject.md | 21 + docs/payroll_uk/EmployeeLeaveType.md | 27 + docs/payroll_uk/EmployeeLeaveTypeObject.md | 21 + docs/payroll_uk/EmployeeLeaveTypes.md | 21 + docs/payroll_uk/EmployeeLeaves.md | 21 + docs/payroll_uk/EmployeeObject.md | 21 + docs/payroll_uk/EmployeeOpeningBalances.md | 27 + .../EmployeeOpeningBalancesObject.md | 21 + docs/payroll_uk/EmployeePayTemplate.md | 19 + docs/payroll_uk/EmployeePayTemplateObject.md | 21 + docs/payroll_uk/EmployeePayTemplates.md | 21 + .../EmployeeStatutoryLeaveBalance.md | 21 + .../EmployeeStatutoryLeaveBalanceObject.md | 21 + .../EmployeeStatutoryLeaveSummary.md | 29 + .../EmployeeStatutoryLeavesSummaries.md | 21 + docs/payroll_uk/EmployeeStatutorySickLeave.md | 47 + .../EmployeeStatutorySickLeaveObject.md | 21 + .../payroll_uk/EmployeeStatutorySickLeaves.md | 21 + docs/payroll_uk/EmployeeTax.md | 37 + docs/payroll_uk/EmployeeTaxObject.md | 21 + docs/payroll_uk/Employees.md | 21 + docs/payroll_uk/Employment.md | 23 + docs/payroll_uk/EmploymentObject.md | 21 + docs/payroll_uk/InvalidField.md | 19 + docs/payroll_uk/LeaveAccrualLine.md | 19 + docs/payroll_uk/LeaveEarningsLine.md | 27 + docs/payroll_uk/LeavePeriod.md | 23 + docs/payroll_uk/LeavePeriods.md | 21 + docs/payroll_uk/LeaveType.md | 31 + docs/payroll_uk/LeaveTypeObject.md | 21 + docs/payroll_uk/LeaveTypes.md | 21 + docs/payroll_uk/Pagination.md | 23 + docs/payroll_uk/PayRun.md | 39 + docs/payroll_uk/PayRunCalendar.md | 29 + docs/payroll_uk/PayRunCalendarObject.md | 21 + docs/payroll_uk/PayRunCalendars.md | 21 + docs/payroll_uk/PayRunObject.md | 21 + docs/payroll_uk/PayRuns.md | 21 + docs/payroll_uk/PaymentLine.md | 25 + docs/payroll_uk/PaymentMethod.md | 19 + docs/payroll_uk/PaymentMethodObject.md | 21 + docs/payroll_uk/PayrollUkApi.md | 4683 ++++++++++++++ docs/payroll_uk/Payslip.md | 69 + docs/payroll_uk/PayslipObject.md | 21 + docs/payroll_uk/Payslips.md | 21 + docs/payroll_uk/Problem.md | 27 + docs/payroll_uk/Reimbursement.md | 23 + docs/payroll_uk/ReimbursementLine.md | 21 + docs/payroll_uk/ReimbursementObject.md | 21 + docs/payroll_uk/Reimbursements.md | 21 + docs/payroll_uk/SalaryAndWage.md | 33 + docs/payroll_uk/SalaryAndWageObject.md | 21 + docs/payroll_uk/SalaryAndWages.md | 21 + docs/payroll_uk/Settings.md | 21 + docs/payroll_uk/StatutoryDeduction.md | 25 + docs/payroll_uk/StatutoryDeductionCategory.md | 16 + docs/payroll_uk/TaxLine.md | 27 + docs/payroll_uk/Timesheet.md | 33 + docs/payroll_uk/TimesheetEarningsLine.md | 27 + docs/payroll_uk/TimesheetLine.md | 25 + docs/payroll_uk/TimesheetLineObject.md | 21 + docs/payroll_uk/TimesheetObject.md | 21 + docs/payroll_uk/Timesheets.md | 21 + docs/payroll_uk/TrackingCategories.md | 21 + docs/payroll_uk/TrackingCategory.md | 19 + docs/projects/ProjectApi.md | 156 +- lib/xero-ruby.rb | 284 +- lib/xero-ruby/api/accounting_api.rb | 788 ++- lib/xero-ruby/api/asset_api.rb | 2 +- lib/xero-ruby/api/files_api.rb | 1273 ++++ lib/xero-ruby/api/payroll_au_api.rb | 2256 +++++++ lib/xero-ruby/api/payroll_nz_api.rb | 5263 ++++++++++++++++ lib/xero-ruby/api/payroll_uk_api.rb | 5406 +++++++++++++++++ lib/xero-ruby/api/project_api.rb | 2 +- lib/xero-ruby/api_client.rb | 27 +- lib/xero-ruby/api_error.rb | 2 +- lib/xero-ruby/configuration.rb | 8 +- lib/xero-ruby/models/accounting/account.rb | 4 +- .../models/accounting/account_type.rb | 2 +- lib/xero-ruby/models/accounting/accounts.rb | 2 +- .../models/accounting/accounts_payable.rb | 2 +- .../models/accounting/accounts_receivable.rb | 2 +- lib/xero-ruby/models/accounting/action.rb | 254 + lib/xero-ruby/models/accounting/actions.rb | 210 + lib/xero-ruby/models/accounting/address.rb | 2 +- lib/xero-ruby/models/accounting/allocation.rb | 2 +- .../models/accounting/allocations.rb | 2 +- lib/xero-ruby/models/accounting/attachment.rb | 2 +- .../models/accounting/attachments.rb | 2 +- lib/xero-ruby/models/accounting/balances.rb | 2 +- .../models/accounting/bank_transaction.rb | 2 +- .../models/accounting/bank_transactions.rb | 2 +- .../models/accounting/bank_transfer.rb | 2 +- .../models/accounting/bank_transfers.rb | 2 +- .../models/accounting/batch_payment.rb | 2 +- .../accounting/batch_payment_details.rb | 17 +- .../models/accounting/batch_payments.rb | 2 +- lib/xero-ruby/models/accounting/bill.rb | 2 +- .../models/accounting/branding_theme.rb | 2 +- .../models/accounting/branding_themes.rb | 2 +- .../models/accounting/cis_org_setting.rb | 2 +- .../models/accounting/cis_setting.rb | 2 +- .../models/accounting/cis_settings.rb | 2 +- lib/xero-ruby/models/accounting/contact.rb | 2 +- .../models/accounting/contact_group.rb | 2 +- .../models/accounting/contact_groups.rb | 2 +- .../models/accounting/contact_person.rb | 2 +- lib/xero-ruby/models/accounting/contacts.rb | 2 +- .../models/accounting/country_code.rb | 2 +- .../models/accounting/credit_note.rb | 2 +- .../models/accounting/credit_notes.rb | 2 +- lib/xero-ruby/models/accounting/currencies.rb | 2 +- lib/xero-ruby/models/accounting/currency.rb | 2 +- .../models/accounting/currency_code.rb | 6 +- lib/xero-ruby/models/accounting/element.rb | 2 +- lib/xero-ruby/models/accounting/employee.rb | 2 +- lib/xero-ruby/models/accounting/employees.rb | 2 +- lib/xero-ruby/models/accounting/error.rb | 2 +- .../models/accounting/expense_claim.rb | 2 +- .../models/accounting/expense_claims.rb | 2 +- .../models/accounting/external_link.rb | 2 +- .../models/accounting/history_record.rb | 2 +- .../models/accounting/history_records.rb | 2 +- lib/xero-ruby/models/accounting/invoice.rb | 2 +- .../models/accounting/invoice_reminder.rb | 2 +- .../models/accounting/invoice_reminders.rb | 2 +- lib/xero-ruby/models/accounting/invoices.rb | 2 +- lib/xero-ruby/models/accounting/item.rb | 2 +- lib/xero-ruby/models/accounting/items.rb | 2 +- lib/xero-ruby/models/accounting/journal.rb | 2 +- .../models/accounting/journal_line.rb | 2 +- lib/xero-ruby/models/accounting/journals.rb | 2 +- .../models/accounting/line_amount_types.rb | 2 +- lib/xero-ruby/models/accounting/line_item.rb | 2 +- .../models/accounting/line_item_tracking.rb | 2 +- .../models/accounting/linked_transaction.rb | 2 +- .../models/accounting/linked_transactions.rb | 2 +- .../models/accounting/manual_journal.rb | 2 +- .../models/accounting/manual_journal_line.rb | 2 +- .../models/accounting/manual_journals.rb | 2 +- .../models/accounting/online_invoice.rb | 2 +- .../models/accounting/online_invoices.rb | 2 +- .../models/accounting/organisation.rb | 28 +- .../models/accounting/organisations.rb | 2 +- .../models/accounting/overpayment.rb | 2 +- .../models/accounting/overpayments.rb | 2 +- lib/xero-ruby/models/accounting/payment.rb | 2 +- .../models/accounting/payment_delete.rb | 2 +- .../models/accounting/payment_service.rb | 2 +- .../models/accounting/payment_services.rb | 2 +- .../models/accounting/payment_term.rb | 2 +- .../models/accounting/payment_term_type.rb | 2 +- lib/xero-ruby/models/accounting/payments.rb | 2 +- lib/xero-ruby/models/accounting/phone.rb | 2 +- lib/xero-ruby/models/accounting/prepayment.rb | 2 +- .../models/accounting/prepayments.rb | 2 +- lib/xero-ruby/models/accounting/purchase.rb | 2 +- .../models/accounting/purchase_order.rb | 2 +- .../models/accounting/purchase_orders.rb | 2 +- lib/xero-ruby/models/accounting/quote.rb | 2 +- .../accounting/quote_line_amount_types.rb | 2 +- .../models/accounting/quote_status_codes.rb | 2 +- lib/xero-ruby/models/accounting/quotes.rb | 2 +- lib/xero-ruby/models/accounting/receipt.rb | 2 +- lib/xero-ruby/models/accounting/receipts.rb | 2 +- .../models/accounting/repeating_invoice.rb | 2 +- .../models/accounting/repeating_invoices.rb | 2 +- lib/xero-ruby/models/accounting/report.rb | 2 +- .../models/accounting/report_attribute.rb | 2 +- .../models/accounting/report_cell.rb | 2 +- .../models/accounting/report_fields.rb | 2 +- lib/xero-ruby/models/accounting/report_row.rb | 2 +- .../models/accounting/report_rows.rb | 2 +- .../models/accounting/report_with_row.rb | 2 +- .../models/accounting/report_with_rows.rb | 2 +- lib/xero-ruby/models/accounting/reports.rb | 2 +- .../models/accounting/request_empty.rb | 2 +- lib/xero-ruby/models/accounting/row_type.rb | 2 +- .../accounting/sales_tracking_category.rb | 2 +- lib/xero-ruby/models/accounting/schedule.rb | 2 +- .../models/accounting/tax_component.rb | 2 +- lib/xero-ruby/models/accounting/tax_rate.rb | 2 +- lib/xero-ruby/models/accounting/tax_rates.rb | 2 +- lib/xero-ruby/models/accounting/tax_type.rb | 2 +- .../accounting/ten_ninety_nine_contact.rb | 2 +- lib/xero-ruby/models/accounting/time_zone.rb | 2 +- .../models/accounting/tracking_categories.rb | 2 +- .../models/accounting/tracking_category.rb | 2 +- .../models/accounting/tracking_option.rb | 2 +- .../models/accounting/tracking_options.rb | 2 +- lib/xero-ruby/models/accounting/user.rb | 2 +- lib/xero-ruby/models/accounting/users.rb | 2 +- .../models/accounting/validation_error.rb | 2 +- lib/xero-ruby/models/assets/asset.rb | 2 +- lib/xero-ruby/models/assets/asset_status.rb | 2 +- .../models/assets/asset_status_query_param.rb | 2 +- lib/xero-ruby/models/assets/asset_type.rb | 2 +- lib/xero-ruby/models/assets/assets.rb | 2 +- .../models/assets/book_depreciation_detail.rb | 2 +- .../assets/book_depreciation_setting.rb | 2 +- lib/xero-ruby/models/assets/error.rb | 2 +- .../assets/field_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/pagination.rb | 2 +- .../resource_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/setting.rb | 2 +- lib/xero-ruby/models/files/association.rb | 238 + lib/xero-ruby/models/files/file_object.rb | 278 + .../models/files/file_response204.rb | 208 + lib/xero-ruby/models/files/files.rb | 240 + lib/xero-ruby/models/files/folder.rb | 248 + lib/xero-ruby/models/files/folders.rb | 210 + lib/xero-ruby/models/files/inline_object.rb | 238 + lib/xero-ruby/models/files/object_group.rb | 46 + lib/xero-ruby/models/files/object_type.rb | 68 + lib/xero-ruby/models/files/user.rb | 318 + lib/xero-ruby/models/payroll_au/account.rb | 238 + .../models/payroll_au/account_type.rb | 58 + .../models/payroll_au/allowance_type.rb | 42 + .../models/payroll_au/api_exception.rb | 229 + .../models/payroll_au/bank_account.rb | 258 + .../models/payroll_au/calendar_type.rb | 41 + .../models/payroll_au/deduction_line.rb | 258 + .../models/payroll_au/deduction_type.rb | 340 ++ .../deduction_type_calculation_type.rb | 38 + .../models/payroll_au/earnings_line.rb | 293 + .../models/payroll_au/earnings_rate.rb | 398 ++ .../earnings_rate_calculation_type.rb | 38 + .../models/payroll_au/earnings_type.rb | 44 + lib/xero-ruby/models/payroll_au/employee.rb | 571 ++ .../models/payroll_au/employee_status.rb | 37 + lib/xero-ruby/models/payroll_au/employees.rb | 210 + .../models/payroll_au/employment_basis.rb | 40 + .../employment_termination_payment_type.rb | 37 + .../entitlement_final_pay_payout_type.rb | 37 + .../models/payroll_au/home_address.rb | 263 + .../models/payroll_au/leave_accrual_line.rb | 228 + .../models/payroll_au/leave_application.rb | 302 + .../models/payroll_au/leave_applications.rb | 210 + .../models/payroll_au/leave_balance.rb | 238 + .../models/payroll_au/leave_earnings_line.rb | 228 + lib/xero-ruby/models/payroll_au/leave_line.rb | 278 + .../payroll_au/leave_line_calculation_type.rb | 40 + .../models/payroll_au/leave_lines.rb | 211 + .../models/payroll_au/leave_period.rb | 238 + .../models/payroll_au/leave_period_status.rb | 37 + lib/xero-ruby/models/payroll_au/leave_type.rb | 303 + .../leave_type_contribution_type.rb | 39 + .../models/payroll_au/manual_tax_type.rb | 40 + .../models/payroll_au/opening_balances.rb | 278 + lib/xero-ruby/models/payroll_au/pay_item.rb | 246 + lib/xero-ruby/models/payroll_au/pay_items.rb | 208 + lib/xero-ruby/models/payroll_au/pay_run.rb | 367 ++ .../models/payroll_au/pay_run_status.rb | 37 + lib/xero-ruby/models/payroll_au/pay_runs.rb | 210 + .../models/payroll_au/pay_template.rb | 258 + .../payroll_au/payment_frequency_type.rb | 42 + .../models/payroll_au/payroll_calendar.rb | 270 + .../models/payroll_au/payroll_calendars.rb | 210 + lib/xero-ruby/models/payroll_au/payslip.rb | 404 ++ .../models/payroll_au/payslip_lines.rb | 294 + .../models/payroll_au/payslip_object.rb | 208 + .../models/payroll_au/payslip_summary.rb | 318 + lib/xero-ruby/models/payroll_au/payslips.rb | 210 + lib/xero-ruby/models/payroll_au/rate_type.rb | 38 + .../models/payroll_au/reimbursement_line.rb | 253 + .../models/payroll_au/reimbursement_lines.rb | 211 + .../models/payroll_au/reimbursement_type.rb | 263 + .../models/payroll_au/residency_status.rb | 38 + lib/xero-ruby/models/payroll_au/settings.rb | 230 + .../models/payroll_au/settings_object.rb | 208 + .../settings_tracking_categories.rb | 219 + ...ngs_tracking_categories_employee_groups.rb | 219 + ...racking_categories_timesheet_categories.rb | 219 + lib/xero-ruby/models/payroll_au/state.rb | 43 + lib/xero-ruby/models/payroll_au/super_fund.rb | 335 + .../models/payroll_au/super_fund_product.rb | 238 + .../models/payroll_au/super_fund_products.rb | 210 + .../models/payroll_au/super_fund_type.rb | 37 + .../models/payroll_au/super_funds.rb | 210 + lib/xero-ruby/models/payroll_au/super_line.rb | 278 + .../models/payroll_au/super_membership.rb | 238 + .../superannuation_calculation_type.rb | 38 + .../superannuation_contribution_type.rb | 39 + .../models/payroll_au/superannuation_line.rb | 288 + .../models/payroll_au/tax_declaration.rb | 358 ++ lib/xero-ruby/models/payroll_au/tax_line.rb | 258 + .../models/payroll_au/tfn_exemption_type.rb | 39 + lib/xero-ruby/models/payroll_au/timesheet.rb | 307 + .../models/payroll_au/timesheet_line.rb | 240 + .../models/payroll_au/timesheet_object.rb | 208 + .../models/payroll_au/timesheet_status.rb | 40 + lib/xero-ruby/models/payroll_au/timesheets.rb | 210 + .../models/payroll_au/validation_error.rb | 208 + lib/xero-ruby/models/payroll_nz/account.rb | 276 + lib/xero-ruby/models/payroll_nz/accounts.rb | 210 + lib/xero-ruby/models/payroll_nz/address.rb | 273 + .../models/payroll_nz/bank_account.rb | 329 + lib/xero-ruby/models/payroll_nz/benefit.rb | 369 ++ lib/xero-ruby/models/payroll_nz/deduction.rb | 311 + .../models/payroll_nz/deduction_line.rb | 248 + .../models/payroll_nz/deduction_object.rb | 228 + lib/xero-ruby/models/payroll_nz/deductions.rb | 230 + .../models/payroll_nz/earnings_line.rb | 298 + .../models/payroll_nz/earnings_order.rb | 255 + .../payroll_nz/earnings_order_object.rb | 228 + .../models/payroll_nz/earnings_orders.rb | 230 + .../models/payroll_nz/earnings_rate.rb | 382 ++ .../models/payroll_nz/earnings_rate_object.rb | 228 + .../models/payroll_nz/earnings_rates.rb | 230 + .../models/payroll_nz/earnings_template.rb | 258 + .../payroll_nz/earnings_template_object.rb | 228 + lib/xero-ruby/models/payroll_nz/employee.rb | 374 ++ .../payroll_nz/employee_earnings_templates.rb | 230 + .../models/payroll_nz/employee_leave.rb | 290 + .../payroll_nz/employee_leave_balance.rb | 238 + .../payroll_nz/employee_leave_balances.rb | 230 + .../payroll_nz/employee_leave_object.rb | 228 + .../models/payroll_nz/employee_leave_setup.rb | 268 + .../payroll_nz/employee_leave_setup_object.rb | 228 + .../models/payroll_nz/employee_leave_type.rb | 336 + .../payroll_nz/employee_leave_type_object.rb | 228 + .../models/payroll_nz/employee_leave_types.rb | 230 + .../models/payroll_nz/employee_leaves.rb | 230 + .../models/payroll_nz/employee_object.rb | 228 + .../payroll_nz/employee_opening_balance.rb | 238 + .../employee_opening_balances_object.rb | 230 + .../payroll_nz/employee_pay_template.rb | 220 + .../employee_pay_template_object.rb | 228 + .../payroll_nz/employee_pay_templates.rb | 228 + .../employee_statutory_leave_balance.rb | 280 + ...employee_statutory_leave_balance_object.rb | 228 + .../employee_statutory_leave_summary.rb | 322 + .../employee_statutory_leaves_summaries.rb | 230 + .../employee_statutory_sick_leave.rb | 419 ++ .../employee_statutory_sick_leave_object.rb | 228 + .../employee_statutory_sick_leaves.rb | 230 + .../models/payroll_nz/employee_tax.rb | 397 ++ .../models/payroll_nz/employee_tax_object.rb | 228 + lib/xero-ruby/models/payroll_nz/employees.rb | 230 + lib/xero-ruby/models/payroll_nz/employment.rb | 228 + .../models/payroll_nz/employment_object.rb | 228 + .../payroll_nz/gross_earnings_history.rb | 218 + .../models/payroll_nz/invalid_field.rb | 218 + .../models/payroll_nz/leave_accrual_line.rb | 218 + .../models/payroll_nz/leave_earnings_line.rb | 298 + .../models/payroll_nz/leave_period.rb | 274 + .../models/payroll_nz/leave_periods.rb | 230 + lib/xero-ruby/models/payroll_nz/leave_type.rb | 273 + .../models/payroll_nz/leave_type_object.rb | 228 + .../models/payroll_nz/leave_types.rb | 230 + lib/xero-ruby/models/payroll_nz/pagination.rb | 238 + lib/xero-ruby/models/payroll_nz/pay_run.rb | 389 ++ .../models/payroll_nz/pay_run_calendar.rb | 328 + .../payroll_nz/pay_run_calendar_object.rb | 228 + .../models/payroll_nz/pay_run_calendars.rb | 230 + .../models/payroll_nz/pay_run_object.rb | 228 + lib/xero-ruby/models/payroll_nz/pay_runs.rb | 230 + lib/xero-ruby/models/payroll_nz/pay_slip.rb | 557 ++ .../models/payroll_nz/pay_slip_object.rb | 228 + lib/xero-ruby/models/payroll_nz/pay_slips.rb | 230 + .../models/payroll_nz/payment_line.rb | 248 + .../models/payroll_nz/payment_method.rb | 262 + .../payroll_nz/payment_method_object.rb | 228 + lib/xero-ruby/models/payroll_nz/problem.rb | 261 + .../models/payroll_nz/reimbursement.rb | 364 ++ .../models/payroll_nz/reimbursement_line.rb | 248 + .../models/payroll_nz/reimbursement_object.rb | 228 + .../models/payroll_nz/reimbursements.rb | 230 + .../models/payroll_nz/salary_and_wage.rb | 388 ++ .../payroll_nz/salary_and_wage_object.rb | 228 + .../models/payroll_nz/salary_and_wages.rb | 230 + lib/xero-ruby/models/payroll_nz/settings.rb | 228 + .../models/payroll_nz/statutory_deduction.rb | 248 + .../statutory_deduction_category.rb | 46 + .../payroll_nz/statutory_deduction_line.rb | 238 + .../payroll_nz/statutory_deduction_object.rb | 228 + .../models/payroll_nz/statutory_deductions.rb | 230 + .../models/payroll_nz/superannuation_line.rb | 258 + .../payroll_nz/superannuation_object.rb | 228 + .../models/payroll_nz/superannuations.rb | 230 + lib/xero-ruby/models/payroll_nz/tax_code.rb | 54 + lib/xero-ruby/models/payroll_nz/tax_line.rb | 248 + .../models/payroll_nz/tax_settings.rb | 294 + lib/xero-ruby/models/payroll_nz/timesheet.rb | 347 ++ .../payroll_nz/timesheet_earnings_line.rb | 298 + .../models/payroll_nz/timesheet_line.rb | 263 + .../payroll_nz/timesheet_line_object.rb | 228 + .../models/payroll_nz/timesheet_object.rb | 228 + lib/xero-ruby/models/payroll_nz/timesheets.rb | 230 + .../models/payroll_nz/tracking_categories.rb | 228 + .../models/payroll_nz/tracking_category.rb | 218 + lib/xero-ruby/models/payroll_uk/account.rb | 279 + lib/xero-ruby/models/payroll_uk/accounts.rb | 210 + lib/xero-ruby/models/payroll_uk/address.rb | 263 + .../models/payroll_uk/bank_account.rb | 243 + lib/xero-ruby/models/payroll_uk/benefit.rb | 418 ++ .../models/payroll_uk/benefit_line.rb | 248 + .../models/payroll_uk/benefit_object.rb | 228 + lib/xero-ruby/models/payroll_uk/benefits.rb | 230 + .../models/payroll_uk/court_order_line.rb | 218 + lib/xero-ruby/models/payroll_uk/deduction.rb | 426 ++ .../models/payroll_uk/deduction_line.rb | 238 + .../models/payroll_uk/deduction_object.rb | 228 + lib/xero-ruby/models/payroll_uk/deductions.rb | 230 + .../models/payroll_uk/earnings_line.rb | 288 + .../models/payroll_uk/earnings_order.rb | 255 + .../payroll_uk/earnings_order_object.rb | 228 + .../models/payroll_uk/earnings_orders.rb | 230 + .../models/payroll_uk/earnings_rate.rb | 387 ++ .../models/payroll_uk/earnings_rate_object.rb | 228 + .../models/payroll_uk/earnings_rates.rb | 230 + .../models/payroll_uk/earnings_template.rb | 258 + .../payroll_uk/earnings_template_object.rb | 228 + lib/xero-ruby/models/payroll_uk/employee.rb | 384 ++ .../models/payroll_uk/employee_leave.rb | 290 + .../payroll_uk/employee_leave_balance.rb | 238 + .../payroll_uk/employee_leave_balances.rb | 230 + .../payroll_uk/employee_leave_object.rb | 228 + .../models/payroll_uk/employee_leave_type.rb | 306 + .../payroll_uk/employee_leave_type_object.rb | 228 + .../models/payroll_uk/employee_leave_types.rb | 230 + .../models/payroll_uk/employee_leaves.rb | 230 + .../models/payroll_uk/employee_object.rb | 228 + .../payroll_uk/employee_opening_balances.rb | 258 + .../employee_opening_balances_object.rb | 228 + .../payroll_uk/employee_pay_template.rb | 220 + .../employee_pay_template_object.rb | 228 + .../payroll_uk/employee_pay_templates.rb | 230 + .../employee_statutory_leave_balance.rb | 280 + ...employee_statutory_leave_balance_object.rb | 228 + .../employee_statutory_leave_summary.rb | 322 + .../employee_statutory_leaves_summaries.rb | 230 + .../employee_statutory_sick_leave.rb | 419 ++ .../employee_statutory_sick_leave_object.rb | 228 + .../employee_statutory_sick_leaves.rb | 230 + .../models/payroll_uk/employee_tax.rb | 308 + .../models/payroll_uk/employee_tax_object.rb | 228 + lib/xero-ruby/models/payroll_uk/employees.rb | 230 + lib/xero-ruby/models/payroll_uk/employment.rb | 280 + .../models/payroll_uk/employment_object.rb | 228 + .../models/payroll_uk/invalid_field.rb | 218 + .../models/payroll_uk/leave_accrual_line.rb | 218 + .../models/payroll_uk/leave_earnings_line.rb | 258 + .../models/payroll_uk/leave_period.rb | 274 + .../models/payroll_uk/leave_periods.rb | 230 + lib/xero-ruby/models/payroll_uk/leave_type.rb | 293 + .../models/payroll_uk/leave_type_object.rb | 228 + .../models/payroll_uk/leave_types.rb | 230 + lib/xero-ruby/models/payroll_uk/pagination.rb | 238 + lib/xero-ruby/models/payroll_uk/pay_run.rb | 389 ++ .../models/payroll_uk/pay_run_calendar.rb | 328 + .../payroll_uk/pay_run_calendar_object.rb | 228 + .../models/payroll_uk/pay_run_calendars.rb | 230 + .../models/payroll_uk/pay_run_object.rb | 228 + lib/xero-ruby/models/payroll_uk/pay_runs.rb | 230 + .../models/payroll_uk/payment_line.rb | 248 + .../models/payroll_uk/payment_method.rb | 262 + .../payroll_uk/payment_method_object.rb | 228 + lib/xero-ruby/models/payroll_uk/payslip.rb | 525 ++ .../models/payroll_uk/payslip_object.rb | 228 + lib/xero-ruby/models/payroll_uk/payslips.rb | 230 + lib/xero-ruby/models/payroll_uk/problem.rb | 261 + .../models/payroll_uk/reimbursement.rb | 248 + .../models/payroll_uk/reimbursement_line.rb | 228 + .../models/payroll_uk/reimbursement_object.rb | 228 + .../models/payroll_uk/reimbursements.rb | 230 + .../models/payroll_uk/salary_and_wage.rb | 368 ++ .../payroll_uk/salary_and_wage_object.rb | 228 + .../models/payroll_uk/salary_and_wages.rb | 230 + lib/xero-ruby/models/payroll_uk/settings.rb | 228 + .../models/payroll_uk/statutory_deduction.rb | 248 + .../statutory_deduction_category.rb | 49 + lib/xero-ruby/models/payroll_uk/tax_line.rb | 258 + lib/xero-ruby/models/payroll_uk/timesheet.rb | 347 ++ .../payroll_uk/timesheet_earnings_line.rb | 258 + .../models/payroll_uk/timesheet_line.rb | 263 + .../payroll_uk/timesheet_line_object.rb | 228 + .../models/payroll_uk/timesheet_object.rb | 228 + lib/xero-ruby/models/payroll_uk/timesheets.rb | 230 + .../models/payroll_uk/tracking_categories.rb | 228 + .../models/payroll_uk/tracking_category.rb | 218 + lib/xero-ruby/models/projects/amount.rb | 2 +- lib/xero-ruby/models/projects/charge_type.rb | 2 +- .../models/projects/currency_code.rb | 2 +- lib/xero-ruby/models/projects/error.rb | 2 +- lib/xero-ruby/models/projects/pagination.rb | 2 +- lib/xero-ruby/models/projects/project.rb | 2 +- .../projects/project_create_or_update.rb | 2 +- .../models/projects/project_patch.rb | 2 +- .../models/projects/project_status.rb | 2 +- lib/xero-ruby/models/projects/project_user.rb | 2 +- .../models/projects/project_users.rb | 2 +- lib/xero-ruby/models/projects/projects.rb | 2 +- lib/xero-ruby/models/projects/task.rb | 2 +- .../models/projects/task_create_or_update.rb | 2 +- lib/xero-ruby/models/projects/tasks.rb | 2 +- lib/xero-ruby/models/projects/time_entries.rb | 2 +- lib/xero-ruby/models/projects/time_entry.rb | 2 +- .../projects/time_entry_create_or_update.rb | 2 +- lib/xero-ruby/version.rb | 4 +- spec/files/api/files_api_spec.rb | 249 + spec/files/models/association_spec.rb | 59 + spec/files/models/file_object_spec.rb | 83 + spec/files/models/file_response204_spec.rb | 41 + spec/files/models/files_spec.rb | 59 + spec/files/models/folder_spec.rb | 65 + spec/files/models/folders_spec.rb | 41 + spec/files/models/inline_object_spec.rb | 59 + spec/files/models/object_group_spec.rb | 35 + spec/files/models/object_type_spec.rb | 35 + spec/files/models/user_spec.rb | 81 + spec/payroll_au/api/payroll_au_api_spec.rb | 415 ++ spec/payroll_au/models/account_spec.rb | 59 + spec/payroll_au/models/account_type_spec.rb | 35 + spec/payroll_au/models/allowance_type_spec.rb | 35 + spec/payroll_au/models/api_exception_spec.rb | 53 + spec/payroll_au/models/bank_account_spec.rb | 71 + spec/payroll_au/models/calendar_type_spec.rb | 35 + spec/payroll_au/models/deduction_line_spec.rb | 65 + .../deduction_type_calculation_type_spec.rb | 35 + spec/payroll_au/models/deduction_type_spec.rb | 93 + spec/payroll_au/models/earnings_line_spec.rb | 89 + .../earnings_rate_calculation_type_spec.rb | 35 + spec/payroll_au/models/earnings_rate_spec.rb | 137 + spec/payroll_au/models/earnings_type_spec.rb | 35 + spec/payroll_au/models/employee_spec.rb | 225 + .../payroll_au/models/employee_status_spec.rb | 35 + spec/payroll_au/models/employees_spec.rb | 41 + .../models/employment_basis_spec.rb | 35 + ...mployment_termination_payment_type_spec.rb | 35 + .../entitlement_final_pay_payout_type_spec.rb | 35 + spec/payroll_au/models/home_address_spec.rb | 71 + .../models/leave_accrual_line_spec.rb | 53 + .../models/leave_application_spec.rb | 95 + .../models/leave_applications_spec.rb | 41 + spec/payroll_au/models/leave_balance_spec.rb | 59 + .../models/leave_earnings_line_spec.rb | 53 + .../leave_line_calculation_type_spec.rb | 35 + spec/payroll_au/models/leave_line_spec.rb | 83 + spec/payroll_au/models/leave_lines_spec.rb | 41 + spec/payroll_au/models/leave_period_spec.rb | 59 + .../models/leave_period_status_spec.rb | 35 + .../leave_type_contribution_type_spec.rb | 35 + spec/payroll_au/models/leave_type_spec.rb | 89 + .../payroll_au/models/manual_tax_type_spec.rb | 35 + .../models/opening_balances_spec.rb | 77 + spec/payroll_au/models/pay_item_spec.rb | 59 + spec/payroll_au/models/pay_items_spec.rb | 41 + spec/payroll_au/models/pay_run_spec.rb | 131 + spec/payroll_au/models/pay_run_status_spec.rb | 35 + spec/payroll_au/models/pay_runs_spec.rb | 41 + spec/payroll_au/models/pay_template_spec.rb | 65 + .../models/payment_frequency_type_spec.rb | 35 + .../models/payroll_calendar_spec.rb | 77 + .../models/payroll_calendars_spec.rb | 41 + spec/payroll_au/models/payslip_lines_spec.rb | 83 + spec/payroll_au/models/payslip_object_spec.rb | 41 + spec/payroll_au/models/payslip_spec.rb | 149 + .../payroll_au/models/payslip_summary_spec.rb | 107 + spec/payroll_au/models/payslips_spec.rb | 41 + spec/payroll_au/models/rate_type_spec.rb | 35 + .../models/reimbursement_line_spec.rb | 59 + .../models/reimbursement_lines_spec.rb | 41 + .../models/reimbursement_type_spec.rb | 65 + .../models/residency_status_spec.rb | 35 + .../payroll_au/models/settings_object_spec.rb | 41 + spec/payroll_au/models/settings_spec.rb | 53 + ...racking_categories_employee_groups_spec.rb | 47 + .../settings_tracking_categories_spec.rb | 47 + ...ng_categories_timesheet_categories_spec.rb | 47 + spec/payroll_au/models/state_spec.rb | 35 + .../models/super_fund_product_spec.rb | 59 + .../models/super_fund_products_spec.rb | 41 + spec/payroll_au/models/super_fund_spec.rb | 113 + .../payroll_au/models/super_fund_type_spec.rb | 35 + spec/payroll_au/models/super_funds_spec.rb | 41 + spec/payroll_au/models/super_line_spec.rb | 83 + .../models/super_membership_spec.rb | 53 + .../superannuation_calculation_type_spec.rb | 35 + .../superannuation_contribution_type_spec.rb | 35 + .../models/superannuation_line_spec.rb | 89 + .../payroll_au/models/tax_declaration_spec.rb | 131 + spec/payroll_au/models/tax_line_spec.rb | 71 + .../models/tfn_exemption_type_spec.rb | 35 + spec/payroll_au/models/timesheet_line_spec.rb | 59 + .../models/timesheet_object_spec.rb | 41 + spec/payroll_au/models/timesheet_spec.rb | 89 + .../models/timesheet_status_spec.rb | 35 + spec/payroll_au/models/timesheets_spec.rb | 41 + .../models/validation_error_spec.rb | 41 + spec/payroll_nz/api/payroll_nz_api_spec.rb | 886 +++ spec/payroll_nz/models/account_spec.rb | 63 + spec/payroll_nz/models/accounts_spec.rb | 41 + spec/payroll_nz/models/address_spec.rb | 71 + spec/payroll_nz/models/bank_account_spec.rb | 87 + spec/payroll_nz/models/benefit_spec.rb | 103 + spec/payroll_nz/models/deduction_line_spec.rb | 65 + .../models/deduction_object_spec.rb | 53 + spec/payroll_nz/models/deduction_spec.rb | 75 + spec/payroll_nz/models/deductions_spec.rb | 53 + spec/payroll_nz/models/earnings_line_spec.rb | 95 + .../models/earnings_order_object_spec.rb | 53 + spec/payroll_nz/models/earnings_order_spec.rb | 65 + .../payroll_nz/models/earnings_orders_spec.rb | 53 + .../models/earnings_rate_object_spec.rb | 53 + spec/payroll_nz/models/earnings_rate_spec.rb | 103 + spec/payroll_nz/models/earnings_rates_spec.rb | 53 + .../models/earnings_template_object_spec.rb | 53 + .../models/earnings_template_spec.rb | 71 + .../employee_earnings_templates_spec.rb | 53 + .../models/employee_leave_balance_spec.rb | 59 + .../models/employee_leave_balances_spec.rb | 53 + .../models/employee_leave_object_spec.rb | 53 + .../employee_leave_setup_object_spec.rb | 53 + .../models/employee_leave_setup_spec.rb | 77 + spec/payroll_nz/models/employee_leave_spec.rb | 77 + .../models/employee_leave_type_object_spec.rb | 53 + .../models/employee_leave_type_spec.rb | 99 + .../models/employee_leave_types_spec.rb | 53 + .../payroll_nz/models/employee_leaves_spec.rb | 53 + .../payroll_nz/models/employee_object_spec.rb | 53 + .../models/employee_opening_balance_spec.rb | 59 + .../employee_opening_balances_object_spec.rb | 53 + .../employee_pay_template_object_spec.rb | 53 + .../models/employee_pay_template_spec.rb | 47 + .../models/employee_pay_templates_spec.rb | 53 + spec/payroll_nz/models/employee_spec.rb | 123 + ...yee_statutory_leave_balance_object_spec.rb | 53 + .../employee_statutory_leave_balance_spec.rb | 61 + .../employee_statutory_leave_summary_spec.rb | 85 + ...mployee_statutory_leaves_summaries_spec.rb | 53 + ...ployee_statutory_sick_leave_object_spec.rb | 53 + .../employee_statutory_sick_leave_spec.rb | 135 + .../employee_statutory_sick_leaves_spec.rb | 53 + .../models/employee_tax_object_spec.rb | 53 + spec/payroll_nz/models/employee_tax_spec.rb | 135 + spec/payroll_nz/models/employees_spec.rb | 53 + .../models/employment_object_spec.rb | 53 + spec/payroll_nz/models/employment_spec.rb | 53 + .../models/gross_earnings_history_spec.rb | 47 + spec/payroll_nz/models/invalid_field_spec.rb | 47 + .../models/leave_accrual_line_spec.rb | 47 + .../models/leave_earnings_line_spec.rb | 95 + spec/payroll_nz/models/leave_period_spec.rb | 63 + spec/payroll_nz/models/leave_periods_spec.rb | 53 + .../models/leave_type_object_spec.rb | 53 + spec/payroll_nz/models/leave_type_spec.rb | 71 + spec/payroll_nz/models/leave_types_spec.rb | 53 + spec/payroll_nz/models/pagination_spec.rb | 59 + .../models/pay_run_calendar_object_spec.rb | 53 + .../models/pay_run_calendar_spec.rb | 81 + .../models/pay_run_calendars_spec.rb | 53 + spec/payroll_nz/models/pay_run_object_spec.rb | 53 + spec/payroll_nz/models/pay_run_spec.rb | 119 + spec/payroll_nz/models/pay_runs_spec.rb | 53 + .../payroll_nz/models/pay_slip_object_spec.rb | 53 + spec/payroll_nz/models/pay_slip_spec.rb | 219 + spec/payroll_nz/models/pay_slips_spec.rb | 53 + spec/payroll_nz/models/payment_line_spec.rb | 65 + .../models/payment_method_object_spec.rb | 53 + spec/payroll_nz/models/payment_method_spec.rb | 51 + spec/payroll_nz/models/problem_spec.rb | 71 + .../models/reimbursement_line_spec.rb | 65 + .../models/reimbursement_object_spec.rb | 53 + spec/payroll_nz/models/reimbursement_spec.rb | 101 + spec/payroll_nz/models/reimbursements_spec.rb | 53 + .../models/salary_and_wage_object_spec.rb | 53 + .../payroll_nz/models/salary_and_wage_spec.rb | 103 + .../models/salary_and_wages_spec.rb | 53 + spec/payroll_nz/models/settings_spec.rb | 53 + .../statutory_deduction_category_spec.rb | 35 + .../models/statutory_deduction_line_spec.rb | 59 + .../models/statutory_deduction_object_spec.rb | 53 + .../models/statutory_deduction_spec.rb | 65 + .../models/statutory_deductions_spec.rb | 53 + .../models/superannuation_line_spec.rb | 71 + .../models/superannuation_object_spec.rb | 53 + .../payroll_nz/models/superannuations_spec.rb | 53 + spec/payroll_nz/models/tax_code_spec.rb | 35 + spec/payroll_nz/models/tax_line_spec.rb | 65 + spec/payroll_nz/models/tax_settings_spec.rb | 75 + .../models/timesheet_earnings_line_spec.rb | 95 + .../models/timesheet_line_object_spec.rb | 53 + spec/payroll_nz/models/timesheet_line_spec.rb | 65 + .../models/timesheet_object_spec.rb | 53 + spec/payroll_nz/models/timesheet_spec.rb | 93 + spec/payroll_nz/models/timesheets_spec.rb | 53 + .../models/tracking_categories_spec.rb | 53 + .../models/tracking_category_spec.rb | 47 + spec/payroll_uk/api/payroll_uk_api_spec.rb | 912 +++ spec/payroll_uk/models/account_spec.rb | 63 + spec/payroll_uk/models/accounts_spec.rb | 41 + spec/payroll_uk/models/address_spec.rb | 65 + spec/payroll_uk/models/bank_account_spec.rb | 53 + spec/payroll_uk/models/benefit_line_spec.rb | 65 + spec/payroll_uk/models/benefit_object_spec.rb | 53 + spec/payroll_uk/models/benefit_spec.rb | 127 + spec/payroll_uk/models/benefits_spec.rb | 53 + .../models/court_order_line_spec.rb | 47 + spec/payroll_uk/models/deduction_line_spec.rb | 59 + .../models/deduction_object_spec.rb | 53 + spec/payroll_uk/models/deduction_spec.rb | 139 + spec/payroll_uk/models/deductions_spec.rb | 53 + spec/payroll_uk/models/earnings_line_spec.rb | 89 + .../models/earnings_order_object_spec.rb | 53 + spec/payroll_uk/models/earnings_order_spec.rb | 65 + .../payroll_uk/models/earnings_orders_spec.rb | 53 + .../models/earnings_rate_object_spec.rb | 53 + spec/payroll_uk/models/earnings_rate_spec.rb | 103 + spec/payroll_uk/models/earnings_rates_spec.rb | 53 + .../models/earnings_template_object_spec.rb | 53 + .../models/earnings_template_spec.rb | 71 + .../models/employee_leave_balance_spec.rb | 59 + .../models/employee_leave_balances_spec.rb | 53 + .../models/employee_leave_object_spec.rb | 53 + spec/payroll_uk/models/employee_leave_spec.rb | 77 + .../models/employee_leave_type_object_spec.rb | 53 + .../models/employee_leave_type_spec.rb | 75 + .../models/employee_leave_types_spec.rb | 53 + .../payroll_uk/models/employee_leaves_spec.rb | 53 + .../payroll_uk/models/employee_object_spec.rb | 53 + .../employee_opening_balances_object_spec.rb | 53 + .../models/employee_opening_balances_spec.rb | 71 + .../employee_pay_template_object_spec.rb | 53 + .../models/employee_pay_template_spec.rb | 47 + .../models/employee_pay_templates_spec.rb | 53 + spec/payroll_uk/models/employee_spec.rb | 129 + ...yee_statutory_leave_balance_object_spec.rb | 53 + .../employee_statutory_leave_balance_spec.rb | 61 + .../employee_statutory_leave_summary_spec.rb | 85 + ...mployee_statutory_leaves_summaries_spec.rb | 53 + ...ployee_statutory_sick_leave_object_spec.rb | 53 + .../employee_statutory_sick_leave_spec.rb | 135 + .../employee_statutory_sick_leaves_spec.rb | 53 + .../models/employee_tax_object_spec.rb | 53 + spec/payroll_uk/models/employee_tax_spec.rb | 101 + spec/payroll_uk/models/employees_spec.rb | 53 + .../models/employment_object_spec.rb | 53 + spec/payroll_uk/models/employment_spec.rb | 63 + spec/payroll_uk/models/invalid_field_spec.rb | 47 + .../models/leave_accrual_line_spec.rb | 47 + .../models/leave_earnings_line_spec.rb | 71 + spec/payroll_uk/models/leave_period_spec.rb | 63 + spec/payroll_uk/models/leave_periods_spec.rb | 53 + .../models/leave_type_object_spec.rb | 53 + spec/payroll_uk/models/leave_type_spec.rb | 83 + spec/payroll_uk/models/leave_types_spec.rb | 53 + spec/payroll_uk/models/pagination_spec.rb | 59 + .../models/pay_run_calendar_object_spec.rb | 53 + .../models/pay_run_calendar_spec.rb | 81 + .../models/pay_run_calendars_spec.rb | 53 + spec/payroll_uk/models/pay_run_object_spec.rb | 53 + spec/payroll_uk/models/pay_run_spec.rb | 119 + spec/payroll_uk/models/pay_runs_spec.rb | 53 + spec/payroll_uk/models/payment_line_spec.rb | 65 + .../models/payment_method_object_spec.rb | 53 + spec/payroll_uk/models/payment_method_spec.rb | 51 + spec/payroll_uk/models/payslip_object_spec.rb | 53 + spec/payroll_uk/models/payslip_spec.rb | 201 + spec/payroll_uk/models/payslips_spec.rb | 53 + spec/payroll_uk/models/problem_spec.rb | 71 + .../models/reimbursement_line_spec.rb | 53 + .../models/reimbursement_object_spec.rb | 53 + spec/payroll_uk/models/reimbursement_spec.rb | 59 + spec/payroll_uk/models/reimbursements_spec.rb | 53 + .../models/salary_and_wage_object_spec.rb | 53 + .../payroll_uk/models/salary_and_wage_spec.rb | 97 + .../models/salary_and_wages_spec.rb | 53 + spec/payroll_uk/models/settings_spec.rb | 53 + .../statutory_deduction_category_spec.rb | 35 + .../models/statutory_deduction_spec.rb | 65 + spec/payroll_uk/models/tax_line_spec.rb | 71 + .../models/timesheet_earnings_line_spec.rb | 71 + .../models/timesheet_line_object_spec.rb | 53 + spec/payroll_uk/models/timesheet_line_spec.rb | 65 + .../models/timesheet_object_spec.rb | 53 + spec/payroll_uk/models/timesheet_spec.rb | 93 + spec/payroll_uk/models/timesheets_spec.rb | 53 + .../models/tracking_categories_spec.rb | 53 + .../models/tracking_category_spec.rb | 47 + xero-ruby.gemspec | 2 +- 1001 files changed, 122058 insertions(+), 1952 deletions(-) create mode 100644 docs/accounting/Action.md create mode 100644 docs/accounting/Actions.md create mode 100644 docs/files/Association.md create mode 100644 docs/files/FileObject.md create mode 100644 docs/files/FileResponse204.md create mode 100644 docs/files/Files.md create mode 100644 docs/files/FilesApi.md create mode 100644 docs/files/Folder.md create mode 100644 docs/files/Folders.md create mode 100644 docs/files/InlineObject.md create mode 100644 docs/files/ObjectGroup.md create mode 100644 docs/files/ObjectType.md create mode 100644 docs/files/User.md create mode 100644 docs/payroll_au/APIException.md create mode 100644 docs/payroll_au/Account.md create mode 100644 docs/payroll_au/AccountType.md create mode 100644 docs/payroll_au/AllowanceType.md create mode 100644 docs/payroll_au/BankAccount.md create mode 100644 docs/payroll_au/CalendarType.md create mode 100644 docs/payroll_au/DeductionLine.md create mode 100644 docs/payroll_au/DeductionType.md create mode 100644 docs/payroll_au/DeductionTypeCalculationType.md create mode 100644 docs/payroll_au/EarningsLine.md create mode 100644 docs/payroll_au/EarningsRate.md create mode 100644 docs/payroll_au/EarningsRateCalculationType.md create mode 100644 docs/payroll_au/EarningsType.md create mode 100644 docs/payroll_au/Employee.md create mode 100644 docs/payroll_au/EmployeeStatus.md create mode 100644 docs/payroll_au/Employees.md create mode 100644 docs/payroll_au/EmploymentBasis.md create mode 100644 docs/payroll_au/EmploymentTerminationPaymentType.md create mode 100644 docs/payroll_au/EntitlementFinalPayPayoutType.md create mode 100644 docs/payroll_au/HomeAddress.md create mode 100644 docs/payroll_au/LeaveAccrualLine.md create mode 100644 docs/payroll_au/LeaveApplication.md create mode 100644 docs/payroll_au/LeaveApplications.md create mode 100644 docs/payroll_au/LeaveBalance.md create mode 100644 docs/payroll_au/LeaveEarningsLine.md create mode 100644 docs/payroll_au/LeaveLine.md create mode 100644 docs/payroll_au/LeaveLineCalculationType.md create mode 100644 docs/payroll_au/LeaveLines.md create mode 100644 docs/payroll_au/LeavePeriod.md create mode 100644 docs/payroll_au/LeavePeriodStatus.md create mode 100644 docs/payroll_au/LeaveType.md create mode 100644 docs/payroll_au/LeaveTypeContributionType.md create mode 100644 docs/payroll_au/ManualTaxType.md create mode 100644 docs/payroll_au/OpeningBalances.md create mode 100644 docs/payroll_au/PayItem.md create mode 100644 docs/payroll_au/PayItems.md create mode 100644 docs/payroll_au/PayRun.md create mode 100644 docs/payroll_au/PayRunStatus.md create mode 100644 docs/payroll_au/PayRuns.md create mode 100644 docs/payroll_au/PayTemplate.md create mode 100644 docs/payroll_au/PaymentFrequencyType.md create mode 100644 docs/payroll_au/PayrollAuApi.md create mode 100644 docs/payroll_au/PayrollCalendar.md create mode 100644 docs/payroll_au/PayrollCalendars.md create mode 100644 docs/payroll_au/Payslip.md create mode 100644 docs/payroll_au/PayslipLines.md create mode 100644 docs/payroll_au/PayslipObject.md create mode 100644 docs/payroll_au/PayslipSummary.md create mode 100644 docs/payroll_au/Payslips.md create mode 100644 docs/payroll_au/RateType.md create mode 100644 docs/payroll_au/ReimbursementLine.md create mode 100644 docs/payroll_au/ReimbursementLines.md create mode 100644 docs/payroll_au/ReimbursementType.md create mode 100644 docs/payroll_au/ResidencyStatus.md create mode 100644 docs/payroll_au/Settings.md create mode 100644 docs/payroll_au/SettingsObject.md create mode 100644 docs/payroll_au/SettingsTrackingCategories.md create mode 100644 docs/payroll_au/SettingsTrackingCategoriesEmployeeGroups.md create mode 100644 docs/payroll_au/SettingsTrackingCategoriesTimesheetCategories.md create mode 100644 docs/payroll_au/State.md create mode 100644 docs/payroll_au/SuperFund.md create mode 100644 docs/payroll_au/SuperFundProduct.md create mode 100644 docs/payroll_au/SuperFundProducts.md create mode 100644 docs/payroll_au/SuperFundType.md create mode 100644 docs/payroll_au/SuperFunds.md create mode 100644 docs/payroll_au/SuperLine.md create mode 100644 docs/payroll_au/SuperMembership.md create mode 100644 docs/payroll_au/SuperannuationCalculationType.md create mode 100644 docs/payroll_au/SuperannuationContributionType.md create mode 100644 docs/payroll_au/SuperannuationLine.md create mode 100644 docs/payroll_au/TFNExemptionType.md create mode 100644 docs/payroll_au/TaxDeclaration.md create mode 100644 docs/payroll_au/TaxLine.md create mode 100644 docs/payroll_au/Timesheet.md create mode 100644 docs/payroll_au/TimesheetLine.md create mode 100644 docs/payroll_au/TimesheetObject.md create mode 100644 docs/payroll_au/TimesheetStatus.md create mode 100644 docs/payroll_au/Timesheets.md create mode 100644 docs/payroll_au/ValidationError.md create mode 100644 docs/payroll_nz/Account.md create mode 100644 docs/payroll_nz/Accounts.md create mode 100644 docs/payroll_nz/Address.md create mode 100644 docs/payroll_nz/BankAccount.md create mode 100644 docs/payroll_nz/Benefit.md create mode 100644 docs/payroll_nz/Deduction.md create mode 100644 docs/payroll_nz/DeductionLine.md create mode 100644 docs/payroll_nz/DeductionObject.md create mode 100644 docs/payroll_nz/Deductions.md create mode 100644 docs/payroll_nz/EarningsLine.md create mode 100644 docs/payroll_nz/EarningsOrder.md create mode 100644 docs/payroll_nz/EarningsOrderObject.md create mode 100644 docs/payroll_nz/EarningsOrders.md create mode 100644 docs/payroll_nz/EarningsRate.md create mode 100644 docs/payroll_nz/EarningsRateObject.md create mode 100644 docs/payroll_nz/EarningsRates.md create mode 100644 docs/payroll_nz/EarningsTemplate.md create mode 100644 docs/payroll_nz/EarningsTemplateObject.md create mode 100644 docs/payroll_nz/Employee.md create mode 100644 docs/payroll_nz/EmployeeEarningsTemplates.md create mode 100644 docs/payroll_nz/EmployeeLeave.md create mode 100644 docs/payroll_nz/EmployeeLeaveBalance.md create mode 100644 docs/payroll_nz/EmployeeLeaveBalances.md create mode 100644 docs/payroll_nz/EmployeeLeaveObject.md create mode 100644 docs/payroll_nz/EmployeeLeaveSetup.md create mode 100644 docs/payroll_nz/EmployeeLeaveSetupObject.md create mode 100644 docs/payroll_nz/EmployeeLeaveType.md create mode 100644 docs/payroll_nz/EmployeeLeaveTypeObject.md create mode 100644 docs/payroll_nz/EmployeeLeaveTypes.md create mode 100644 docs/payroll_nz/EmployeeLeaves.md create mode 100644 docs/payroll_nz/EmployeeObject.md create mode 100644 docs/payroll_nz/EmployeeOpeningBalance.md create mode 100644 docs/payroll_nz/EmployeeOpeningBalancesObject.md create mode 100644 docs/payroll_nz/EmployeePayTemplate.md create mode 100644 docs/payroll_nz/EmployeePayTemplateObject.md create mode 100644 docs/payroll_nz/EmployeePayTemplates.md create mode 100644 docs/payroll_nz/EmployeeStatutoryLeaveBalance.md create mode 100644 docs/payroll_nz/EmployeeStatutoryLeaveBalanceObject.md create mode 100644 docs/payroll_nz/EmployeeStatutoryLeaveSummary.md create mode 100644 docs/payroll_nz/EmployeeStatutoryLeavesSummaries.md create mode 100644 docs/payroll_nz/EmployeeStatutorySickLeave.md create mode 100644 docs/payroll_nz/EmployeeStatutorySickLeaveObject.md create mode 100644 docs/payroll_nz/EmployeeStatutorySickLeaves.md create mode 100644 docs/payroll_nz/EmployeeTax.md create mode 100644 docs/payroll_nz/EmployeeTaxObject.md create mode 100644 docs/payroll_nz/Employees.md create mode 100644 docs/payroll_nz/Employment.md create mode 100644 docs/payroll_nz/EmploymentObject.md create mode 100644 docs/payroll_nz/GrossEarningsHistory.md create mode 100644 docs/payroll_nz/InvalidField.md create mode 100644 docs/payroll_nz/LeaveAccrualLine.md create mode 100644 docs/payroll_nz/LeaveEarningsLine.md create mode 100644 docs/payroll_nz/LeavePeriod.md create mode 100644 docs/payroll_nz/LeavePeriods.md create mode 100644 docs/payroll_nz/LeaveType.md create mode 100644 docs/payroll_nz/LeaveTypeObject.md create mode 100644 docs/payroll_nz/LeaveTypes.md create mode 100644 docs/payroll_nz/Pagination.md create mode 100644 docs/payroll_nz/PayRun.md create mode 100644 docs/payroll_nz/PayRunCalendar.md create mode 100644 docs/payroll_nz/PayRunCalendarObject.md create mode 100644 docs/payroll_nz/PayRunCalendars.md create mode 100644 docs/payroll_nz/PayRunObject.md create mode 100644 docs/payroll_nz/PayRuns.md create mode 100644 docs/payroll_nz/PaySlip.md create mode 100644 docs/payroll_nz/PaySlipObject.md create mode 100644 docs/payroll_nz/PaySlips.md create mode 100644 docs/payroll_nz/PaymentLine.md create mode 100644 docs/payroll_nz/PaymentMethod.md create mode 100644 docs/payroll_nz/PaymentMethodObject.md create mode 100644 docs/payroll_nz/PayrollNzApi.md create mode 100644 docs/payroll_nz/Problem.md create mode 100644 docs/payroll_nz/Reimbursement.md create mode 100644 docs/payroll_nz/ReimbursementLine.md create mode 100644 docs/payroll_nz/ReimbursementObject.md create mode 100644 docs/payroll_nz/Reimbursements.md create mode 100644 docs/payroll_nz/SalaryAndWage.md create mode 100644 docs/payroll_nz/SalaryAndWageObject.md create mode 100644 docs/payroll_nz/SalaryAndWages.md create mode 100644 docs/payroll_nz/Settings.md create mode 100644 docs/payroll_nz/StatutoryDeduction.md create mode 100644 docs/payroll_nz/StatutoryDeductionCategory.md create mode 100644 docs/payroll_nz/StatutoryDeductionLine.md create mode 100644 docs/payroll_nz/StatutoryDeductionObject.md create mode 100644 docs/payroll_nz/StatutoryDeductions.md create mode 100644 docs/payroll_nz/SuperannuationLine.md create mode 100644 docs/payroll_nz/SuperannuationObject.md create mode 100644 docs/payroll_nz/Superannuations.md create mode 100644 docs/payroll_nz/TaxCode.md create mode 100644 docs/payroll_nz/TaxLine.md create mode 100644 docs/payroll_nz/TaxSettings.md create mode 100644 docs/payroll_nz/Timesheet.md create mode 100644 docs/payroll_nz/TimesheetEarningsLine.md create mode 100644 docs/payroll_nz/TimesheetLine.md create mode 100644 docs/payroll_nz/TimesheetLineObject.md create mode 100644 docs/payroll_nz/TimesheetObject.md create mode 100644 docs/payroll_nz/Timesheets.md create mode 100644 docs/payroll_nz/TrackingCategories.md create mode 100644 docs/payroll_nz/TrackingCategory.md create mode 100644 docs/payroll_uk/Account.md create mode 100644 docs/payroll_uk/Accounts.md create mode 100644 docs/payroll_uk/Address.md create mode 100644 docs/payroll_uk/BankAccount.md create mode 100644 docs/payroll_uk/Benefit.md create mode 100644 docs/payroll_uk/BenefitLine.md create mode 100644 docs/payroll_uk/BenefitObject.md create mode 100644 docs/payroll_uk/Benefits.md create mode 100644 docs/payroll_uk/CourtOrderLine.md create mode 100644 docs/payroll_uk/Deduction.md create mode 100644 docs/payroll_uk/DeductionLine.md create mode 100644 docs/payroll_uk/DeductionObject.md create mode 100644 docs/payroll_uk/Deductions.md create mode 100644 docs/payroll_uk/EarningsLine.md create mode 100644 docs/payroll_uk/EarningsOrder.md create mode 100644 docs/payroll_uk/EarningsOrderObject.md create mode 100644 docs/payroll_uk/EarningsOrders.md create mode 100644 docs/payroll_uk/EarningsRate.md create mode 100644 docs/payroll_uk/EarningsRateObject.md create mode 100644 docs/payroll_uk/EarningsRates.md create mode 100644 docs/payroll_uk/EarningsTemplate.md create mode 100644 docs/payroll_uk/EarningsTemplateObject.md create mode 100644 docs/payroll_uk/Employee.md create mode 100644 docs/payroll_uk/EmployeeLeave.md create mode 100644 docs/payroll_uk/EmployeeLeaveBalance.md create mode 100644 docs/payroll_uk/EmployeeLeaveBalances.md create mode 100644 docs/payroll_uk/EmployeeLeaveObject.md create mode 100644 docs/payroll_uk/EmployeeLeaveType.md create mode 100644 docs/payroll_uk/EmployeeLeaveTypeObject.md create mode 100644 docs/payroll_uk/EmployeeLeaveTypes.md create mode 100644 docs/payroll_uk/EmployeeLeaves.md create mode 100644 docs/payroll_uk/EmployeeObject.md create mode 100644 docs/payroll_uk/EmployeeOpeningBalances.md create mode 100644 docs/payroll_uk/EmployeeOpeningBalancesObject.md create mode 100644 docs/payroll_uk/EmployeePayTemplate.md create mode 100644 docs/payroll_uk/EmployeePayTemplateObject.md create mode 100644 docs/payroll_uk/EmployeePayTemplates.md create mode 100644 docs/payroll_uk/EmployeeStatutoryLeaveBalance.md create mode 100644 docs/payroll_uk/EmployeeStatutoryLeaveBalanceObject.md create mode 100644 docs/payroll_uk/EmployeeStatutoryLeaveSummary.md create mode 100644 docs/payroll_uk/EmployeeStatutoryLeavesSummaries.md create mode 100644 docs/payroll_uk/EmployeeStatutorySickLeave.md create mode 100644 docs/payroll_uk/EmployeeStatutorySickLeaveObject.md create mode 100644 docs/payroll_uk/EmployeeStatutorySickLeaves.md create mode 100644 docs/payroll_uk/EmployeeTax.md create mode 100644 docs/payroll_uk/EmployeeTaxObject.md create mode 100644 docs/payroll_uk/Employees.md create mode 100644 docs/payroll_uk/Employment.md create mode 100644 docs/payroll_uk/EmploymentObject.md create mode 100644 docs/payroll_uk/InvalidField.md create mode 100644 docs/payroll_uk/LeaveAccrualLine.md create mode 100644 docs/payroll_uk/LeaveEarningsLine.md create mode 100644 docs/payroll_uk/LeavePeriod.md create mode 100644 docs/payroll_uk/LeavePeriods.md create mode 100644 docs/payroll_uk/LeaveType.md create mode 100644 docs/payroll_uk/LeaveTypeObject.md create mode 100644 docs/payroll_uk/LeaveTypes.md create mode 100644 docs/payroll_uk/Pagination.md create mode 100644 docs/payroll_uk/PayRun.md create mode 100644 docs/payroll_uk/PayRunCalendar.md create mode 100644 docs/payroll_uk/PayRunCalendarObject.md create mode 100644 docs/payroll_uk/PayRunCalendars.md create mode 100644 docs/payroll_uk/PayRunObject.md create mode 100644 docs/payroll_uk/PayRuns.md create mode 100644 docs/payroll_uk/PaymentLine.md create mode 100644 docs/payroll_uk/PaymentMethod.md create mode 100644 docs/payroll_uk/PaymentMethodObject.md create mode 100644 docs/payroll_uk/PayrollUkApi.md create mode 100644 docs/payroll_uk/Payslip.md create mode 100644 docs/payroll_uk/PayslipObject.md create mode 100644 docs/payroll_uk/Payslips.md create mode 100644 docs/payroll_uk/Problem.md create mode 100644 docs/payroll_uk/Reimbursement.md create mode 100644 docs/payroll_uk/ReimbursementLine.md create mode 100644 docs/payroll_uk/ReimbursementObject.md create mode 100644 docs/payroll_uk/Reimbursements.md create mode 100644 docs/payroll_uk/SalaryAndWage.md create mode 100644 docs/payroll_uk/SalaryAndWageObject.md create mode 100644 docs/payroll_uk/SalaryAndWages.md create mode 100644 docs/payroll_uk/Settings.md create mode 100644 docs/payroll_uk/StatutoryDeduction.md create mode 100644 docs/payroll_uk/StatutoryDeductionCategory.md create mode 100644 docs/payroll_uk/TaxLine.md create mode 100644 docs/payroll_uk/Timesheet.md create mode 100644 docs/payroll_uk/TimesheetEarningsLine.md create mode 100644 docs/payroll_uk/TimesheetLine.md create mode 100644 docs/payroll_uk/TimesheetLineObject.md create mode 100644 docs/payroll_uk/TimesheetObject.md create mode 100644 docs/payroll_uk/Timesheets.md create mode 100644 docs/payroll_uk/TrackingCategories.md create mode 100644 docs/payroll_uk/TrackingCategory.md create mode 100644 lib/xero-ruby/api/files_api.rb create mode 100644 lib/xero-ruby/api/payroll_au_api.rb create mode 100644 lib/xero-ruby/api/payroll_nz_api.rb create mode 100644 lib/xero-ruby/api/payroll_uk_api.rb create mode 100644 lib/xero-ruby/models/accounting/action.rb create mode 100644 lib/xero-ruby/models/accounting/actions.rb create mode 100644 lib/xero-ruby/models/files/association.rb create mode 100644 lib/xero-ruby/models/files/file_object.rb create mode 100644 lib/xero-ruby/models/files/file_response204.rb create mode 100644 lib/xero-ruby/models/files/files.rb create mode 100644 lib/xero-ruby/models/files/folder.rb create mode 100644 lib/xero-ruby/models/files/folders.rb create mode 100644 lib/xero-ruby/models/files/inline_object.rb create mode 100644 lib/xero-ruby/models/files/object_group.rb create mode 100644 lib/xero-ruby/models/files/object_type.rb create mode 100644 lib/xero-ruby/models/files/user.rb create mode 100644 lib/xero-ruby/models/payroll_au/account.rb create mode 100644 lib/xero-ruby/models/payroll_au/account_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/allowance_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/api_exception.rb create mode 100644 lib/xero-ruby/models/payroll_au/bank_account.rb create mode 100644 lib/xero-ruby/models/payroll_au/calendar_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/deduction_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/deduction_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/earnings_rate.rb create mode 100644 lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/earnings_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/employee.rb create mode 100644 lib/xero-ruby/models/payroll_au/employee_status.rb create mode 100644 lib/xero-ruby/models/payroll_au/employees.rb create mode 100644 lib/xero-ruby/models/payroll_au/employment_basis.rb create mode 100644 lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/home_address.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_accrual_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_application.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_applications.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_balance.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_lines.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_period.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_period_status.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/manual_tax_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/opening_balances.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_item.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_items.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_run.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_run_status.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_runs.rb create mode 100644 lib/xero-ruby/models/payroll_au/pay_template.rb create mode 100644 lib/xero-ruby/models/payroll_au/payment_frequency_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/payroll_calendar.rb create mode 100644 lib/xero-ruby/models/payroll_au/payroll_calendars.rb create mode 100644 lib/xero-ruby/models/payroll_au/payslip.rb create mode 100644 lib/xero-ruby/models/payroll_au/payslip_lines.rb create mode 100644 lib/xero-ruby/models/payroll_au/payslip_object.rb create mode 100644 lib/xero-ruby/models/payroll_au/payslip_summary.rb create mode 100644 lib/xero-ruby/models/payroll_au/payslips.rb create mode 100644 lib/xero-ruby/models/payroll_au/rate_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/reimbursement_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/reimbursement_lines.rb create mode 100644 lib/xero-ruby/models/payroll_au/reimbursement_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/residency_status.rb create mode 100644 lib/xero-ruby/models/payroll_au/settings.rb create mode 100644 lib/xero-ruby/models/payroll_au/settings_object.rb create mode 100644 lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb create mode 100644 lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb create mode 100644 lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb create mode 100644 lib/xero-ruby/models/payroll_au/state.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_fund.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_fund_product.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_fund_products.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_fund_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_funds.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/super_membership.rb create mode 100644 lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/superannuation_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/tax_declaration.rb create mode 100644 lib/xero-ruby/models/payroll_au/tax_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb create mode 100644 lib/xero-ruby/models/payroll_au/timesheet.rb create mode 100644 lib/xero-ruby/models/payroll_au/timesheet_line.rb create mode 100644 lib/xero-ruby/models/payroll_au/timesheet_object.rb create mode 100644 lib/xero-ruby/models/payroll_au/timesheet_status.rb create mode 100644 lib/xero-ruby/models/payroll_au/timesheets.rb create mode 100644 lib/xero-ruby/models/payroll_au/validation_error.rb create mode 100644 lib/xero-ruby/models/payroll_nz/account.rb create mode 100644 lib/xero-ruby/models/payroll_nz/accounts.rb create mode 100644 lib/xero-ruby/models/payroll_nz/address.rb create mode 100644 lib/xero-ruby/models/payroll_nz/bank_account.rb create mode 100644 lib/xero-ruby/models/payroll_nz/benefit.rb create mode 100644 lib/xero-ruby/models/payroll_nz/deduction.rb create mode 100644 lib/xero-ruby/models/payroll_nz/deduction_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/deduction_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/deductions.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_order.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_order_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_orders.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_rate.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_rates.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_template.rb create mode 100644 lib/xero-ruby/models/payroll_nz/earnings_template_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_type.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leave_types.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_leaves.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_pay_template.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_tax.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_tax_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employees.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employment.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employment_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb create mode 100644 lib/xero-ruby/models/payroll_nz/invalid_field.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_period.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_periods.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_type.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_type_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/leave_types.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pagination.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_run.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_run_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_runs.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_slip.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_slip_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/pay_slips.rb create mode 100644 lib/xero-ruby/models/payroll_nz/payment_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/payment_method.rb create mode 100644 lib/xero-ruby/models/payroll_nz/payment_method_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/problem.rb create mode 100644 lib/xero-ruby/models/payroll_nz/reimbursement.rb create mode 100644 lib/xero-ruby/models/payroll_nz/reimbursement_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/reimbursement_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/reimbursements.rb create mode 100644 lib/xero-ruby/models/payroll_nz/salary_and_wage.rb create mode 100644 lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/salary_and_wages.rb create mode 100644 lib/xero-ruby/models/payroll_nz/settings.rb create mode 100644 lib/xero-ruby/models/payroll_nz/statutory_deduction.rb create mode 100644 lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb create mode 100644 lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/statutory_deductions.rb create mode 100644 lib/xero-ruby/models/payroll_nz/superannuation_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/superannuation_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/superannuations.rb create mode 100644 lib/xero-ruby/models/payroll_nz/tax_code.rb create mode 100644 lib/xero-ruby/models/payroll_nz/tax_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/tax_settings.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheet.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheet_line.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheet_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/timesheets.rb create mode 100644 lib/xero-ruby/models/payroll_nz/tracking_categories.rb create mode 100644 lib/xero-ruby/models/payroll_nz/tracking_category.rb create mode 100644 lib/xero-ruby/models/payroll_uk/account.rb create mode 100644 lib/xero-ruby/models/payroll_uk/accounts.rb create mode 100644 lib/xero-ruby/models/payroll_uk/address.rb create mode 100644 lib/xero-ruby/models/payroll_uk/bank_account.rb create mode 100644 lib/xero-ruby/models/payroll_uk/benefit.rb create mode 100644 lib/xero-ruby/models/payroll_uk/benefit_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/benefit_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/benefits.rb create mode 100644 lib/xero-ruby/models/payroll_uk/court_order_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/deduction.rb create mode 100644 lib/xero-ruby/models/payroll_uk/deduction_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/deduction_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/deductions.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_order.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_order_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_orders.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_rate.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_rates.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_template.rb create mode 100644 lib/xero-ruby/models/payroll_uk/earnings_template_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_type.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leave_types.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_leaves.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_pay_template.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_tax.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employee_tax_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employees.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employment.rb create mode 100644 lib/xero-ruby/models/payroll_uk/employment_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/invalid_field.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_period.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_periods.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_type.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_type_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/leave_types.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pagination.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_run.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_run_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/pay_runs.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payment_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payment_method.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payment_method_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payslip.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payslip_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/payslips.rb create mode 100644 lib/xero-ruby/models/payroll_uk/problem.rb create mode 100644 lib/xero-ruby/models/payroll_uk/reimbursement.rb create mode 100644 lib/xero-ruby/models/payroll_uk/reimbursement_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/reimbursement_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/reimbursements.rb create mode 100644 lib/xero-ruby/models/payroll_uk/salary_and_wage.rb create mode 100644 lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/salary_and_wages.rb create mode 100644 lib/xero-ruby/models/payroll_uk/settings.rb create mode 100644 lib/xero-ruby/models/payroll_uk/statutory_deduction.rb create mode 100644 lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb create mode 100644 lib/xero-ruby/models/payroll_uk/tax_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheet.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheet_line.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheet_object.rb create mode 100644 lib/xero-ruby/models/payroll_uk/timesheets.rb create mode 100644 lib/xero-ruby/models/payroll_uk/tracking_categories.rb create mode 100644 lib/xero-ruby/models/payroll_uk/tracking_category.rb create mode 100644 spec/files/api/files_api_spec.rb create mode 100644 spec/files/models/association_spec.rb create mode 100644 spec/files/models/file_object_spec.rb create mode 100644 spec/files/models/file_response204_spec.rb create mode 100644 spec/files/models/files_spec.rb create mode 100644 spec/files/models/folder_spec.rb create mode 100644 spec/files/models/folders_spec.rb create mode 100644 spec/files/models/inline_object_spec.rb create mode 100644 spec/files/models/object_group_spec.rb create mode 100644 spec/files/models/object_type_spec.rb create mode 100644 spec/files/models/user_spec.rb create mode 100644 spec/payroll_au/api/payroll_au_api_spec.rb create mode 100644 spec/payroll_au/models/account_spec.rb create mode 100644 spec/payroll_au/models/account_type_spec.rb create mode 100644 spec/payroll_au/models/allowance_type_spec.rb create mode 100644 spec/payroll_au/models/api_exception_spec.rb create mode 100644 spec/payroll_au/models/bank_account_spec.rb create mode 100644 spec/payroll_au/models/calendar_type_spec.rb create mode 100644 spec/payroll_au/models/deduction_line_spec.rb create mode 100644 spec/payroll_au/models/deduction_type_calculation_type_spec.rb create mode 100644 spec/payroll_au/models/deduction_type_spec.rb create mode 100644 spec/payroll_au/models/earnings_line_spec.rb create mode 100644 spec/payroll_au/models/earnings_rate_calculation_type_spec.rb create mode 100644 spec/payroll_au/models/earnings_rate_spec.rb create mode 100644 spec/payroll_au/models/earnings_type_spec.rb create mode 100644 spec/payroll_au/models/employee_spec.rb create mode 100644 spec/payroll_au/models/employee_status_spec.rb create mode 100644 spec/payroll_au/models/employees_spec.rb create mode 100644 spec/payroll_au/models/employment_basis_spec.rb create mode 100644 spec/payroll_au/models/employment_termination_payment_type_spec.rb create mode 100644 spec/payroll_au/models/entitlement_final_pay_payout_type_spec.rb create mode 100644 spec/payroll_au/models/home_address_spec.rb create mode 100644 spec/payroll_au/models/leave_accrual_line_spec.rb create mode 100644 spec/payroll_au/models/leave_application_spec.rb create mode 100644 spec/payroll_au/models/leave_applications_spec.rb create mode 100644 spec/payroll_au/models/leave_balance_spec.rb create mode 100644 spec/payroll_au/models/leave_earnings_line_spec.rb create mode 100644 spec/payroll_au/models/leave_line_calculation_type_spec.rb create mode 100644 spec/payroll_au/models/leave_line_spec.rb create mode 100644 spec/payroll_au/models/leave_lines_spec.rb create mode 100644 spec/payroll_au/models/leave_period_spec.rb create mode 100644 spec/payroll_au/models/leave_period_status_spec.rb create mode 100644 spec/payroll_au/models/leave_type_contribution_type_spec.rb create mode 100644 spec/payroll_au/models/leave_type_spec.rb create mode 100644 spec/payroll_au/models/manual_tax_type_spec.rb create mode 100644 spec/payroll_au/models/opening_balances_spec.rb create mode 100644 spec/payroll_au/models/pay_item_spec.rb create mode 100644 spec/payroll_au/models/pay_items_spec.rb create mode 100644 spec/payroll_au/models/pay_run_spec.rb create mode 100644 spec/payroll_au/models/pay_run_status_spec.rb create mode 100644 spec/payroll_au/models/pay_runs_spec.rb create mode 100644 spec/payroll_au/models/pay_template_spec.rb create mode 100644 spec/payroll_au/models/payment_frequency_type_spec.rb create mode 100644 spec/payroll_au/models/payroll_calendar_spec.rb create mode 100644 spec/payroll_au/models/payroll_calendars_spec.rb create mode 100644 spec/payroll_au/models/payslip_lines_spec.rb create mode 100644 spec/payroll_au/models/payslip_object_spec.rb create mode 100644 spec/payroll_au/models/payslip_spec.rb create mode 100644 spec/payroll_au/models/payslip_summary_spec.rb create mode 100644 spec/payroll_au/models/payslips_spec.rb create mode 100644 spec/payroll_au/models/rate_type_spec.rb create mode 100644 spec/payroll_au/models/reimbursement_line_spec.rb create mode 100644 spec/payroll_au/models/reimbursement_lines_spec.rb create mode 100644 spec/payroll_au/models/reimbursement_type_spec.rb create mode 100644 spec/payroll_au/models/residency_status_spec.rb create mode 100644 spec/payroll_au/models/settings_object_spec.rb create mode 100644 spec/payroll_au/models/settings_spec.rb create mode 100644 spec/payroll_au/models/settings_tracking_categories_employee_groups_spec.rb create mode 100644 spec/payroll_au/models/settings_tracking_categories_spec.rb create mode 100644 spec/payroll_au/models/settings_tracking_categories_timesheet_categories_spec.rb create mode 100644 spec/payroll_au/models/state_spec.rb create mode 100644 spec/payroll_au/models/super_fund_product_spec.rb create mode 100644 spec/payroll_au/models/super_fund_products_spec.rb create mode 100644 spec/payroll_au/models/super_fund_spec.rb create mode 100644 spec/payroll_au/models/super_fund_type_spec.rb create mode 100644 spec/payroll_au/models/super_funds_spec.rb create mode 100644 spec/payroll_au/models/super_line_spec.rb create mode 100644 spec/payroll_au/models/super_membership_spec.rb create mode 100644 spec/payroll_au/models/superannuation_calculation_type_spec.rb create mode 100644 spec/payroll_au/models/superannuation_contribution_type_spec.rb create mode 100644 spec/payroll_au/models/superannuation_line_spec.rb create mode 100644 spec/payroll_au/models/tax_declaration_spec.rb create mode 100644 spec/payroll_au/models/tax_line_spec.rb create mode 100644 spec/payroll_au/models/tfn_exemption_type_spec.rb create mode 100644 spec/payroll_au/models/timesheet_line_spec.rb create mode 100644 spec/payroll_au/models/timesheet_object_spec.rb create mode 100644 spec/payroll_au/models/timesheet_spec.rb create mode 100644 spec/payroll_au/models/timesheet_status_spec.rb create mode 100644 spec/payroll_au/models/timesheets_spec.rb create mode 100644 spec/payroll_au/models/validation_error_spec.rb create mode 100644 spec/payroll_nz/api/payroll_nz_api_spec.rb create mode 100644 spec/payroll_nz/models/account_spec.rb create mode 100644 spec/payroll_nz/models/accounts_spec.rb create mode 100644 spec/payroll_nz/models/address_spec.rb create mode 100644 spec/payroll_nz/models/bank_account_spec.rb create mode 100644 spec/payroll_nz/models/benefit_spec.rb create mode 100644 spec/payroll_nz/models/deduction_line_spec.rb create mode 100644 spec/payroll_nz/models/deduction_object_spec.rb create mode 100644 spec/payroll_nz/models/deduction_spec.rb create mode 100644 spec/payroll_nz/models/deductions_spec.rb create mode 100644 spec/payroll_nz/models/earnings_line_spec.rb create mode 100644 spec/payroll_nz/models/earnings_order_object_spec.rb create mode 100644 spec/payroll_nz/models/earnings_order_spec.rb create mode 100644 spec/payroll_nz/models/earnings_orders_spec.rb create mode 100644 spec/payroll_nz/models/earnings_rate_object_spec.rb create mode 100644 spec/payroll_nz/models/earnings_rate_spec.rb create mode 100644 spec/payroll_nz/models/earnings_rates_spec.rb create mode 100644 spec/payroll_nz/models/earnings_template_object_spec.rb create mode 100644 spec/payroll_nz/models/earnings_template_spec.rb create mode 100644 spec/payroll_nz/models/employee_earnings_templates_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_balance_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_balances_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_setup_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_setup_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_type_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_type_spec.rb create mode 100644 spec/payroll_nz/models/employee_leave_types_spec.rb create mode 100644 spec/payroll_nz/models/employee_leaves_spec.rb create mode 100644 spec/payroll_nz/models/employee_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_opening_balance_spec.rb create mode 100644 spec/payroll_nz/models/employee_opening_balances_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_pay_template_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_pay_template_spec.rb create mode 100644 spec/payroll_nz/models/employee_pay_templates_spec.rb create mode 100644 spec/payroll_nz/models/employee_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_leave_balance_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_leave_balance_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_leave_summary_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_leaves_summaries_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_sick_leave_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_sick_leave_spec.rb create mode 100644 spec/payroll_nz/models/employee_statutory_sick_leaves_spec.rb create mode 100644 spec/payroll_nz/models/employee_tax_object_spec.rb create mode 100644 spec/payroll_nz/models/employee_tax_spec.rb create mode 100644 spec/payroll_nz/models/employees_spec.rb create mode 100644 spec/payroll_nz/models/employment_object_spec.rb create mode 100644 spec/payroll_nz/models/employment_spec.rb create mode 100644 spec/payroll_nz/models/gross_earnings_history_spec.rb create mode 100644 spec/payroll_nz/models/invalid_field_spec.rb create mode 100644 spec/payroll_nz/models/leave_accrual_line_spec.rb create mode 100644 spec/payroll_nz/models/leave_earnings_line_spec.rb create mode 100644 spec/payroll_nz/models/leave_period_spec.rb create mode 100644 spec/payroll_nz/models/leave_periods_spec.rb create mode 100644 spec/payroll_nz/models/leave_type_object_spec.rb create mode 100644 spec/payroll_nz/models/leave_type_spec.rb create mode 100644 spec/payroll_nz/models/leave_types_spec.rb create mode 100644 spec/payroll_nz/models/pagination_spec.rb create mode 100644 spec/payroll_nz/models/pay_run_calendar_object_spec.rb create mode 100644 spec/payroll_nz/models/pay_run_calendar_spec.rb create mode 100644 spec/payroll_nz/models/pay_run_calendars_spec.rb create mode 100644 spec/payroll_nz/models/pay_run_object_spec.rb create mode 100644 spec/payroll_nz/models/pay_run_spec.rb create mode 100644 spec/payroll_nz/models/pay_runs_spec.rb create mode 100644 spec/payroll_nz/models/pay_slip_object_spec.rb create mode 100644 spec/payroll_nz/models/pay_slip_spec.rb create mode 100644 spec/payroll_nz/models/pay_slips_spec.rb create mode 100644 spec/payroll_nz/models/payment_line_spec.rb create mode 100644 spec/payroll_nz/models/payment_method_object_spec.rb create mode 100644 spec/payroll_nz/models/payment_method_spec.rb create mode 100644 spec/payroll_nz/models/problem_spec.rb create mode 100644 spec/payroll_nz/models/reimbursement_line_spec.rb create mode 100644 spec/payroll_nz/models/reimbursement_object_spec.rb create mode 100644 spec/payroll_nz/models/reimbursement_spec.rb create mode 100644 spec/payroll_nz/models/reimbursements_spec.rb create mode 100644 spec/payroll_nz/models/salary_and_wage_object_spec.rb create mode 100644 spec/payroll_nz/models/salary_and_wage_spec.rb create mode 100644 spec/payroll_nz/models/salary_and_wages_spec.rb create mode 100644 spec/payroll_nz/models/settings_spec.rb create mode 100644 spec/payroll_nz/models/statutory_deduction_category_spec.rb create mode 100644 spec/payroll_nz/models/statutory_deduction_line_spec.rb create mode 100644 spec/payroll_nz/models/statutory_deduction_object_spec.rb create mode 100644 spec/payroll_nz/models/statutory_deduction_spec.rb create mode 100644 spec/payroll_nz/models/statutory_deductions_spec.rb create mode 100644 spec/payroll_nz/models/superannuation_line_spec.rb create mode 100644 spec/payroll_nz/models/superannuation_object_spec.rb create mode 100644 spec/payroll_nz/models/superannuations_spec.rb create mode 100644 spec/payroll_nz/models/tax_code_spec.rb create mode 100644 spec/payroll_nz/models/tax_line_spec.rb create mode 100644 spec/payroll_nz/models/tax_settings_spec.rb create mode 100644 spec/payroll_nz/models/timesheet_earnings_line_spec.rb create mode 100644 spec/payroll_nz/models/timesheet_line_object_spec.rb create mode 100644 spec/payroll_nz/models/timesheet_line_spec.rb create mode 100644 spec/payroll_nz/models/timesheet_object_spec.rb create mode 100644 spec/payroll_nz/models/timesheet_spec.rb create mode 100644 spec/payroll_nz/models/timesheets_spec.rb create mode 100644 spec/payroll_nz/models/tracking_categories_spec.rb create mode 100644 spec/payroll_nz/models/tracking_category_spec.rb create mode 100644 spec/payroll_uk/api/payroll_uk_api_spec.rb create mode 100644 spec/payroll_uk/models/account_spec.rb create mode 100644 spec/payroll_uk/models/accounts_spec.rb create mode 100644 spec/payroll_uk/models/address_spec.rb create mode 100644 spec/payroll_uk/models/bank_account_spec.rb create mode 100644 spec/payroll_uk/models/benefit_line_spec.rb create mode 100644 spec/payroll_uk/models/benefit_object_spec.rb create mode 100644 spec/payroll_uk/models/benefit_spec.rb create mode 100644 spec/payroll_uk/models/benefits_spec.rb create mode 100644 spec/payroll_uk/models/court_order_line_spec.rb create mode 100644 spec/payroll_uk/models/deduction_line_spec.rb create mode 100644 spec/payroll_uk/models/deduction_object_spec.rb create mode 100644 spec/payroll_uk/models/deduction_spec.rb create mode 100644 spec/payroll_uk/models/deductions_spec.rb create mode 100644 spec/payroll_uk/models/earnings_line_spec.rb create mode 100644 spec/payroll_uk/models/earnings_order_object_spec.rb create mode 100644 spec/payroll_uk/models/earnings_order_spec.rb create mode 100644 spec/payroll_uk/models/earnings_orders_spec.rb create mode 100644 spec/payroll_uk/models/earnings_rate_object_spec.rb create mode 100644 spec/payroll_uk/models/earnings_rate_spec.rb create mode 100644 spec/payroll_uk/models/earnings_rates_spec.rb create mode 100644 spec/payroll_uk/models/earnings_template_object_spec.rb create mode 100644 spec/payroll_uk/models/earnings_template_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_balance_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_balances_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_type_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_type_spec.rb create mode 100644 spec/payroll_uk/models/employee_leave_types_spec.rb create mode 100644 spec/payroll_uk/models/employee_leaves_spec.rb create mode 100644 spec/payroll_uk/models/employee_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_opening_balances_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_opening_balances_spec.rb create mode 100644 spec/payroll_uk/models/employee_pay_template_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_pay_template_spec.rb create mode 100644 spec/payroll_uk/models/employee_pay_templates_spec.rb create mode 100644 spec/payroll_uk/models/employee_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_leave_balance_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_leave_balance_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_leave_summary_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_leaves_summaries_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_sick_leave_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_sick_leave_spec.rb create mode 100644 spec/payroll_uk/models/employee_statutory_sick_leaves_spec.rb create mode 100644 spec/payroll_uk/models/employee_tax_object_spec.rb create mode 100644 spec/payroll_uk/models/employee_tax_spec.rb create mode 100644 spec/payroll_uk/models/employees_spec.rb create mode 100644 spec/payroll_uk/models/employment_object_spec.rb create mode 100644 spec/payroll_uk/models/employment_spec.rb create mode 100644 spec/payroll_uk/models/invalid_field_spec.rb create mode 100644 spec/payroll_uk/models/leave_accrual_line_spec.rb create mode 100644 spec/payroll_uk/models/leave_earnings_line_spec.rb create mode 100644 spec/payroll_uk/models/leave_period_spec.rb create mode 100644 spec/payroll_uk/models/leave_periods_spec.rb create mode 100644 spec/payroll_uk/models/leave_type_object_spec.rb create mode 100644 spec/payroll_uk/models/leave_type_spec.rb create mode 100644 spec/payroll_uk/models/leave_types_spec.rb create mode 100644 spec/payroll_uk/models/pagination_spec.rb create mode 100644 spec/payroll_uk/models/pay_run_calendar_object_spec.rb create mode 100644 spec/payroll_uk/models/pay_run_calendar_spec.rb create mode 100644 spec/payroll_uk/models/pay_run_calendars_spec.rb create mode 100644 spec/payroll_uk/models/pay_run_object_spec.rb create mode 100644 spec/payroll_uk/models/pay_run_spec.rb create mode 100644 spec/payroll_uk/models/pay_runs_spec.rb create mode 100644 spec/payroll_uk/models/payment_line_spec.rb create mode 100644 spec/payroll_uk/models/payment_method_object_spec.rb create mode 100644 spec/payroll_uk/models/payment_method_spec.rb create mode 100644 spec/payroll_uk/models/payslip_object_spec.rb create mode 100644 spec/payroll_uk/models/payslip_spec.rb create mode 100644 spec/payroll_uk/models/payslips_spec.rb create mode 100644 spec/payroll_uk/models/problem_spec.rb create mode 100644 spec/payroll_uk/models/reimbursement_line_spec.rb create mode 100644 spec/payroll_uk/models/reimbursement_object_spec.rb create mode 100644 spec/payroll_uk/models/reimbursement_spec.rb create mode 100644 spec/payroll_uk/models/reimbursements_spec.rb create mode 100644 spec/payroll_uk/models/salary_and_wage_object_spec.rb create mode 100644 spec/payroll_uk/models/salary_and_wage_spec.rb create mode 100644 spec/payroll_uk/models/salary_and_wages_spec.rb create mode 100644 spec/payroll_uk/models/settings_spec.rb create mode 100644 spec/payroll_uk/models/statutory_deduction_category_spec.rb create mode 100644 spec/payroll_uk/models/statutory_deduction_spec.rb create mode 100644 spec/payroll_uk/models/tax_line_spec.rb create mode 100644 spec/payroll_uk/models/timesheet_earnings_line_spec.rb create mode 100644 spec/payroll_uk/models/timesheet_line_object_spec.rb create mode 100644 spec/payroll_uk/models/timesheet_line_spec.rb create mode 100644 spec/payroll_uk/models/timesheet_object_spec.rb create mode 100644 spec/payroll_uk/models/timesheet_spec.rb create mode 100644 spec/payroll_uk/models/timesheets_spec.rb create mode 100644 spec/payroll_uk/models/tracking_categories_spec.rb create mode 100644 spec/payroll_uk/models/tracking_category_spec.rb diff --git a/README.md b/README.md index f454e1dc..c65473c8 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,23 @@ Xero Ruby SDK for OAuth 2.0 generated from [Xero API OpenAPI Spec](https://githu # Documentation Xero Ruby SDK supports Xero's OAuth2.0 authentication and supports the following Xero API sets. -## APIS +## API Client Docs * [Accounting Api Docs](/docs/accounting/AccountingApi.md) * [Asset Api Docs](/docs/assets/AssetApi.md) * [Project Api Docs](docs/projects/ProjectApi.md) +* [File Api Docs](docs/files/FileApi.md) +* [Payroll Docs (AU)](docs/payroll_au/PayrollAuApi.md) +* [Payroll Docs (NZ)](docs/payroll_nz/PayrollNzApi.md) +* [Payroll Docs (UK)](docs/payroll_uk/PayrollUkApi.md) -## Models +## API Model Docs * [Accounting Models Docs](/docs/accounting/) * [Asset Models Docs](/docs/assets/) * [Project Models Docs](/docs/projects/) - -### Coming soon -* payroll (AU) -* payroll (NZ/UK) -* files -* xero hq -* bank feeds +* [File Models Docs](/docs/files/) +* [Payroll Models (AU)](docs/payroll_au/) +* [Payroll Models (NZ)](docs/payroll_nz/) +* [Payroll Models (UK)](docs/payroll_uk/) ## Sample Apps We have two apps showing SDK usage. @@ -117,7 +118,8 @@ Refresh/connection helpers ```ruby @token_set = xero_client.refresh_token_set(user.token_set) -# Xero's tokens can potentially facilitate (n) org connections in a single token. It is important to store the `tenantId` of the Organisation your user wants to read/write data. +# Xero's tokens can potentially facilitate (n) org connections in a single token. +# It is important to store the `tenantId` of the Organisation your user wants to read/write data. # The `updatedDateUtc` will show you the most recently authorized Tenant (AKA Organisation) connections = xero_client.connections @@ -130,7 +132,8 @@ connections = xero_client.connections "updatedDateUtc" => "2020-04-15T22:37:10.4943410" }] -# disconnect an org from a user's connections. Pass the connection ['id'] not ['tenantId']. Useful if you want to enforce only a single org connection per token. +# disconnect an org from a user's connections. Pass the connection ['id'] not ['tenantId']. +# Useful if you want to enforce only a single org connection per token. remaining_connections = xero_client.disconnect(connections[0]['id']) # set a refreshed token_set @@ -155,6 +158,8 @@ end ``` ## API Usage + +### Accounting API ```ruby require 'xero-ruby' @@ -185,21 +190,58 @@ end } file = File.read(Rails.root.join('app/assets/images/xero-api.png')) attachment = xero_client.accounting_api.create_account_attachment_by_file_name(tenant_id, @account.account_id, file_name, file, opts) +``` - # https://github.com/XeroAPI/xero-ruby/blob/master/accounting/lib/xero-ruby/api/asset_api.rb +### Assets API +```ruby +# https://github.com/XeroAPI/xero-ruby/blob/master/accounting/lib/xero-ruby/api/asset_api.rb - # Create Asset - asset = { - "assetName": "AssetName: #{rand(10000)}", - "assetNumber": "Asset: #{rand(10000)}", - "assetStatus": "DRAFT" - } - asset = xero_client.asset_api.create_asset(tenant_id, asset) +# Create Asset +asset = { + "assetName": "AssetName: #{rand(10000)}", + "assetNumber": "Asset: #{rand(10000)}", + "assetStatus": "DRAFT" +} +asset = xero_client.asset_api.create_asset(tenant_id, asset) +``` + +### Project API +```ruby +# https://github.com/XeroAPI/xero-ruby/blob/master/docs/projects/ProjectApi.md + +# Get Projects +projects = xero_client.project_api.get_projects(tenant_id).items +``` + +### Files API +```ruby +# https://github.com/XeroAPI/xero-ruby/blob/master/docs/files/FileApi.md + +# Get Files +opts = { + pagesize: 50, # Integer | pass an optional page size value + page: 2, # Integer | number of records to skip for pagination + sort: 'CreatedDateUTC DESC' # String | values to sort by +} + +files = xero_client.files_api.get_files(tenant_id, opts).files +``` + +### Payroll API(s) +```ruby +# https://github.com/XeroAPI/xero-ruby/blob/master/docs/payroll_au/PayrollAuApi.md +employee_id = 'employee_uuid' +employee = xero_client.payroll_au_api.get_employee(tenant_id, employee_id).employee + + +# https://github.com/XeroAPI/xero-ruby/blob/master/docs/payroll_nz/PayrollNzApi.md +timesheet_id = 'timesheeet_uuid' +timesheet = xero_client.payroll_nz_api.approve_timesheet(tenant_id, timesheet_id).timesheets - # https://github.com/XeroAPI/xero-ruby/blob/master/docs/projects/ProjectApi.md - # Get Projects - projects = xero_client.project_api.get_projects(tenant_id).items +# https://github.com/XeroAPI/xero-ruby/blob/master/docs/payroll_uk/PayrollUkApi.md +employee_id = 'employee_uuid' +wages = xero_client.payroll_uk_api.get_employee_salary_and_wages(tenant_id, employee_id, opts).salary_and_wages ``` ## BigDecimal diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index d6e58c02..b304582c 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -35,6 +35,7 @@ Method | HTTP request | Description [**create_items**](AccountingApi.md#create_items) | **PUT** /Items | Allows you to create one or more items [**create_linked_transaction**](AccountingApi.md#create_linked_transaction) | **PUT** /LinkedTransactions | Allows you to create linked transactions (billable expenses) [**create_manual_journal_attachment_by_file_name**](AccountingApi.md#create_manual_journal_attachment_by_file_name) | **PUT** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to create a specified Attachment on ManualJournal by file name +[**create_manual_journal_history_record**](AccountingApi.md#create_manual_journal_history_record) | **PUT** /ManualJournals/{ManualJournalID}/History | Allows you to create history record for a manual journal [**create_manual_journals**](AccountingApi.md#create_manual_journals) | **PUT** /ManualJournals | Allows you to create one or more manual journals [**create_overpayment_allocations**](AccountingApi.md#create_overpayment_allocations) | **PUT** /Overpayments/{OverpaymentID}/Allocations | Allows you to create a single allocation for an overpayment [**create_overpayment_history**](AccountingApi.md#create_overpayment_history) | **PUT** /Overpayments/{OverpaymentID}/History | Allows you to create history records of an Overpayment @@ -44,6 +45,7 @@ Method | HTTP request | Description [**create_payments**](AccountingApi.md#create_payments) | **PUT** /Payments | Allows you to create multiple payments for invoices or credit notes [**create_prepayment_allocations**](AccountingApi.md#create_prepayment_allocations) | **PUT** /Prepayments/{PrepaymentID}/Allocations | Allows you to create an Allocation for prepayments [**create_prepayment_history**](AccountingApi.md#create_prepayment_history) | **PUT** /Prepayments/{PrepaymentID}/History | Allows you to create a history record for an Prepayment +[**create_purchase_order_attachment_by_file_name**](AccountingApi.md#create_purchase_order_attachment_by_file_name) | **PUT** /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName} | Allows you to create Attachment on Purchase Order [**create_purchase_order_history**](AccountingApi.md#create_purchase_order_history) | **PUT** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to create HistoryRecord for purchase orders [**create_purchase_orders**](AccountingApi.md#create_purchase_orders) | **PUT** /PurchaseOrders | Allows you to create one or more purchase orders [**create_quote_attachment_by_file_name**](AccountingApi.md#create_quote_attachment_by_file_name) | **PUT** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to create Attachment on Quote @@ -131,7 +133,9 @@ Method | HTTP request | Description [**get_manual_journal_attachment_by_id**](AccountingApi.md#get_manual_journal_attachment_by_id) | **GET** /ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} | Allows you to retrieve specified Attachment on ManualJournals [**get_manual_journal_attachments**](AccountingApi.md#get_manual_journal_attachments) | **GET** /ManualJournals/{ManualJournalID}/Attachments | Allows you to retrieve Attachment for manual journals [**get_manual_journals**](AccountingApi.md#get_manual_journals) | **GET** /ManualJournals | Allows you to retrieve any manual journals +[**get_manual_journals_history**](AccountingApi.md#get_manual_journals_history) | **GET** /ManualJournals/{ManualJournalID}/History | Allows you to retrieve history from a manual journal [**get_online_invoice**](AccountingApi.md#get_online_invoice) | **GET** /Invoices/{InvoiceID}/OnlineInvoice | Allows you to retrieve a URL to an online invoice +[**get_organisation_actions**](AccountingApi.md#get_organisation_actions) | **GET** /Organisation/Actions | Retrieve a list of the key actions your app has permission to perform in the connected organisation. [**get_organisation_cis_settings**](AccountingApi.md#get_organisation_cis_settings) | **GET** /Organisation/{OrganisationID}/CISSettings | Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. [**get_organisations**](AccountingApi.md#get_organisations) | **GET** /Organisation | Allows you to retrieve Organisation details [**get_overpayment**](AccountingApi.md#get_overpayment) | **GET** /Overpayments/{OverpaymentID} | Allows you to retrieve a specified overpayments @@ -146,6 +150,9 @@ Method | HTTP request | Description [**get_prepayments**](AccountingApi.md#get_prepayments) | **GET** /Prepayments | Allows you to retrieve prepayments [**get_purchase_order**](AccountingApi.md#get_purchase_order) | **GET** /PurchaseOrders/{PurchaseOrderID} | Allows you to retrieve a specified purchase orders [**get_purchase_order_as_pdf**](AccountingApi.md#get_purchase_order_as_pdf) | **GET** /PurchaseOrders/{PurchaseOrderID}/pdf | Allows you to retrieve purchase orders as PDF files +[**get_purchase_order_attachment_by_file_name**](AccountingApi.md#get_purchase_order_attachment_by_file_name) | **GET** /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName} | Allows you to retrieve Attachment on a Purchase Order by Filename +[**get_purchase_order_attachment_by_id**](AccountingApi.md#get_purchase_order_attachment_by_id) | **GET** /PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on purchase order +[**get_purchase_order_attachments**](AccountingApi.md#get_purchase_order_attachments) | **GET** /PurchaseOrders/{PurchaseOrderID}/Attachments | Allows you to retrieve attachments for purchase orders [**get_purchase_order_by_number**](AccountingApi.md#get_purchase_order_by_number) | **GET** /PurchaseOrders/{PurchaseOrderNumber} | Allows you to retrieve a specified purchase orders [**get_purchase_order_history**](AccountingApi.md#get_purchase_order_history) | **GET** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to retrieve history for PurchaseOrder [**get_purchase_orders**](AccountingApi.md#get_purchase_orders) | **GET** /PurchaseOrders | Allows you to retrieve purchase orders @@ -211,6 +218,7 @@ Method | HTTP request | Description [**update_or_create_purchase_orders**](AccountingApi.md#update_or_create_purchase_orders) | **POST** /PurchaseOrders | Allows you to update or create one or more purchase orders [**update_or_create_quotes**](AccountingApi.md#update_or_create_quotes) | **POST** /Quotes | Allows you to update OR create one or more quotes [**update_purchase_order**](AccountingApi.md#update_purchase_order) | **POST** /PurchaseOrders/{PurchaseOrderID} | Allows you to update a specified purchase order +[**update_purchase_order_attachment_by_file_name**](AccountingApi.md#update_purchase_order_attachment_by_file_name) | **POST** /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName} | Allows you to update Attachment on Purchase Order by Filename [**update_quote**](AccountingApi.md#update_quote) | **POST** /Quotes/{QuoteID} | Allows you to update a specified quote [**update_quote_attachment_by_file_name**](AccountingApi.md#update_quote_attachment_by_file_name) | **POST** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to update Attachment on Quote by Filename [**update_receipt**](AccountingApi.md#update_receipt) | **POST** /Receipts/{ReceiptID} | Allows you to retrieve a specified draft expense claim receipts @@ -246,13 +254,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + account = { code: "123456", name: "Foobar", type: XeroRuby::Accounting::AccountType::EXPENSE, description: "Hello World" } begin @@ -310,13 +316,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -380,13 +384,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -450,13 +452,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -518,13 +518,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" } ], bank_account: { code: "000" }}]} opts = { @@ -590,13 +588,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + bank_transfers = { bank_transfers: [{ from_bank_account: { code: "000", account_id: "00000000-0000-0000-000-000000000000" }, to_bank_account: { code: "001", account_id: "00000000-0000-0000-000-000000000000" }, amount: "50.00" }]} begin @@ -654,13 +650,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -723,13 +717,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -790,13 +782,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + batch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }}]}]} opts = { @@ -859,13 +849,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -927,13 +915,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + payment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } begin @@ -992,13 +978,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1061,13 +1045,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + contact_groups = { contact_groups: [{ name: "VIPs" }]} begin @@ -1125,13 +1107,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + contacts = { contacts: [{ contact_id: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contact_id: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} begin @@ -1190,13 +1170,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1258,13 +1236,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + contacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::DAYSAFTERBILLMONTH }}}]} opts = { @@ -1327,13 +1303,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + allocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} opts = { @@ -1397,13 +1371,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1472,13 +1444,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1540,13 +1510,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { @@ -1612,13 +1580,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + currency = { code: XeroRuby::Accounting::CurrencyCode::USD, description: "United States Dollar" } begin @@ -1675,13 +1641,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + employees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { @@ -1744,13 +1708,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1812,13 +1774,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::SUBMITTED, user: { user_id: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receipt_id: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", line_items: [], contact: {}, user: {}, date: "2018-01-01" }]}]} begin @@ -1876,13 +1836,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -1951,13 +1909,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2019,13 +1975,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { @@ -2091,13 +2045,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2159,13 +2111,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + items = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventory_asset_account_code: "140", purchase_details: { cogs_account_code: "500" }}]} opts = { @@ -2231,13 +2181,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + linked_transaction = { source_transaction_id: "00000000-0000-0000-000-000000000000", source_line_item_id: "00000000-0000-0000-000-000000000000" } begin @@ -2295,13 +2243,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2341,6 +2287,72 @@ Name | Type | Description | Notes - **Accept**: application/json +## create_manual_journal_history_record + +> HistoryRecords create_manual_journal_history_record(xero_tenant_id, manual_journal_id, history_records) + +Allows you to create history record for a manual journal + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a manual journal +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create history record for a manual journal + result = api_instance.create_manual_journal_history_record(xero_tenant_id, manual_journal_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_manual_journal_history_record: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Xero generated unique identifier for a manual journal | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_manual_journals > ManualJournals create_manual_journals(xero_tenant_id, manual_journals, opts) @@ -2365,13 +2377,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" }, { line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} opts = { @@ -2434,13 +2444,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 1.0, date: "2019-03-12" }]} opts = { @@ -2504,13 +2512,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2572,13 +2578,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + invoice = { invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } begin @@ -2636,13 +2640,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2704,13 +2706,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + payment_services = { payment_services: [{ payment_service_name: "PayUpNow", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Time To Pay" }]} begin @@ -2768,13 +2768,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + payments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} opts = { @@ -2837,13 +2835,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} opts = { @@ -2907,13 +2903,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -2951,6 +2945,74 @@ Name | Type | Description | Notes - **Accept**: application/json +## create_purchase_order_attachment_by_file_name + +> Attachments create_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body) + +Allows you to create Attachment on Purchase Order + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Purchase Order object +file_name = 'xero-dev.png' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create Attachment on Purchase Order + result = api_instance.create_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_purchase_order_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for Purchase Order object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + ## create_purchase_order_history > HistoryRecords create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) @@ -2975,13 +3037,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3043,13 +3103,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, account_code: "710" }], date: "2019-03-13" }]} opts = { @@ -3112,13 +3170,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3182,13 +3238,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3250,13 +3304,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date:"2020-02-01" }]} opts = { @@ -3319,13 +3371,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + receipts = { receipts: [ { contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], user: { user_id: "00000000-0000-0000-000-000000000000" }, line_amount_types: XeroRuby::Accounting::INCLUSIVE, status: XeroRuby::Accounting::Receipt::DRAFT, date: nil }]} opts = { @@ -3388,13 +3438,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3458,13 +3506,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3526,13 +3572,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3596,13 +3640,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3664,13 +3706,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + tax_rates = { tax_rates: [{ name: "CA State Tax", tax_components: [{ name: "State Tax", rate: 2.25 }]}]} begin @@ -3728,13 +3768,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3794,13 +3832,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3862,13 +3898,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3928,13 +3962,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -3995,13 +4027,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4060,13 +4090,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4125,13 +4153,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4190,13 +4216,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4258,13 +4282,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4324,13 +4346,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4392,13 +4412,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4459,13 +4477,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4525,13 +4541,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4595,13 +4609,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4665,13 +4677,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4731,13 +4741,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4806,13 +4814,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4877,13 +4883,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -4947,13 +4951,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5017,13 +5019,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5083,13 +5083,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5164,16 +5162,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] +api_instance = xero_client. -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction begin #Allows you to retrieve history from a bank transactions @@ -5230,13 +5226,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5296,13 +5290,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5366,13 +5358,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5436,13 +5426,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5502,13 +5490,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5568,13 +5554,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5643,13 +5627,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5709,13 +5691,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5784,13 +5764,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5850,13 +5828,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5916,13 +5892,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -5980,13 +5954,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6046,13 +6018,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6116,13 +6086,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6186,13 +6154,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6252,13 +6218,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6318,13 +6282,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6384,13 +6346,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6450,13 +6410,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6522,13 +6480,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6588,13 +6544,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6672,13 +6626,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6743,13 +6695,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6809,13 +6759,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6879,13 +6827,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -6949,13 +6895,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7015,13 +6959,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7081,13 +7023,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7162,13 +7102,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7234,13 +7172,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7300,13 +7236,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7375,13 +7309,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7441,13 +7373,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7507,13 +7437,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7582,13 +7510,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7653,13 +7579,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7719,13 +7643,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7789,13 +7711,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7859,13 +7779,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7925,13 +7843,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -7991,13 +7907,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8055,13 +7969,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8154,13 +8066,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8225,13 +8135,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8291,13 +8199,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8369,13 +8275,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8435,13 +8339,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8510,13 +8412,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8576,13 +8476,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8660,13 +8558,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8726,13 +8622,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8796,13 +8690,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8866,13 +8758,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8932,13 +8822,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -8986,6 +8874,70 @@ Name | Type | Description | Notes - **Accept**: application/json +## get_manual_journals_history + +> HistoryRecords get_manual_journals_history(xero_tenant_id, manual_journal_id) + +Allows you to retrieve history from a manual journal + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a manual journal +begin + #Allows you to retrieve history from a manual journal + result = api_instance.get_manual_journals_history(xero_tenant_id, manual_journal_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journals_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Xero generated unique identifier for a manual journal | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## get_online_invoice > OnlineInvoices get_online_invoice(xero_tenant_id, invoice_id) @@ -9010,13 +8962,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9052,6 +9002,68 @@ Name | Type | Description | Notes - **Accept**: application/json +## get_organisation_actions + +> Actions get_organisation_actions(xero_tenant_id) + +Retrieve a list of the key actions your app has permission to perform in the connected organisation. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Retrieve a list of the key actions your app has permission to perform in the connected organisation. + result = api_instance.get_organisation_actions(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_organisation_actions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Actions**](Actions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## get_organisation_cis_settings > CISOrgSetting get_organisation_cis_settings(xero_tenant_id, organisation_id) @@ -9076,13 +9088,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9142,13 +9152,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9206,13 +9214,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9272,13 +9278,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9338,13 +9342,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9419,13 +9421,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9485,13 +9485,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9551,13 +9549,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9615,13 +9611,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9693,13 +9687,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9759,13 +9751,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -9825,34 +9815,230 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: "Status==#{XeroRuby::Accounting::Prepayment::AUTHORISED}", # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::Prepayment::AUTHORISED}", # String | Filter by an any element + + order: 'Reference ASC', # String | Order by an any element + + page: 1, # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve prepayments + result = api_instance.get_prepayments(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_prepayments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Prepayments**](Prepayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_order + +> PurchaseOrders get_purchase_order(xero_tenant_id, purchase_order_id) + +Allows you to retrieve a specified purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +begin + #Allows you to retrieve a specified purchase orders + result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_order_as_pdf + +> File get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + +Allows you to retrieve purchase orders as PDF files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order +begin + #Allows you to retrieve purchase orders as PDF files + result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for an Purchase Order | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf + + +## get_purchase_order_attachment_by_file_name + +> File get_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, content_type) + +Allows you to retrieve Attachment on a Purchase Order by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] - order: 'Reference ASC', # String | Order by an any element +api_instance = xero_client. - page: 1, # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Purchase Order object +file_name = 'xero-dev.jpg' # String | Name of the attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf begin - #Allows you to retrieve prepayments - result = api_instance.get_prepayments(xero_tenant_id, opts) + #Allows you to retrieve Attachment on a Purchase Order by Filename + result = api_instance.get_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_prepayments: #{e}" + puts "Exception when calling AccountingApi->get_purchase_order_attachment_by_file_name: #{e}" end ``` @@ -9862,15 +10048,13 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + **purchase_order_id** | [**String**](.md)| Unique identifier for Purchase Order object | + **file_name** | **String**| Name of the attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | ### Return type -[**Prepayments**](Prepayments.md) +**File** ### Authorization @@ -9879,14 +10063,14 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/octet-stream -## get_purchase_order +## get_purchase_order_attachment_by_id -> PurchaseOrders get_purchase_order(xero_tenant_id, purchase_order_id) +> File get_purchase_order_attachment_by_id(xero_tenant_id, purchase_order_id, attachment_id, content_type) -Allows you to retrieve a specified purchase orders +Allows you to retrieve specific Attachment on purchase order ### Example @@ -9906,23 +10090,23 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Purchase Order object +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf begin - #Allows you to retrieve a specified purchase orders - result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) + #Allows you to retrieve specific Attachment on purchase order + result = api_instance.get_purchase_order_attachment_by_id(xero_tenant_id, purchase_order_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order: #{e}" + puts "Exception when calling AccountingApi->get_purchase_order_attachment_by_id: #{e}" end ``` @@ -9932,11 +10116,13 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + **purchase_order_id** | [**String**](.md)| Unique identifier for Purchase Order object | + **attachment_id** | [**String**](.md)| Unique identifier for Attachment object | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | ### Return type -[**PurchaseOrders**](PurchaseOrders.md) +**File** ### Authorization @@ -9945,14 +10131,14 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/octet-stream -## get_purchase_order_as_pdf +## get_purchase_order_attachments -> File get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) +> Attachments get_purchase_order_attachments(xero_tenant_id, purchase_order_id) -Allows you to retrieve purchase orders as PDF files +Allows you to retrieve attachments for purchase orders ### Example @@ -9972,23 +10158,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Purchase Orders object begin - #Allows you to retrieve purchase orders as PDF files - result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + #Allows you to retrieve attachments for purchase orders + result = api_instance.get_purchase_order_attachments(xero_tenant_id, purchase_order_id) p result rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" + puts "Exception when calling AccountingApi->get_purchase_order_attachments: #{e}" end ``` @@ -9998,11 +10182,11 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for an Purchase Order | + **purchase_order_id** | [**String**](.md)| Unique identifier for Purchase Orders object | ### Return type -**File** +[**Attachments**](Attachments.md) ### Authorization @@ -10011,7 +10195,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/pdf +- **Accept**: application/json ## get_purchase_order_by_number @@ -10038,13 +10222,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10104,13 +10286,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10170,13 +10350,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10254,13 +10432,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10320,13 +10496,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10386,13 +10560,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10456,13 +10628,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10526,13 +10696,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10592,13 +10760,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10658,13 +10824,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10754,13 +10918,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10825,13 +10987,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10895,13 +11055,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -10965,13 +11123,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11031,13 +11187,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11097,13 +11251,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11175,13 +11327,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11241,13 +11391,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11311,13 +11459,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11381,13 +11527,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11447,13 +11591,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11513,13 +11655,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11585,13 +11725,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11662,13 +11800,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11739,13 +11875,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11805,13 +11939,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11869,13 +12001,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -11956,13 +12086,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12028,13 +12156,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12103,13 +12229,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12172,13 +12296,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12268,13 +12390,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12337,13 +12457,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12409,13 +12527,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12484,13 +12600,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12559,13 +12673,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12625,13 +12737,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12691,13 +12801,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12766,13 +12874,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12834,13 +12940,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -12904,13 +13008,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, date: "2019-02-25", reference: "You just updated", status: XeroRuby::Accounting::BankTransaction::AUTHORISED, bank_transaction_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, bank_account: { account_id: "00000000-0000-0000-000-000000000000" }}]} opts = { @@ -12974,13 +13076,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13044,13 +13144,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13113,13 +13211,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + contacts = { contacts: [{ contact_id: "00000000-0000-0000-000-000000000000", name: "Thanos" }]} begin @@ -13177,13 +13273,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13246,13 +13340,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + contact_groups = { contact_groups: [{ name: "Vendor" }]} begin @@ -13311,13 +13403,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", status: XeroRuby::Accounting::CreditNote::AUTHORISED, reference: "Mind stone", line_items: [{ description: "Infinity Stones", quantity: 1.0, unit_amount: 100.0, account_code: "400" } ]}]} opts = { @@ -13381,13 +13471,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13451,13 +13539,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} begin @@ -13516,13 +13602,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + invoices = { invoices: [{ reference: "I am Iron Man", invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }]} opts = { @@ -13586,13 +13670,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13656,13 +13738,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13729,13 +13809,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + linked_transactions = { linked_transactions: [{ source_line_item_id: "00000000-0000-0000-000-000000000000", contact_id: "00000000-0000-0000-000-000000000000" }]} begin @@ -13794,13 +13872,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + manual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} begin @@ -13859,13 +13935,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -13929,13 +14003,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" }], bank_account: { code: "000" }}]} opts = { @@ -14001,13 +14073,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTHDAYSAFTERBILLMONTH }}}]} opts = { @@ -14070,13 +14140,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { @@ -14142,13 +14210,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + employees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { @@ -14211,13 +14277,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { @@ -14283,13 +14347,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + items = { items: [{ code: "abcXYZ", name: "HelloWorld", description: "Foobar" }]} opts = { @@ -14355,13 +14417,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" },{ line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}] }]} opts = { @@ -14424,13 +14484,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} opts = { @@ -14493,13 +14551,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} opts = { @@ -14562,13 +14618,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + purchase_orders = { purchase_orders: [ { attention_to: "Peter Parker", line_items: [], contact: {} }]} begin @@ -14603,6 +14657,74 @@ Name | Type | Description | Notes - **Accept**: application/json +## update_purchase_order_attachment_by_file_name + +> Attachments update_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body) + +Allows you to update Attachment on Purchase Order by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Purchase Order object +file_name = 'xero-dev.png' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachment on Purchase Order by Filename + result = api_instance.update_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_purchase_order_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for Purchase Order object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + ## update_quote > Quotes update_quote(xero_tenant_id, quote_id, quotes) @@ -14627,13 +14749,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + quotes = { quotes: [{ reference: "I am an update", contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2020-02-01" }]} begin @@ -14692,13 +14812,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -14762,13 +14880,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + receipts = { receipts: [{ user: { user_id: "00000000-0000-0000-000-000000000000" }, reference: "Foobar", date: "2020-01-01", contact: {}, line_items: [] }]} opts = { @@ -14832,13 +14948,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -14902,13 +15016,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -14972,13 +15084,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + tax_rates = { tax_rates: [{ name: "State Tax NY", tax_components: [{ name: "State Tax", rate: 2.25 }], status: XeroRuby::Accounting::TaxRate::Deleted, report_tax_type: XeroRuby::Accounting::TaxRate::INPUT }]} begin @@ -15036,13 +15146,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -15104,13 +15212,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant diff --git a/docs/accounting/Action.md b/docs/accounting/Action.md new file mode 100644 index 00000000..67fe1b0d --- /dev/null +++ b/docs/accounting/Action.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::Action + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the actions for this organisation | [optional] +**status** | **String** | Status of the action for this organisation | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Action.new(name: UseMulticurrency, + status: null) +``` + + diff --git a/docs/accounting/Actions.md b/docs/accounting/Actions.md new file mode 100644 index 00000000..6bea4c5b --- /dev/null +++ b/docs/accounting/Actions.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Actions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | [**Array<Action>**](Action.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Actions.new(actions: null) +``` + + diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md index 40fd33aa..f7de07ae 100644 --- a/docs/assets/AssetApi.md +++ b/docs/assets/AssetApi.md @@ -39,13 +39,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -107,13 +105,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -178,13 +174,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -246,13 +240,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -312,13 +304,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant @@ -378,13 +368,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant diff --git a/docs/files/Association.md b/docs/files/Association.md new file mode 100644 index 00000000..94d27422 --- /dev/null +++ b/docs/files/Association.md @@ -0,0 +1,23 @@ +# XeroRuby::Files::Association + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_id** | **String** | The unique identifier of the file | [optional] +**object_id** | **String** | The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) | [optional] +**object_group** | [**ObjectGroup**](ObjectGroup.md) | | [optional] +**object_type** | [**ObjectType**](ObjectType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::Association.new(file_id: null, + object_id: null, + object_group: null, + object_type: null) +``` + + diff --git a/docs/files/FileObject.md b/docs/files/FileObject.md new file mode 100644 index 00000000..fd766dfe --- /dev/null +++ b/docs/files/FileObject.md @@ -0,0 +1,31 @@ +# XeroRuby::Files::FileObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | TODO | [optional] +**mime_type** | **String** | TODO | [optional] +**size** | **Integer** | TODO | [optional] +**created_date_utc** | **DateTime** | TODO | [optional] +**updated_date_utc** | **DateTime** | TODO | [optional] +**user** | [**User**](User.md) | | [optional] +**id** | **String** | TODO | [optional] +**folder_id** | **String** | TODO | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::FileObject.new(name: File2.jpg, + mime_type: image/jpeg, + size: 3615, + created_date_utc: null, + updated_date_utc: null, + user: null, + id: d290f1ee-6c54-4b01-90e6-d701748f0851, + folder_id: 0f8ccf21-7267-4268-9167-a1e2c40c84c8) +``` + + diff --git a/docs/files/FileResponse204.md b/docs/files/FileResponse204.md new file mode 100644 index 00000000..f365fc4e --- /dev/null +++ b/docs/files/FileResponse204.md @@ -0,0 +1,17 @@ +# XeroRuby::Files::FileResponse204 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | Status response for 204 no content | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::FileResponse204.new(status: null) +``` + + diff --git a/docs/files/Files.md b/docs/files/Files.md new file mode 100644 index 00000000..1119a93f --- /dev/null +++ b/docs/files/Files.md @@ -0,0 +1,23 @@ +# XeroRuby::Files::Files + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_count** | **Integer** | | [optional] +**page** | **Integer** | | [optional] +**per_page** | **Integer** | | [optional] +**items** | [**Array<FileObject>**](FileObject.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::Files.new(total_count: 2, + page: 1, + per_page: 50, + items: null) +``` + + diff --git a/docs/files/FilesApi.md b/docs/files/FilesApi.md new file mode 100644 index 00000000..ad0965f3 --- /dev/null +++ b/docs/files/FilesApi.md @@ -0,0 +1,1116 @@ +# XeroRuby::Files::FilesApi + +All URIs are relative to *https://api.xero.com/files.xro/1.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_file_association**](FilesApi.md#create_file_association) | **POST** /Files/{FileId}/Associations | create a new association +[**create_folder**](FilesApi.md#create_folder) | **POST** /Folders | create a new folder +[**delete_file**](FilesApi.md#delete_file) | **DELETE** /Files/{FileId} | delete a file +[**delete_file_association**](FilesApi.md#delete_file_association) | **DELETE** /Files/{FileId}/Associations/{ObjectId} | create a new association +[**delete_folder**](FilesApi.md#delete_folder) | **DELETE** /Folders/{FolderId} | delete a folder +[**get_associations_by_object**](FilesApi.md#get_associations_by_object) | **GET** /Associations/{ObjectId} | searches files +[**get_file**](FilesApi.md#get_file) | **GET** /Files/{FileId} | searches for file by unique id +[**get_file_associations**](FilesApi.md#get_file_associations) | **GET** /Files/{FileId}/Associations | searches files +[**get_file_content**](FilesApi.md#get_file_content) | **GET** /Files/{FileId}/Content | searches files to retrieve the data +[**get_files**](FilesApi.md#get_files) | **GET** /Files | searches files +[**get_folder**](FilesApi.md#get_folder) | **GET** /Folders/{FolderId} | searches specific folder by id +[**get_folders**](FilesApi.md#get_folders) | **GET** /Folders | searches folder +[**get_inbox**](FilesApi.md#get_inbox) | **GET** /Inbox | searches inbox folder +[**update_file**](FilesApi.md#update_file) | **PUT** /Files/{FileId} | Update a file +[**update_folder**](FilesApi.md#update_folder) | **PUT** /Folders/{FolderId} | update folder +[**upload_file**](FilesApi.md#upload_file) | **POST** /Files | upload an File + + + +## create_file_association + +> Association create_file_association(xero_tenant_id, file_id, opts) + +create a new association + +By passing in the appropriate options, you can create a new folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +opts = { + association: XeroRuby::Files::Association.new # Association | +} + +begin + #create a new association + result = api_instance.create_file_association(xero_tenant_id, file_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->create_file_association: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + **association** | [**Association**](Association.md)| | [optional] + +### Return type + +[**Association**](Association.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_folder + +> Folder create_folder(xero_tenant_id, opts) + +create a new folder + +By passing in the appropriate properties, you can create a new folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + folder: XeroRuby::Files::Folder.new # Folder | +} + +begin + #create a new folder + result = api_instance.create_folder(xero_tenant_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->create_folder: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **folder** | [**Folder**](Folder.md)| | [optional] + +### Return type + +[**Folder**](Folder.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_file + +> FileResponse204 delete_file(xero_tenant_id, file_id) + +delete a file + +Delete a specific file + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +begin + #delete a file + result = api_instance.delete_file(xero_tenant_id, file_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->delete_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + +### Return type + +[**FileResponse204**](FileResponse204.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_file_association + +> FileResponse204 delete_file_association(xero_tenant_id, file_id, object_id) + +create a new association + +By passing in the appropriate options, you can create a new folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Object id for single object +begin + #create a new association + result = api_instance.delete_file_association(xero_tenant_id, file_id, object_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->delete_file_association: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + **object_id** | [**String**](.md)| Object id for single object | + +### Return type + +[**FileResponse204**](FileResponse204.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_folder + +> FileResponse204 delete_folder(xero_tenant_id, folder_id) + +delete a folder + +By passing in the appropriate ID, you can delete a folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Folder id for single object +begin + #delete a folder + result = api_instance.delete_folder(xero_tenant_id, folder_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->delete_folder: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **folder_id** | [**String**](.md)| Folder id for single object | + +### Return type + +[**FileResponse204**](FileResponse204.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_associations_by_object + +> Array<Association> get_associations_by_object(xero_tenant_id, object_id) + +searches files + +By passing in the appropriate options, + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Object id for single object +begin + #searches files + result = api_instance.get_associations_by_object(xero_tenant_id, object_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_associations_by_object: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **object_id** | [**String**](.md)| Object id for single object | + +### Return type + +[**Array<Association>**](Association.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_file + +> FileObject get_file(xero_tenant_id, file_id) + +searches for file by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +begin + #searches for file by unique id + result = api_instance.get_file(xero_tenant_id, file_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + +### Return type + +[**FileObject**](FileObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_file_associations + +> Array<Association> get_file_associations(xero_tenant_id, file_id) + +searches files + +By passing in the appropriate options, + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +begin + #searches files + result = api_instance.get_file_associations(xero_tenant_id, file_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_file_associations: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + +### Return type + +[**Array<Association>**](Association.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_file_content + +> File get_file_content(xero_tenant_id, file_id) + +searches files to retrieve the data + +By passing in the appropriate options, retrieve data for specific file + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +begin + #searches files to retrieve the data + result = api_instance.get_file_content(xero_tenant_id, file_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_file_content: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_files + +> Files get_files(xero_tenant_id, opts) + +searches files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + pagesize: 50, # Integer | pass an optional page size value + + page: 2, # Integer | number of records to skip for pagination + + sort: 'CreatedDateUTC DESC' # String | values to sort by +} + +begin + #searches files + result = api_instance.get_files(xero_tenant_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_files: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pagesize** | **Integer**| pass an optional page size value | [optional] + **page** | **Integer**| number of records to skip for pagination | [optional] + **sort** | **String**| values to sort by | [optional] + +### Return type + +[**Files**](Files.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_folder + +> Folder get_folder(xero_tenant_id, folder_id) + +searches specific folder by id + +By passing in the appropriate ID, you can search for specific folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Folder id for single object +begin + #searches specific folder by id + result = api_instance.get_folder(xero_tenant_id, folder_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_folder: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **folder_id** | [**String**](.md)| Folder id for single object | + +### Return type + +[**Folder**](Folder.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_folders + +> Array<Folder> get_folders(xero_tenant_id, opts) + +searches folder + +By passing in the appropriate options, you can search for available folders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + sort: 'CreatedDateUTC DESC' # String | values to sort by +} + +begin + #searches folder + result = api_instance.get_folders(xero_tenant_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_folders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **sort** | **String**| values to sort by | [optional] + +### Return type + +[**Array<Folder>**](Folder.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_inbox + +> Folder get_inbox(xero_tenant_id) + +searches inbox folder + +Search for the user inbox + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #searches inbox folder + result = api_instance.get_inbox(xero_tenant_id) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->get_inbox: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Folder**](Folder.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_file + +> FileObject update_file(xero_tenant_id, file_id, opts) + +Update a file + +Update properties on a single file + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | File id for single object +opts = { + file_object: XeroRuby::Files::FileObject.new # FileObject | +} + +begin + #Update a file + result = api_instance.update_file(xero_tenant_id, file_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->update_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **file_id** | [**String**](.md)| File id for single object | + **file_object** | [**FileObject**](FileObject.md)| | [optional] + +### Return type + +[**FileObject**](FileObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_folder + +> Folder update_folder(xero_tenant_id, folder_id, folder) + +update folder + +By passing in the appropriate ID and properties, you can update a folder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Folder id for single object +folder = XeroRuby::Files::Folder.new # Folder | +begin + #update folder + result = api_instance.update_folder(xero_tenant_id, folder_id, folder) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->update_folder: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **folder_id** | [**String**](.md)| Folder id for single object | + **folder** | [**Folder**](Folder.md)| | + +### Return type + +[**Folder**](Folder.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## upload_file + +> FileObject upload_file(xero_tenant_id, opts) + +upload an File + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + folder_id: '4ff1e5cc-9835-40d5-bb18-09fdb118db9c', # String | pass an optional folder id to save file to specific folder + + body: 'body_example', # String | + + name: 'name_example', # String | exact name of the file you are uploading + + filename: 'filename_example', # String | + + mime_type: 'mime_type_example' # String | +} + +begin + #upload an File + result = api_instance.upload_file(xero_tenant_id, opts) + p result +rescue XeroRuby::Files::ApiError => e + puts "Exception when calling FilesApi->upload_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **folder_id** | [**String**](.md)| pass an optional folder id to save file to specific folder | [optional] + **body** | **String**| | [optional] + **name** | **String**| exact name of the file you are uploading | [optional] + **filename** | **String**| | [optional] + **mime_type** | **String**| | [optional] + +### Return type + +[**FileObject**](FileObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + diff --git a/docs/files/Folder.md b/docs/files/Folder.md new file mode 100644 index 00000000..e18abb53 --- /dev/null +++ b/docs/files/Folder.md @@ -0,0 +1,25 @@ +# XeroRuby::Files::Folder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the folder | [optional] +**file_count** | **Integer** | The number of files in the folder | [optional] +**email** | **String** | The email address used to email files to the inbox. Only the inbox will have this element. | [optional] +**is_inbox** | **Boolean** | to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. | [optional] +**id** | **String** | Xero unique identifier for a folder Files | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::Folder.new(name: assets, + file_count: 5, + email: foo@bar.com, + is_inbox: true, + id: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c) +``` + + diff --git a/docs/files/Folders.md b/docs/files/Folders.md new file mode 100644 index 00000000..c2f8a465 --- /dev/null +++ b/docs/files/Folders.md @@ -0,0 +1,17 @@ +# XeroRuby::Files::Folders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folders** | [**Array<Folder>**](Folder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::Folders.new(folders: null) +``` + + diff --git a/docs/files/InlineObject.md b/docs/files/InlineObject.md new file mode 100644 index 00000000..42cce349 --- /dev/null +++ b/docs/files/InlineObject.md @@ -0,0 +1,23 @@ +# XeroRuby::Files::InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [optional] +**name** | **String** | exact name of the file you are uploading | [optional] +**filename** | **String** | | [optional] +**mime_type** | **String** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::InlineObject.new(body: null, + name: null, + filename: null, + mime_type: null) +``` + + diff --git a/docs/files/ObjectGroup.md b/docs/files/ObjectGroup.md new file mode 100644 index 00000000..dfd21d8b --- /dev/null +++ b/docs/files/ObjectGroup.md @@ -0,0 +1,16 @@ +# XeroRuby::Files::ObjectGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::ObjectGroup.new() +``` + + diff --git a/docs/files/ObjectType.md b/docs/files/ObjectType.md new file mode 100644 index 00000000..88faaebe --- /dev/null +++ b/docs/files/ObjectType.md @@ -0,0 +1,16 @@ +# XeroRuby::Files::ObjectType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::ObjectType.new() +``` + + diff --git a/docs/files/User.md b/docs/files/User.md new file mode 100644 index 00000000..fa1689cd --- /dev/null +++ b/docs/files/User.md @@ -0,0 +1,29 @@ +# XeroRuby::Files::User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **String** | Xero identifier | [optional] +**email_address** | **String** | Email address of user | [optional] +**first_name** | **String** | First name of user | +**last_name** | **String** | Last name of user | +**updated_date_utc** | **DateTime** | Last name of user | [optional] +**is_subscriber** | **Boolean** | Boolean to indicate if user is the subscriber | [optional] +**organisation_role** | **String** | Boolean to indicate if user is the subscriber | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Files' + +instance = XeroRuby::Files::User.new(user_id: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c, + email_address: john.smith@mail.com, + first_name: John, + last_name: Smith, + updated_date_utc: null, + is_subscriber: true, + organisation_role: STANDARD) +``` + + diff --git a/docs/payroll_au/APIException.md b/docs/payroll_au/APIException.md new file mode 100644 index 00000000..4b55bc85 --- /dev/null +++ b/docs/payroll_au/APIException.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollAu::APIException + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_number** | **Float** | The error number | [optional] +**type** | **String** | The type of error | [optional] +**message** | **String** | The message describing the error | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::APIException.new(error_number: 16, + type: QueryParseException, + message: No property or field 'hi' exists in type 'Employee' (at index 0)) +``` + + diff --git a/docs/payroll_au/Account.md b/docs/payroll_au/Account.md new file mode 100644 index 00000000..885f37d0 --- /dev/null +++ b/docs/payroll_au/Account.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **String** | Xero identifier for accounts | [optional] +**type** | [**AccountType**](AccountType.md) | | [optional] +**code** | **String** | Customer defined account code | [optional] +**name** | **String** | Name of account | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Account.new(account_id: c56b19ef-75bf-45e8-98a4-e699a96609f7, + type: null, + code: 420, + name: General expenses) +``` + + diff --git a/docs/payroll_au/AccountType.md b/docs/payroll_au/AccountType.md new file mode 100644 index 00000000..156ca405 --- /dev/null +++ b/docs/payroll_au/AccountType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::AccountType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::AccountType.new() +``` + + diff --git a/docs/payroll_au/AllowanceType.md b/docs/payroll_au/AllowanceType.md new file mode 100644 index 00000000..8f1d231e --- /dev/null +++ b/docs/payroll_au/AllowanceType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::AllowanceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::AllowanceType.new() +``` + + diff --git a/docs/payroll_au/BankAccount.md b/docs/payroll_au/BankAccount.md new file mode 100644 index 00000000..aa86aa1f --- /dev/null +++ b/docs/payroll_au/BankAccount.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollAu::BankAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statement_text** | **String** | The text that will appear on your employee's bank statement when they receive payment | [optional] +**account_name** | **String** | The name of the account | [optional] +**bsb** | **String** | The BSB number of the account | [optional] +**account_number** | **String** | The account number | [optional] +**remainder** | **Boolean** | If this account is the Remaining bank account | [optional] +**amount** | **BigDecimal** | Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::BankAccount.new(statement_text: Salary, + account_name: James Lebron Savings, + bsb: 122344, + account_number: 345678, + remainder: false, + amount: 200.0) +``` + + diff --git a/docs/payroll_au/CalendarType.md b/docs/payroll_au/CalendarType.md new file mode 100644 index 00000000..7b69dd42 --- /dev/null +++ b/docs/payroll_au/CalendarType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::CalendarType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::CalendarType.new() +``` + + diff --git a/docs/payroll_au/DeductionLine.md b/docs/payroll_au/DeductionLine.md new file mode 100644 index 00000000..01f60081 --- /dev/null +++ b/docs/payroll_au/DeductionLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollAu::DeductionLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deduction_type_id** | **String** | Xero deduction type identifier | +**calculation_type** | [**DeductionTypeCalculationType**](DeductionTypeCalculationType.md) | | +**amount** | **BigDecimal** | Deduction type amount | [optional] +**percentage** | **BigDecimal** | The Percentage of the Deduction | [optional] +**number_of_units** | **BigDecimal** | Deduction number of units | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::DeductionLine.new(deduction_type_id: 59cd9d04-4521-4cc3-93ac-7841651ff407, + calculation_type: null, + amount: 10.0, + percentage: 10.0, + number_of_units: 10.0) +``` + + diff --git a/docs/payroll_au/DeductionType.md b/docs/payroll_au/DeductionType.md new file mode 100644 index 00000000..477f8d5b --- /dev/null +++ b/docs/payroll_au/DeductionType.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollAu::DeductionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the earnings rate (max length = 100) | [optional] +**account_code** | **String** | See Accounts | [optional] +**reduces_tax** | **Boolean** | Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. | [optional] +**reduces_super** | **Boolean** | Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. | [optional] +**is_exempt_from_w1** | **Boolean** | Boolean to determine if the deduction type is reportable or exempt from W1 | [optional] +**deduction_type_id** | **String** | Xero identifier | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**deduction_category** | **String** | | [optional] +**current_record** | **Boolean** | Is the current record | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::DeductionType.new(name: PTO, + account_code: 720, + reduces_tax: false, + reduces_super: false, + is_exempt_from_w1: false, + deduction_type_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + updated_date_utc: /Date(1583967733054+0000)/, + deduction_category: null, + current_record: true) +``` + + diff --git a/docs/payroll_au/DeductionTypeCalculationType.md b/docs/payroll_au/DeductionTypeCalculationType.md new file mode 100644 index 00000000..becbbd96 --- /dev/null +++ b/docs/payroll_au/DeductionTypeCalculationType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::DeductionTypeCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::DeductionTypeCalculationType.new() +``` + + diff --git a/docs/payroll_au/EarningsLine.md b/docs/payroll_au/EarningsLine.md new file mode 100644 index 00000000..5af9ffa3 --- /dev/null +++ b/docs/payroll_au/EarningsLine.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollAu::EarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero unique id for earnings rate | +**calculation_type** | [**EarningsRateCalculationType**](EarningsRateCalculationType.md) | | [optional] +**annual_salary** | **BigDecimal** | Annual salary for earnings line | [optional] +**number_of_units_per_week** | **BigDecimal** | number of units for earning line | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit of the EarningsLine. | [optional] +**normal_number_of_units** | **BigDecimal** | Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" | [optional] +**amount** | **BigDecimal** | Earnings rate amount | [optional] +**number_of_units** | **BigDecimal** | Earnings rate number of units. | [optional] +**fixed_amount** | **BigDecimal** | Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EarningsLine.new(earnings_rate_id: 72e962d1-fcac-4083-8a71-742bb3e7ae14, + calculation_type: null, + annual_salary: 40000.0, + number_of_units_per_week: 38.0, + rate_per_unit: 38.0, + normal_number_of_units: 38.0, + amount: 38.0, + number_of_units: 2.5, + fixed_amount: 2.5) +``` + + diff --git a/docs/payroll_au/EarningsRate.md b/docs/payroll_au/EarningsRate.md new file mode 100644 index 00000000..80853d15 --- /dev/null +++ b/docs/payroll_au/EarningsRate.md @@ -0,0 +1,49 @@ +# XeroRuby::PayrollAu::EarningsRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the earnings rate (max length = 100) | [optional] +**account_code** | **String** | See Accounts | [optional] +**type_of_units** | **String** | Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT | [optional] +**is_exempt_from_tax** | **Boolean** | Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding | [optional] +**is_exempt_from_super** | **Boolean** | See the ATO website for details of which payments are exempt from SGC | [optional] +**is_reportable_as_w1** | **Boolean** | Boolean to determine if the earnings rate is reportable or exempt from W1 | [optional] +**earnings_type** | [**EarningsType**](EarningsType.md) | | [optional] +**earnings_rate_id** | **String** | Xero identifier | [optional] +**rate_type** | [**RateType**](RateType.md) | | [optional] +**rate_per_unit** | **String** | Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. | [optional] +**multiplier** | **BigDecimal** | This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE | [optional] +**accrue_leave** | **Boolean** | Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE | [optional] +**amount** | **BigDecimal** | Optional Amount for FIXEDAMOUNT RateType EarningsRate | [optional] +**employment_termination_payment_type** | [**EmploymentTerminationPaymentType**](EmploymentTerminationPaymentType.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**current_record** | **Boolean** | Is the current record | [optional] +**allowance_type** | [**AllowanceType**](AllowanceType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EarningsRate.new(name: PTO, + account_code: 720, + type_of_units: Fixed, + is_exempt_from_tax: false, + is_exempt_from_super: false, + is_reportable_as_w1: false, + earnings_type: null, + earnings_rate_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + rate_type: null, + rate_per_unit: 10, + multiplier: 1.5, + accrue_leave: false, + amount: 50.3, + employment_termination_payment_type: null, + updated_date_utc: /Date(1583967733054+0000)/, + current_record: true, + allowance_type: null) +``` + + diff --git a/docs/payroll_au/EarningsRateCalculationType.md b/docs/payroll_au/EarningsRateCalculationType.md new file mode 100644 index 00000000..bd29737c --- /dev/null +++ b/docs/payroll_au/EarningsRateCalculationType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EarningsRateCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EarningsRateCalculationType.new() +``` + + diff --git a/docs/payroll_au/EarningsType.md b/docs/payroll_au/EarningsType.md new file mode 100644 index 00000000..ba5a81b6 --- /dev/null +++ b/docs/payroll_au/EarningsType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EarningsType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EarningsType.new() +``` + + diff --git a/docs/payroll_au/Employee.md b/docs/payroll_au/Employee.md new file mode 100644 index 00000000..fb91adf6 --- /dev/null +++ b/docs/payroll_au/Employee.md @@ -0,0 +1,77 @@ +# XeroRuby::PayrollAu::Employee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **String** | First name of employee | +**last_name** | **String** | Last name of employee | +**date_of_birth** | **Date** | Date of birth of the employee (YYYY-MM-DD) | +**home_address** | [**HomeAddress**](HomeAddress.md) | | [optional] +**start_date** | **Date** | Start date for an employee (YYYY-MM-DD) | [optional] +**title** | **String** | Title of the employee | [optional] +**middle_names** | **String** | Middle name(s) of the employee | [optional] +**email** | **String** | The email address for the employee | [optional] +**gender** | **String** | The employee’s gender. See Employee Gender | [optional] +**phone** | **String** | Employee phone number | [optional] +**mobile** | **String** | Employee mobile number | [optional] +**twitter_user_name** | **String** | Employee’s twitter name | [optional] +**is_authorised_to_approve_leave** | **Boolean** | Authorised to approve other employees' leave requests | [optional] +**is_authorised_to_approve_timesheets** | **Boolean** | Authorised to approve timesheets | [optional] +**job_title** | **String** | JobTitle of the employee | [optional] +**classification** | **String** | Employees classification | [optional] +**ordinary_earnings_rate_id** | **String** | Xero unique identifier for earnings rate | [optional] +**payroll_calendar_id** | **String** | Xero unique identifier for payroll calendar for the employee | [optional] +**employee_group_name** | **String** | The Employee Group allows you to report on payroll expenses and liabilities for each group of employees | [optional] +**employee_id** | **String** | Xero unique identifier for an Employee | [optional] +**termination_date** | **Date** | Employee Termination Date (YYYY-MM-DD) | [optional] +**bank_accounts** | [**Array<BankAccount>**](BankAccount.md) | | [optional] +**pay_template** | [**PayTemplate**](PayTemplate.md) | | [optional] +**opening_balances** | [**OpeningBalances**](OpeningBalances.md) | | [optional] +**tax_declaration** | [**TaxDeclaration**](TaxDeclaration.md) | | [optional] +**leave_balances** | [**Array<LeaveBalance>**](LeaveBalance.md) | | [optional] +**leave_lines** | [**Array<LeaveLine>**](LeaveLine.md) | | [optional] +**super_memberships** | [**Array<SuperMembership>**](SuperMembership.md) | | [optional] +**status** | [**EmployeeStatus**](EmployeeStatus.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Employee.new(first_name: Karen, + last_name: Jones, + date_of_birth: /Date(322560000000+0000)/, + home_address: null, + start_date: /Date(320284900000+0000)/, + title: Mrs, + middle_names: Adena, + email: developer@me.com, + gender: F, + phone: 415-555-1212, + mobile: 415-234-5678, + twitter_user_name: xeroapi, + is_authorised_to_approve_leave: false, + is_authorised_to_approve_timesheets: true, + job_title: Manager, + classification: 99383, + ordinary_earnings_rate_id: null, + payroll_calendar_id: 2ee8e5cc-9835-40d5-bb18-09fdb118db9c, + employee_group_name: marketing, + employee_id: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c, + termination_date: /Date(1584662400000+0000)/, + bank_accounts: null, + pay_template: null, + opening_balances: null, + tax_declaration: null, + leave_balances: null, + leave_lines: null, + super_memberships: null, + status: null, + updated_date_utc: /Date(1583967733054+0000)/, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/EmployeeStatus.md b/docs/payroll_au/EmployeeStatus.md new file mode 100644 index 00000000..078b0061 --- /dev/null +++ b/docs/payroll_au/EmployeeStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EmployeeStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EmployeeStatus.new() +``` + + diff --git a/docs/payroll_au/Employees.md b/docs/payroll_au/Employees.md new file mode 100644 index 00000000..d10eae69 --- /dev/null +++ b/docs/payroll_au/Employees.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::Employees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employees** | [**Array<Employee>**](Employee.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Employees.new(employees: null) +``` + + diff --git a/docs/payroll_au/EmploymentBasis.md b/docs/payroll_au/EmploymentBasis.md new file mode 100644 index 00000000..6c7d8528 --- /dev/null +++ b/docs/payroll_au/EmploymentBasis.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EmploymentBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EmploymentBasis.new() +``` + + diff --git a/docs/payroll_au/EmploymentTerminationPaymentType.md b/docs/payroll_au/EmploymentTerminationPaymentType.md new file mode 100644 index 00000000..9c86a7f2 --- /dev/null +++ b/docs/payroll_au/EmploymentTerminationPaymentType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EmploymentTerminationPaymentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EmploymentTerminationPaymentType.new() +``` + + diff --git a/docs/payroll_au/EntitlementFinalPayPayoutType.md b/docs/payroll_au/EntitlementFinalPayPayoutType.md new file mode 100644 index 00000000..58bec50c --- /dev/null +++ b/docs/payroll_au/EntitlementFinalPayPayoutType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::EntitlementFinalPayPayoutType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::EntitlementFinalPayPayoutType.new() +``` + + diff --git a/docs/payroll_au/HomeAddress.md b/docs/payroll_au/HomeAddress.md new file mode 100644 index 00000000..e31cf294 --- /dev/null +++ b/docs/payroll_au/HomeAddress.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollAu::HomeAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_line1** | **String** | Address line 1 for employee home address | +**address_line2** | **String** | Address line 2 for employee home address | [optional] +**city** | **String** | Suburb for employee home address | [optional] +**region** | [**State**](State.md) | | [optional] +**postal_code** | **String** | PostCode for employee home address | [optional] +**country** | **String** | Country of HomeAddress | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::HomeAddress.new(address_line1: 123 Main St, + address_line2: Apt 4, + city: St. Kilda, + region: null, + postal_code: 3182, + country: AUSTRALIA) +``` + + diff --git a/docs/payroll_au/LeaveAccrualLine.md b/docs/payroll_au/LeaveAccrualLine.md new file mode 100644 index 00000000..411fa821 --- /dev/null +++ b/docs/payroll_au/LeaveAccrualLine.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollAu::LeaveAccrualLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | Xero identifier for the Leave type. | [optional] +**number_of_units** | **BigDecimal** | Leave Accrual number of units | [optional] +**auto_calculate** | **Boolean** | If you want to auto calculate leave. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveAccrualLine.new(leave_type_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + number_of_units: 105.5, + auto_calculate: true) +``` + + diff --git a/docs/payroll_au/LeaveApplication.md b/docs/payroll_au/LeaveApplication.md new file mode 100644 index 00000000..87aa2dcc --- /dev/null +++ b/docs/payroll_au/LeaveApplication.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollAu::LeaveApplication + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_application_id** | **String** | The Xero identifier for Payroll Employee | [optional] +**employee_id** | **String** | The Xero identifier for Payroll Employee | [optional] +**leave_type_id** | **String** | The Xero identifier for Leave Type | [optional] +**title** | **String** | The title of the leave | [optional] +**start_date** | **Date** | Start date of the leave (YYYY-MM-DD) | [optional] +**end_date** | **Date** | End date of the leave (YYYY-MM-DD) | [optional] +**description** | **String** | The Description of the Leave | [optional] +**leave_periods** | [**Array<LeavePeriod>**](LeavePeriod.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveApplication.new(leave_application_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + employee_id: fb4ebd68-6568-41eb-96ab-628a0f54b4b8, + leave_type_id: 742998cb-7584-4ecf-aa88-d694f59c50f9, + title: Annual Leave, + start_date: /Date(322560000000+0000)/, + end_date: /Date(322560000000+0000)/, + description: My leave, + leave_periods: null, + updated_date_utc: /Date(1583967733054+0000)/, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/LeaveApplications.md b/docs/payroll_au/LeaveApplications.md new file mode 100644 index 00000000..bc06ce99 --- /dev/null +++ b/docs/payroll_au/LeaveApplications.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::LeaveApplications + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_applications** | [**Array<LeaveApplication>**](LeaveApplication.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveApplications.new(leave_applications: null) +``` + + diff --git a/docs/payroll_au/LeaveBalance.md b/docs/payroll_au/LeaveBalance.md new file mode 100644 index 00000000..3c42d746 --- /dev/null +++ b/docs/payroll_au/LeaveBalance.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::LeaveBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_name** | **String** | The name of the leave type | [optional] +**leave_type_id** | **String** | Identifier of the leave type (see PayItems) | [optional] +**number_of_units** | **BigDecimal** | The balance of the leave available | [optional] +**type_of_units** | **String** | The type of units as specified by the LeaveType (see PayItems) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveBalance.new(leave_name: Annual Leave, + leave_type_id: 544d9292-4329-4512-bfff-a9f15236d776, + number_of_units: 81.2602, + type_of_units: Hours) +``` + + diff --git a/docs/payroll_au/LeaveEarningsLine.md b/docs/payroll_au/LeaveEarningsLine.md new file mode 100644 index 00000000..3bd23f15 --- /dev/null +++ b/docs/payroll_au/LeaveEarningsLine.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollAu::LeaveEarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero identifier | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit of the EarningsLine. | [optional] +**number_of_units** | **BigDecimal** | Earnings rate number of units. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveEarningsLine.new(earnings_rate_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + rate_per_unit: 38.0, + number_of_units: 2.5) +``` + + diff --git a/docs/payroll_au/LeaveLine.md b/docs/payroll_au/LeaveLine.md new file mode 100644 index 00000000..534306c5 --- /dev/null +++ b/docs/payroll_au/LeaveLine.md @@ -0,0 +1,31 @@ +# XeroRuby::PayrollAu::LeaveLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | Xero leave type identifier | [optional] +**calculation_type** | [**LeaveLineCalculationType**](LeaveLineCalculationType.md) | | [optional] +**entitlement_final_pay_payout_type** | [**EntitlementFinalPayPayoutType**](EntitlementFinalPayPayoutType.md) | | [optional] +**employment_termination_payment_type** | [**EmploymentTerminationPaymentType**](EmploymentTerminationPaymentType.md) | | [optional] +**include_superannuation_guarantee_contribution** | **Boolean** | amount of leave line | [optional] +**number_of_units** | **BigDecimal** | Number of units for leave line. | [optional] +**annual_number_of_units** | **BigDecimal** | Hours of leave accrued each year | [optional] +**full_time_number_of_units_per_period** | **BigDecimal** | Normal ordinary earnings number of units for leave line. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveLine.new(leave_type_id: 742998cb-7584-4ecf-aa88-d694f59c50f9, + calculation_type: null, + entitlement_final_pay_payout_type: null, + employment_termination_payment_type: null, + include_superannuation_guarantee_contribution: true, + number_of_units: 2.5, + annual_number_of_units: 2.5, + full_time_number_of_units_per_period: 2.5) +``` + + diff --git a/docs/payroll_au/LeaveLineCalculationType.md b/docs/payroll_au/LeaveLineCalculationType.md new file mode 100644 index 00000000..a0eb69e7 --- /dev/null +++ b/docs/payroll_au/LeaveLineCalculationType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::LeaveLineCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveLineCalculationType.new() +``` + + diff --git a/docs/payroll_au/LeaveLines.md b/docs/payroll_au/LeaveLines.md new file mode 100644 index 00000000..e7fb67c3 --- /dev/null +++ b/docs/payroll_au/LeaveLines.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::LeaveLines + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**Array<LeaveLine>**](LeaveLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveLines.new(employee: null) +``` + + diff --git a/docs/payroll_au/LeavePeriod.md b/docs/payroll_au/LeavePeriod.md new file mode 100644 index 00000000..1701fa12 --- /dev/null +++ b/docs/payroll_au/LeavePeriod.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::LeavePeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number_of_units** | **BigDecimal** | The Number of Units for the leave | [optional] +**pay_period_end_date** | **Date** | The Pay Period End Date (YYYY-MM-DD) | [optional] +**pay_period_start_date** | **Date** | The Pay Period Start Date (YYYY-MM-DD) | [optional] +**leave_period_status** | [**LeavePeriodStatus**](LeavePeriodStatus.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeavePeriod.new(number_of_units: 22.8, + pay_period_end_date: /Date(322560000000+0000)/, + pay_period_start_date: /Date(322560000000+0000)/, + leave_period_status: null) +``` + + diff --git a/docs/payroll_au/LeavePeriodStatus.md b/docs/payroll_au/LeavePeriodStatus.md new file mode 100644 index 00000000..7060a0d6 --- /dev/null +++ b/docs/payroll_au/LeavePeriodStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::LeavePeriodStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeavePeriodStatus.new() +``` + + diff --git a/docs/payroll_au/LeaveType.md b/docs/payroll_au/LeaveType.md new file mode 100644 index 00000000..529e13ce --- /dev/null +++ b/docs/payroll_au/LeaveType.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollAu::LeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the earnings rate (max length = 100) | [optional] +**type_of_units** | **String** | The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate | [optional] +**leave_type_id** | **String** | Xero identifier | [optional] +**normal_entitlement** | **Float** | The number of units the employee is entitled to each year | [optional] +**leave_loading_rate** | **Float** | Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**is_paid_leave** | **Boolean** | Set this to indicate that an employee will be paid when taking this type of leave | [optional] +**show_on_payslip** | **Boolean** | Set this if you want a balance for this leave type to be shown on your employee’s payslips | [optional] +**current_record** | **Boolean** | Is the current record | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveType.new(name: PTO, + type_of_units: Hours, + leave_type_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + normal_entitlement: 152.0, + leave_loading_rate: 2.0, + updated_date_utc: /Date(1583967733054+0000)/, + is_paid_leave: true, + show_on_payslip: true, + current_record: true) +``` + + diff --git a/docs/payroll_au/LeaveTypeContributionType.md b/docs/payroll_au/LeaveTypeContributionType.md new file mode 100644 index 00000000..d52d7e3e --- /dev/null +++ b/docs/payroll_au/LeaveTypeContributionType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::LeaveTypeContributionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::LeaveTypeContributionType.new() +``` + + diff --git a/docs/payroll_au/ManualTaxType.md b/docs/payroll_au/ManualTaxType.md new file mode 100644 index 00000000..e4d58ff3 --- /dev/null +++ b/docs/payroll_au/ManualTaxType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::ManualTaxType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ManualTaxType.new() +``` + + diff --git a/docs/payroll_au/OpeningBalances.md b/docs/payroll_au/OpeningBalances.md new file mode 100644 index 00000000..c4864f61 --- /dev/null +++ b/docs/payroll_au/OpeningBalances.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollAu::OpeningBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**opening_balance_date** | **Date** | Opening Balance Date. (YYYY-MM-DD) | [optional] +**tax** | **String** | Opening Balance tax | [optional] +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**super_lines** | [**Array<SuperLine>**](SuperLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**leave_lines** | [**Array<LeaveLine>**](LeaveLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::OpeningBalances.new(opening_balance_date: /Date(322560000000+0000)/, + tax: 4333d5cd-53a5-4c31-98e5-a8b4e5676b0b, + earnings_lines: null, + deduction_lines: null, + super_lines: null, + reimbursement_lines: null, + leave_lines: null) +``` + + diff --git a/docs/payroll_au/PayItem.md b/docs/payroll_au/PayItem.md new file mode 100644 index 00000000..9ccbde2f --- /dev/null +++ b/docs/payroll_au/PayItem.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::PayItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rates** | [**Array<EarningsRate>**](EarningsRate.md) | | [optional] +**deduction_types** | [**Array<DeductionType>**](DeductionType.md) | | [optional] +**leave_types** | [**Array<LeaveType>**](LeaveType.md) | | [optional] +**reimbursement_types** | [**Array<ReimbursementType>**](ReimbursementType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayItem.new(earnings_rates: null, + deduction_types: null, + leave_types: null, + reimbursement_types: null) +``` + + diff --git a/docs/payroll_au/PayItems.md b/docs/payroll_au/PayItems.md new file mode 100644 index 00000000..1e4d71a5 --- /dev/null +++ b/docs/payroll_au/PayItems.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::PayItems + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_items** | [**PayItem**](PayItem.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayItems.new(pay_items: null) +``` + + diff --git a/docs/payroll_au/PayRun.md b/docs/payroll_au/PayRun.md new file mode 100644 index 00000000..5e83eebe --- /dev/null +++ b/docs/payroll_au/PayRun.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollAu::PayRun + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendar_id** | **String** | Xero identifier for pay run | +**pay_run_id** | **String** | Xero identifier for pay run | [optional] +**pay_run_period_start_date** | **Date** | Period Start Date for the PayRun (YYYY-MM-DD) | [optional] +**pay_run_period_end_date** | **Date** | Period End Date for the PayRun (YYYY-MM-DD) | [optional] +**pay_run_status** | [**PayRunStatus**](PayRunStatus.md) | | [optional] +**payment_date** | **Date** | Payment Date for the PayRun (YYYY-MM-DD) | [optional] +**payslip_message** | **String** | Payslip message for the PayRun | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**payslips** | [**Array<PayslipSummary>**](PayslipSummary.md) | The payslips in the payrun | [optional] +**wages** | **BigDecimal** | The total Wages for the Payrun | [optional] +**deductions** | **BigDecimal** | The total Deductions for the Payrun | [optional] +**tax** | **BigDecimal** | The total Tax for the Payrun | [optional] +**_super** | **BigDecimal** | The total Super for the Payrun | [optional] +**reimbursement** | **BigDecimal** | The total Reimbursements for the Payrun | [optional] +**net_pay** | **BigDecimal** | The total NetPay for the Payrun | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayRun.new(payroll_calendar_id: bfac31bd-ea62-4fc8-a5e7-7965d9504b15, + pay_run_id: bba1d10f-63b1-4692-b5c5-a99f869523a4, + pay_run_period_start_date: /Date(322560000000+0000)/, + pay_run_period_end_date: /Date(322560000000+0000)/, + pay_run_status: null, + payment_date: /Date(322560000000+0000)/, + payslip_message: Thanks for being awesome, + updated_date_utc: /Date(1583967733054+0000)/, + payslips: null, + wages: 1060.5, + deductions: 0.0, + tax: 198.0, + _super: 75.6, + reimbursement: 0.0, + net_pay: 862.5, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/PayRunStatus.md b/docs/payroll_au/PayRunStatus.md new file mode 100644 index 00000000..12fc4ead --- /dev/null +++ b/docs/payroll_au/PayRunStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::PayRunStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayRunStatus.new() +``` + + diff --git a/docs/payroll_au/PayRuns.md b/docs/payroll_au/PayRuns.md new file mode 100644 index 00000000..541bf7d1 --- /dev/null +++ b/docs/payroll_au/PayRuns.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::PayRuns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_runs** | [**Array<PayRun>**](PayRun.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayRuns.new(pay_runs: null) +``` + + diff --git a/docs/payroll_au/PayTemplate.md b/docs/payroll_au/PayTemplate.md new file mode 100644 index 00000000..76b26632 --- /dev/null +++ b/docs/payroll_au/PayTemplate.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollAu::PayTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**super_lines** | [**Array<SuperLine>**](SuperLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**leave_lines** | [**Array<LeaveLine>**](LeaveLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayTemplate.new(earnings_lines: null, + deduction_lines: null, + super_lines: null, + reimbursement_lines: null, + leave_lines: null) +``` + + diff --git a/docs/payroll_au/PaymentFrequencyType.md b/docs/payroll_au/PaymentFrequencyType.md new file mode 100644 index 00000000..ac3b7d87 --- /dev/null +++ b/docs/payroll_au/PaymentFrequencyType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::PaymentFrequencyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PaymentFrequencyType.new() +``` + + diff --git a/docs/payroll_au/PayrollAuApi.md b/docs/payroll_au/PayrollAuApi.md new file mode 100644 index 00000000..26c8f256 --- /dev/null +++ b/docs/payroll_au/PayrollAuApi.md @@ -0,0 +1,2018 @@ +# XeroRuby::PayrollAu::PayrollAuApi + +All URIs are relative to *https://api.xero.com/payroll.xro/1.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_employee**](PayrollAuApi.md#create_employee) | **POST** /Employees | Use this method to create a payroll employee +[**create_leave_application**](PayrollAuApi.md#create_leave_application) | **POST** /LeaveApplications | Use this method to create a Leave Application +[**create_pay_item**](PayrollAuApi.md#create_pay_item) | **POST** /PayItems | Use this method to create a Pay Item +[**create_pay_run**](PayrollAuApi.md#create_pay_run) | **POST** /PayRuns | Use this method to create a PayRun +[**create_payroll_calendar**](PayrollAuApi.md#create_payroll_calendar) | **POST** /PayrollCalendars | Use this method to create a Payroll Calendars +[**create_superfund**](PayrollAuApi.md#create_superfund) | **POST** /Superfunds | Use this method to create a super fund +[**create_timesheet**](PayrollAuApi.md#create_timesheet) | **POST** /Timesheets | Use this method to create a timesheet +[**get_employee**](PayrollAuApi.md#get_employee) | **GET** /Employees/{EmployeeId} | searches for an employee by unique id +[**get_employees**](PayrollAuApi.md#get_employees) | **GET** /Employees | searches employees +[**get_leave_application**](PayrollAuApi.md#get_leave_application) | **GET** /LeaveApplications/{LeaveApplicationId} | searches for an Leave Application by unique id +[**get_leave_applications**](PayrollAuApi.md#get_leave_applications) | **GET** /LeaveApplications | searches Leave Applications +[**get_pay_items**](PayrollAuApi.md#get_pay_items) | **GET** /PayItems | searches Pay Items +[**get_pay_run**](PayrollAuApi.md#get_pay_run) | **GET** /PayRuns/{PayRunID} | searches for an payrun by unique id +[**get_pay_runs**](PayrollAuApi.md#get_pay_runs) | **GET** /PayRuns | searches PayRuns +[**get_payroll_calendar**](PayrollAuApi.md#get_payroll_calendar) | **GET** /PayrollCalendars/{PayrollCalendarID} | searches Payroll Calendars +[**get_payroll_calendars**](PayrollAuApi.md#get_payroll_calendars) | **GET** /PayrollCalendars | searches Payroll Calendars +[**get_payslip**](PayrollAuApi.md#get_payslip) | **GET** /Payslip/{PayslipID} | searches for an payslip by unique id +[**get_settings**](PayrollAuApi.md#get_settings) | **GET** /Settings | retrieve settings +[**get_superfund**](PayrollAuApi.md#get_superfund) | **GET** /Superfunds/{SuperFundID} | searches for an Superfund by unique id +[**get_superfund_products**](PayrollAuApi.md#get_superfund_products) | **GET** /SuperfundProducts | searches SuperfundProducts +[**get_superfunds**](PayrollAuApi.md#get_superfunds) | **GET** /Superfunds | searches SuperFunds +[**get_timesheet**](PayrollAuApi.md#get_timesheet) | **GET** /Timesheets/{TimesheetID} | searches for an timesheet by unique id +[**get_timesheets**](PayrollAuApi.md#get_timesheets) | **GET** /Timesheets | searches timesheets +[**update_employee**](PayrollAuApi.md#update_employee) | **POST** /Employees/{EmployeeId} | Update an Employee +[**update_leave_application**](PayrollAuApi.md#update_leave_application) | **POST** /LeaveApplications/{LeaveApplicationId} | Use this method to update a Leave Application +[**update_pay_run**](PayrollAuApi.md#update_pay_run) | **POST** /PayRuns/{PayRunID} | Update a PayRun +[**update_payslip**](PayrollAuApi.md#update_payslip) | **POST** /Payslip/{PayslipID} | Update a Payslip +[**update_superfund**](PayrollAuApi.md#update_superfund) | **POST** /Superfunds/{SuperFundID} | Update a Superfund +[**update_timesheet**](PayrollAuApi.md#update_timesheet) | **POST** /Timesheets/{TimesheetID} | Update a Timesheet + + + +## create_employee + +> Employees create_employee(xero_tenant_id, employee) + +Use this method to create a payroll employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee = [ { "FirstName": "Albus", "LastName": "Dumbledore", "DateOfBirth": "/Date(321523200000+0000)/", "HomeAddress": { "AddressLine1": "101 Green St", "City": "Island Bay", "Region": "NSW", "PostalCode": "6023", "Country": "AUSTRALIA" }, "StartDate": "/Date(321523200000+0000)/", "MiddleNames": "Percival", "Email": "albus39608@hogwarts.edu", "Gender": "M", "Phone": "444-2323", "Mobile": "555-1212", "IsAuthorisedToApproveLeave": true, "IsAuthorisedToApproveTimesheets": true, "JobTitle": "Regional Manager", "Classification": "corporate", "OrdinaryEarningsRateID": "ab874dfb-ab09-4c91-954e-43acf6fc23b4", "Status": "ACTIVE" } ] # Array | +begin + #Use this method to create a payroll employee + result = api_instance.create_employee(xero_tenant_id, employee) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee** | [**Array<Employee>**](Employee.md)| | + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_leave_application + +> LeaveApplications create_leave_application(xero_tenant_id, leave_application) + +Use this method to create a Leave Application + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_application = [ { "EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e", "LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca", "Title": "Hello World", "StartDate": "/Date(1572559200000+0000)/", "EndDate": "/Date(1572645600000+0000)/" } ] # Array | +begin + #Use this method to create a Leave Application + result = api_instance.create_leave_application(xero_tenant_id, leave_application) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_leave_application: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_application** | [**Array<LeaveApplication>**](LeaveApplication.md)| | + +### Return type + +[**LeaveApplications**](LeaveApplications.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_pay_item + +> PayItems create_pay_item(xero_tenant_id, pay_item) + +Use this method to create a Pay Item + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_item = { "EarningsRates": [ { "Name": "MyRate", "AccountCode": "400", "TypeOfUnits": "4.00", "IsExemptFromTax": true, "IsExemptFromSuper": true, "IsReportableAsW1": false, "EarningsType": "ORDINARYTIMEEARNINGS", "EarningsRateID": "1fa4e226-b711-46ba-a8a7-4344c9c5fb87", "RateType": "MULTIPLE", "RatePerUnit": "10.0", "Multiplier": 1.5, "Amount": 5, "EmploymentTerminationPaymentType": "O" } ] } # PayItem | +begin + #Use this method to create a Pay Item + result = api_instance.create_pay_item(xero_tenant_id, pay_item) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_pay_item: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_item** | [**PayItem**](PayItem.md)| | + +### Return type + +[**PayItems**](PayItems.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_pay_run + +> PayRuns create_pay_run(xero_tenant_id, pay_run) + +Use this method to create a PayRun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run = [ { "PayrollCalendarID": "78bb86b9-e1ea-47ac-b75d-f087a81931de", "PayRunPeriodStartDate": "/Date(1572566400000+0000)/", "PayRunPeriodEndDate": "/Date(1573084800000+0000)/", "PayRunStatus": "DRAFT", "PaymentDate": "/Date(1573171200000+0000)/" } ] # Array | +begin + #Use this method to create a PayRun + result = api_instance.create_pay_run(xero_tenant_id, pay_run) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run** | [**Array<PayRun>**](PayRun.md)| | + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_payroll_calendar + +> PayrollCalendars create_payroll_calendar(xero_tenant_id, payroll_calendar) + +Use this method to create a Payroll Calendars + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payroll_calendar = [ { "PayrollCalendarID":"78bb86b9-e1ea-47ac-b75d-f087a81931de", "PayRunPeriodStartDate":"/Date(1572566400000+0000)/", "PayRunPeriodEndDate":"/Date(1573084800000+0000)/", "PayRunStatus":"DRAFT", "PaymentDate":"/Date(1573171200000+0000)/" } ] # Array | +begin + #Use this method to create a Payroll Calendars + result = api_instance.create_payroll_calendar(xero_tenant_id, payroll_calendar) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_payroll_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payroll_calendar** | [**Array<PayrollCalendar>**](PayrollCalendar.md)| | + +### Return type + +[**PayrollCalendars**](PayrollCalendars.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_superfund + +> SuperFunds create_superfund(xero_tenant_id, super_fund) + +Use this method to create a super fund + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +super_fund = [ { "usi":"PTC0133AU", "Type":"REGULATED", "Name":"Bar99359", "AccountNumber":"FB36350", "AccountName":"Foo38428", "USI":"PTC0133AU" } ] # Array | +begin + #Use this method to create a super fund + result = api_instance.create_superfund(xero_tenant_id, super_fund) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_superfund: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **super_fund** | [**Array<SuperFund>**](SuperFund.md)| | + +### Return type + +[**SuperFunds**](SuperFunds.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_timesheet + +> Timesheets create_timesheet(xero_tenant_id, timesheet) + +Use this method to create a timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet = [ { "EmployeeID":"b34e89ff-770d-4099-b7e5-f968767118bc", "StartDate":"/Date(1573171200000+0000)/", "EndDate":"/Date(1573689600000+0000)/", "Status":"DRAFT", "TimesheetLines":[ { "EarningsRateID":"ab874dfb-ab09-4c91-954e-43acf6fc23b4", "TrackingItemID":"af5e9ce2-2349-4136-be99-3561b189f473", "NumberOfUnits":[ 2.0, 10.0, 0.0, 0.0, 5.0, 0.0, 5.0 ] } ] } ] # Array | +begin + #Use this method to create a timesheet + result = api_instance.create_timesheet(xero_tenant_id, timesheet) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->create_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet** | [**Array<Timesheet>**](Timesheet.md)| | + +### Return type + +[**Timesheets**](Timesheets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_employee + +> Employees get_employee(xero_tenant_id, employee_id) + +searches for an employee by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches for an employee by unique id + result = api_instance.get_employee(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employees + +> Employees get_employees(xero_tenant_id, opts) + +searches employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 employees will be returned in a single API call +} + +begin + #searches employees + result = api_instance.get_employees(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 employees will be returned in a single API call | [optional] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_application + +> LeaveApplications get_leave_application(xero_tenant_id, leave_application_id) + +searches for an Leave Application by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_application_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Leave Application id for single object +begin + #searches for an Leave Application by unique id + result = api_instance.get_leave_application(xero_tenant_id, leave_application_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_leave_application: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_application_id** | [**String**](.md)| Leave Application id for single object | + +### Return type + +[**LeaveApplications**](LeaveApplications.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_applications + +> LeaveApplications get_leave_applications(xero_tenant_id, opts) + +searches Leave Applications + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 objects will be returned in a single API call +} + +begin + #searches Leave Applications + result = api_instance.get_leave_applications(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_leave_applications: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 objects will be returned in a single API call | [optional] + +### Return type + +[**LeaveApplications**](LeaveApplications.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_items + +> PayItems get_pay_items(xero_tenant_id, opts) + +searches Pay Items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 objects will be returned in a single API call +} + +begin + #searches Pay Items + result = api_instance.get_pay_items(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_pay_items: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 objects will be returned in a single API call | [optional] + +### Return type + +[**PayItems**](PayItems.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run + +> PayRuns get_pay_run(xero_tenant_id, pay_run_id) + +searches for an payrun by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | PayRun id for single object +begin + #searches for an payrun by unique id + result = api_instance.get_pay_run(xero_tenant_id, pay_run_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| PayRun id for single object | + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_runs + +> PayRuns get_pay_runs(xero_tenant_id, opts) + +searches PayRuns + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 PayRuns will be returned in a single API call +} + +begin + #searches PayRuns + result = api_instance.get_pay_runs(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_pay_runs: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 PayRuns will be returned in a single API call | [optional] + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payroll_calendar + +> PayrollCalendars get_payroll_calendar(xero_tenant_id, payroll_calendar_id) + +searches Payroll Calendars + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payroll_calendar_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Payroll Calendar id for single object +begin + #searches Payroll Calendars + result = api_instance.get_payroll_calendar(xero_tenant_id, payroll_calendar_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_payroll_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payroll_calendar_id** | [**String**](.md)| Payroll Calendar id for single object | + +### Return type + +[**PayrollCalendars**](PayrollCalendars.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payroll_calendars + +> PayrollCalendars get_payroll_calendars(xero_tenant_id, opts) + +searches Payroll Calendars + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 objects will be returned in a single API call +} + +begin + #searches Payroll Calendars + result = api_instance.get_payroll_calendars(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_payroll_calendars: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 objects will be returned in a single API call | [optional] + +### Return type + +[**PayrollCalendars**](PayrollCalendars.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payslip + +> PayslipObject get_payslip(xero_tenant_id, payslip_id) + +searches for an payslip by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payslip_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Payslip id for single object +begin + #searches for an payslip by unique id + result = api_instance.get_payslip(xero_tenant_id, payslip_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_payslip: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payslip_id** | [**String**](.md)| Payslip id for single object | + +### Return type + +[**PayslipObject**](PayslipObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_settings + +> SettingsObject get_settings(xero_tenant_id) + +retrieve settings + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #retrieve settings + result = api_instance.get_settings(xero_tenant_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**SettingsObject**](SettingsObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_superfund + +> SuperFunds get_superfund(xero_tenant_id, super_fund_id) + +searches for an Superfund by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +super_fund_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Superfund id for single object +begin + #searches for an Superfund by unique id + result = api_instance.get_superfund(xero_tenant_id, super_fund_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_superfund: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **super_fund_id** | [**String**](.md)| Superfund id for single object | + +### Return type + +[**SuperFunds**](SuperFunds.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_superfund_products + +> SuperFundProducts get_superfund_products(xero_tenant_id, opts) + +searches SuperfundProducts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + abn: '40022701955', # String | The ABN of the Regulated SuperFund + + usi: 'OSF0001AU' # String | The USI of the Regulated SuperFund +} + +begin + #searches SuperfundProducts + result = api_instance.get_superfund_products(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_superfund_products: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **abn** | **String**| The ABN of the Regulated SuperFund | [optional] + **usi** | **String**| The USI of the Regulated SuperFund | [optional] + +### Return type + +[**SuperFundProducts**](SuperFundProducts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_superfunds + +> SuperFunds get_superfunds(xero_tenant_id, opts) + +searches SuperFunds + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call +} + +begin + #searches SuperFunds + result = api_instance.get_superfunds(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_superfunds: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call | [optional] + +### Return type + +[**SuperFunds**](SuperFunds.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheet + +> TimesheetObject get_timesheet(xero_tenant_id, timesheet_id) + +searches for an timesheet by unique id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Timesheet id for single object +begin + #searches for an timesheet by unique id + result = api_instance.get_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Timesheet id for single object | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheets + +> Timesheets get_timesheets(xero_tenant_id, opts) + +searches timesheets + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + if_modified_since: 'if_modified_since_example', # String | Only records created or modified since this timestamp will be returned + + where: 'Status==\"ACTIVE\"', # String | Filter by an any element + + order: 'EmailAddress%20DESC', # String | Order by an any element + + page: 56 # Integer | e.g. page=1 – Up to 100 timesheets will be returned in a single API call +} + +begin + #searches timesheets + result = api_instance.get_timesheets(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->get_timesheets: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **String**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 timesheets will be returned in a single API call | [optional] + +### Return type + +[**Timesheets**](Timesheets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_employee + +> Employees update_employee(xero_tenant_id, employee_id, opts) + +Update an Employee + +Update properties on a single employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + employee: [ { "MiddleNames": "Frank" } ] # Array | +} + +begin + #Update an Employee + result = api_instance.update_employee(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee** | [**Array<Employee>**](Employee.md)| | [optional] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_leave_application + +> LeaveApplications update_leave_application(xero_tenant_id, leave_application_id, leave_application) + +Use this method to update a Leave Application + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_application_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Leave Application id for single object +leave_application = [ { "EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e", "LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca", "StartDate": "/Date(1572559200000+0000)/", "EndDate": "/Date(1572645600000+0000)/", "Description": "My updated Description" } ] # Array | +begin + #Use this method to update a Leave Application + result = api_instance.update_leave_application(xero_tenant_id, leave_application_id, leave_application) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_leave_application: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_application_id** | [**String**](.md)| Leave Application id for single object | + **leave_application** | [**Array<LeaveApplication>**](LeaveApplication.md)| | + +### Return type + +[**LeaveApplications**](LeaveApplications.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_pay_run + +> PayRuns update_pay_run(xero_tenant_id, pay_run_id, opts) + +Update a PayRun + +Update properties on a single PayRun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | PayRun id for single object +opts = { + pay_run: [XeroRuby::PayrollAu::PayRun.new] # Array | +} + +begin + #Update a PayRun + result = api_instance.update_pay_run(xero_tenant_id, pay_run_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| PayRun id for single object | + **pay_run** | [**Array<PayRun>**](PayRun.md)| | [optional] + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_payslip + +> Payslips update_payslip(xero_tenant_id, payslip_id, opts) + +Update a Payslip + +Update lines on a single payslips + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payslip_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Payslip id for single object +opts = { + payslip_lines: { "Payslip": { "EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e", "DeductionLines": [ { "DeductionTypeID": "727af5e8-b347-4ae7-85fc-9b82266d0aec", "CalculationType": "FIXEDAMOUNT", "NumberOfUnits": 10 } ] } } # Array | +} + +begin + #Update a Payslip + result = api_instance.update_payslip(xero_tenant_id, payslip_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_payslip: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payslip_id** | [**String**](.md)| Payslip id for single object | + **payslip_lines** | [**Array<PayslipLines>**](PayslipLines.md)| | [optional] + +### Return type + +[**Payslips**](Payslips.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_superfund + +> SuperFunds update_superfund(xero_tenant_id, super_fund_id, opts) + +Update a Superfund + +Update properties on a single Superfund + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +super_fund_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Superfund id for single object +opts = { + super_fund: [ { "Type":"REGULATED", "Name":"Nice23534" } ] # Array | +} + +begin + #Update a Superfund + result = api_instance.update_superfund(xero_tenant_id, super_fund_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_superfund: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **super_fund_id** | [**String**](.md)| Superfund id for single object | + **super_fund** | [**Array<SuperFund>**](SuperFund.md)| | [optional] + +### Return type + +[**SuperFunds**](SuperFunds.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_timesheet + +> Timesheets update_timesheet(xero_tenant_id, timesheet_id, opts) + +Update a Timesheet + +Update properties on a single timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Timesheet id for single object +opts = { + timesheet: [ { "EmployeeID":"b34e89ff-770d-4099-b7e5-f968767118bc", "StartDate":"/Date(1573171200000+0000)/", "EndDate":"/Date(1573689600000+0000)/", "Status":"APPROVED", "Hours":22.0, "TimesheetID":"a7eb0a79-8511-4ee7-b473-3a25f28abcb9", "TimesheetLines":[ { "EarningsRateID":"ab874dfb-ab09-4c91-954e-43acf6fc23b4", "TrackingItemID":"af5e9ce2-2349-4136-be99-3561b189f473", "NumberOfUnits":[ 2.0, 10.0, 0.0, 0.0, 5.0, 0.0, 5.0 ], "UpdatedDateUTC":"/Date(1573516185127+0000)/" } ] } ] # Array | +} + +begin + #Update a Timesheet + result = api_instance.update_timesheet(xero_tenant_id, timesheet_id, opts) + p result +rescue XeroRuby::PayrollAu::ApiError => e + puts "Exception when calling PayrollAuApi->update_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Timesheet id for single object | + **timesheet** | [**Array<Timesheet>**](Timesheet.md)| | [optional] + +### Return type + +[**Timesheets**](Timesheets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/payroll_au/PayrollCalendar.md b/docs/payroll_au/PayrollCalendar.md new file mode 100644 index 00000000..0204c5c5 --- /dev/null +++ b/docs/payroll_au/PayrollCalendar.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollAu::PayrollCalendar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the Payroll Calendar | [optional] +**calendar_type** | [**CalendarType**](CalendarType.md) | | [optional] +**start_date** | **Date** | The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) | [optional] +**payment_date** | **Date** | The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) | [optional] +**payroll_calendar_id** | **String** | Xero identifier | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayrollCalendar.new(name: Fortnightly Calendar, + calendar_type: null, + start_date: /Date(322560000000+0000)/, + payment_date: /Date(322560000000+0000)/, + payroll_calendar_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + updated_date_utc: /Date(1583967733054+0000)/, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/PayrollCalendars.md b/docs/payroll_au/PayrollCalendars.md new file mode 100644 index 00000000..e8a8720b --- /dev/null +++ b/docs/payroll_au/PayrollCalendars.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::PayrollCalendars + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendars** | [**Array<PayrollCalendar>**](PayrollCalendar.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayrollCalendars.new(payroll_calendars: null) +``` + + diff --git a/docs/payroll_au/Payslip.md b/docs/payroll_au/Payslip.md new file mode 100644 index 00000000..6b1a8a67 --- /dev/null +++ b/docs/payroll_au/Payslip.md @@ -0,0 +1,53 @@ +# XeroRuby::PayrollAu::Payslip + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | The Xero identifier for an employee | [optional] +**payslip_id** | **String** | Xero identifier for the payslip | [optional] +**first_name** | **String** | First name of employee | [optional] +**last_name** | **String** | Last name of employee | [optional] +**wages** | **BigDecimal** | The Wages for the Payslip | [optional] +**deductions** | **BigDecimal** | The Deductions for the Payslip | [optional] +**tax** | **BigDecimal** | The Tax for the Payslip | [optional] +**_super** | **BigDecimal** | The Super for the Payslip | [optional] +**reimbursements** | **BigDecimal** | The Reimbursements for the Payslip | [optional] +**net_pay** | **BigDecimal** | The NetPay for the Payslip | [optional] +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**leave_earnings_lines** | [**Array<LeaveEarningsLine>**](LeaveEarningsLine.md) | | [optional] +**timesheet_earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**leave_accrual_lines** | [**Array<LeaveAccrualLine>**](LeaveAccrualLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**superannuation_lines** | [**Array<SuperannuationLine>**](SuperannuationLine.md) | | [optional] +**tax_lines** | [**Array<TaxLine>**](TaxLine.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Payslip.new(employee_id: 4729f087-8eec-49c1-8294-4d11a5a0a37c, + payslip_id: f3c0874d-7cdd-459a-a95c-d90d51decc42, + first_name: Karen, + last_name: Jones, + wages: 1060.5, + deductions: 0.0, + tax: 198.0, + _super: 75.6, + reimbursements: 0.0, + net_pay: 862.5, + earnings_lines: null, + leave_earnings_lines: null, + timesheet_earnings_lines: null, + deduction_lines: null, + leave_accrual_lines: null, + reimbursement_lines: null, + superannuation_lines: null, + tax_lines: null, + updated_date_utc: /Date(1583967733054+0000)/) +``` + + diff --git a/docs/payroll_au/PayslipLines.md b/docs/payroll_au/PayslipLines.md new file mode 100644 index 00000000..7865af71 --- /dev/null +++ b/docs/payroll_au/PayslipLines.md @@ -0,0 +1,31 @@ +# XeroRuby::PayrollAu::PayslipLines + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**leave_earnings_lines** | [**Array<LeaveEarningsLine>**](LeaveEarningsLine.md) | | [optional] +**timesheet_earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**leave_accrual_lines** | [**Array<LeaveAccrualLine>**](LeaveAccrualLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**superannuation_lines** | [**Array<SuperannuationLine>**](SuperannuationLine.md) | | [optional] +**tax_lines** | [**Array<TaxLine>**](TaxLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayslipLines.new(earnings_lines: null, + leave_earnings_lines: null, + timesheet_earnings_lines: null, + deduction_lines: null, + leave_accrual_lines: null, + reimbursement_lines: null, + superannuation_lines: null, + tax_lines: null) +``` + + diff --git a/docs/payroll_au/PayslipObject.md b/docs/payroll_au/PayslipObject.md new file mode 100644 index 00000000..15cb9f20 --- /dev/null +++ b/docs/payroll_au/PayslipObject.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::PayslipObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payslip** | [**Payslip**](Payslip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayslipObject.new(payslip: null) +``` + + diff --git a/docs/payroll_au/PayslipSummary.md b/docs/payroll_au/PayslipSummary.md new file mode 100644 index 00000000..ff00e404 --- /dev/null +++ b/docs/payroll_au/PayslipSummary.md @@ -0,0 +1,39 @@ +# XeroRuby::PayrollAu::PayslipSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | The Xero identifier for an employee | [optional] +**payslip_id** | **String** | Xero identifier for the payslip | [optional] +**first_name** | **String** | First name of employee | [optional] +**last_name** | **String** | Last name of employee | [optional] +**employee_group** | **String** | Employee group name | [optional] +**wages** | **BigDecimal** | The Wages for the Payslip | [optional] +**deductions** | **BigDecimal** | The Deductions for the Payslip | [optional] +**tax** | **BigDecimal** | The Tax for the Payslip | [optional] +**_super** | **BigDecimal** | The Super for the Payslip | [optional] +**reimbursements** | **BigDecimal** | The Reimbursements for the Payslip | [optional] +**net_pay** | **BigDecimal** | The NetPay for the Payslip | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::PayslipSummary.new(employee_id: 4729f087-8eec-49c1-8294-4d11a5a0a37c, + payslip_id: f3c0874d-7cdd-459a-a95c-d90d51decc42, + first_name: Karen, + last_name: Jones, + employee_group: Marketing, + wages: 1060.5, + deductions: 0.0, + tax: 198.0, + _super: 75.6, + reimbursements: 0.0, + net_pay: 862.5, + updated_date_utc: /Date(1583967733054+0000)/) +``` + + diff --git a/docs/payroll_au/Payslips.md b/docs/payroll_au/Payslips.md new file mode 100644 index 00000000..cc8b3c5a --- /dev/null +++ b/docs/payroll_au/Payslips.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::Payslips + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payslips** | [**Array<Payslip>**](Payslip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Payslips.new(payslips: null) +``` + + diff --git a/docs/payroll_au/RateType.md b/docs/payroll_au/RateType.md new file mode 100644 index 00000000..ab075044 --- /dev/null +++ b/docs/payroll_au/RateType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::RateType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::RateType.new() +``` + + diff --git a/docs/payroll_au/ReimbursementLine.md b/docs/payroll_au/ReimbursementLine.md new file mode 100644 index 00000000..2e6f7449 --- /dev/null +++ b/docs/payroll_au/ReimbursementLine.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::ReimbursementLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_type_id** | **String** | Xero reimbursement type identifier | [optional] +**amount** | **BigDecimal** | Reimbursement type amount | [optional] +**description** | **String** | Reimbursement lines description (max length 50) | [optional] +**expense_account** | **String** | Reimbursement expense account. For posted pay run you should be able to see expense account code. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ReimbursementLine.new(reimbursement_type_id: bd246b96-c637-4767-81cf-851ba8fa93c2, + amount: 10.0, + description: For the taxi, + expense_account: 420) +``` + + diff --git a/docs/payroll_au/ReimbursementLines.md b/docs/payroll_au/ReimbursementLines.md new file mode 100644 index 00000000..3f2f5e8a --- /dev/null +++ b/docs/payroll_au/ReimbursementLines.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::ReimbursementLines + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ReimbursementLines.new(reimbursement_lines: null) +``` + + diff --git a/docs/payroll_au/ReimbursementType.md b/docs/payroll_au/ReimbursementType.md new file mode 100644 index 00000000..aac7c352 --- /dev/null +++ b/docs/payroll_au/ReimbursementType.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollAu::ReimbursementType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the earnings rate (max length = 100) | [optional] +**account_code** | **String** | See Accounts | [optional] +**reimbursement_type_id** | **String** | Xero identifier | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**current_record** | **Boolean** | Is the current record | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ReimbursementType.new(name: PTO, + account_code: 720, + reimbursement_type_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + updated_date_utc: /Date(1583967733054+0000)/, + current_record: true) +``` + + diff --git a/docs/payroll_au/ResidencyStatus.md b/docs/payroll_au/ResidencyStatus.md new file mode 100644 index 00000000..ec896c34 --- /dev/null +++ b/docs/payroll_au/ResidencyStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::ResidencyStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ResidencyStatus.new() +``` + + diff --git a/docs/payroll_au/Settings.md b/docs/payroll_au/Settings.md new file mode 100644 index 00000000..931458f4 --- /dev/null +++ b/docs/payroll_au/Settings.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollAu::Settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**Array<Account>**](Account.md) | Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. | [optional] +**tracking_categories** | [**SettingsTrackingCategories**](SettingsTrackingCategories.md) | | [optional] +**days_in_payroll_year** | **Integer** | Number of days in the Payroll year | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Settings.new(accounts: null, + tracking_categories: null, + days_in_payroll_year: 365) +``` + + diff --git a/docs/payroll_au/SettingsObject.md b/docs/payroll_au/SettingsObject.md new file mode 100644 index 00000000..169874ab --- /dev/null +++ b/docs/payroll_au/SettingsObject.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::SettingsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**Settings**](Settings.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SettingsObject.new(settings: null) +``` + + diff --git a/docs/payroll_au/SettingsTrackingCategories.md b/docs/payroll_au/SettingsTrackingCategories.md new file mode 100644 index 00000000..ff9028c0 --- /dev/null +++ b/docs/payroll_au/SettingsTrackingCategories.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollAu::SettingsTrackingCategories + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_groups** | [**SettingsTrackingCategoriesEmployeeGroups**](SettingsTrackingCategoriesEmployeeGroups.md) | | [optional] +**timesheet_categories** | [**SettingsTrackingCategoriesTimesheetCategories**](SettingsTrackingCategoriesTimesheetCategories.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SettingsTrackingCategories.new(employee_groups: null, + timesheet_categories: null) +``` + + diff --git a/docs/payroll_au/SettingsTrackingCategoriesEmployeeGroups.md b/docs/payroll_au/SettingsTrackingCategoriesEmployeeGroups.md new file mode 100644 index 00000000..24d8af63 --- /dev/null +++ b/docs/payroll_au/SettingsTrackingCategoriesEmployeeGroups.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_category_id** | **String** | The identifier for the tracking category | [optional] +**tracking_category_name** | **String** | Name of the tracking category | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups.new(tracking_category_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + tracking_category_name: null) +``` + + diff --git a/docs/payroll_au/SettingsTrackingCategoriesTimesheetCategories.md b/docs/payroll_au/SettingsTrackingCategoriesTimesheetCategories.md new file mode 100644 index 00000000..149cd783 --- /dev/null +++ b/docs/payroll_au/SettingsTrackingCategoriesTimesheetCategories.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_category_id** | **String** | The identifier for the tracking category | [optional] +**tracking_category_name** | **String** | Name of the tracking category | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories.new(tracking_category_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + tracking_category_name: null) +``` + + diff --git a/docs/payroll_au/State.md b/docs/payroll_au/State.md new file mode 100644 index 00000000..8bb4c0c8 --- /dev/null +++ b/docs/payroll_au/State.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::State + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::State.new() +``` + + diff --git a/docs/payroll_au/SuperFund.md b/docs/payroll_au/SuperFund.md new file mode 100644 index 00000000..a4f58085 --- /dev/null +++ b/docs/payroll_au/SuperFund.md @@ -0,0 +1,41 @@ +# XeroRuby::PayrollAu::SuperFund + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_fund_id** | **String** | Xero identifier for a super fund | [optional] +**type** | [**SuperFundType**](SuperFundType.md) | | +**name** | **String** | Name of the super fund | [optional] +**abn** | **String** | ABN of the self managed super fund | [optional] +**bsb** | **String** | BSB of the self managed super fund | [optional] +**account_number** | **String** | The account number for the self managed super fund. | [optional] +**account_name** | **String** | The account name for the self managed super fund. | [optional] +**electronic_service_address** | **String** | The electronic service address for the self managed super fund. | [optional] +**employer_number** | **String** | Some funds assign a unique number to each employer | [optional] +**spin** | **String** | The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. | [optional] +**usi** | **String** | The USI of the Regulated SuperFund | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperFund.new(super_fund_id: bfac31bd-ea62-4fc8-a5e7-7965d9504b15, + type: null, + name: MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC Superannuation Fund), + abn: 40022701955, + bsb: 234324, + account_number: 234234234, + account_name: Money account, + electronic_service_address: 12345678, + employer_number: 324324, + spin: 4545445454, + usi: 40022701955001, + updated_date_utc: /Date(1583967733054+0000)/, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/SuperFundProduct.md b/docs/payroll_au/SuperFundProduct.md new file mode 100644 index 00000000..2e834630 --- /dev/null +++ b/docs/payroll_au/SuperFundProduct.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::SuperFundProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**abn** | **String** | The ABN of the Regulated SuperFund | [optional] +**usi** | **String** | The USI of the Regulated SuperFund | [optional] +**spin** | **String** | The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN | [optional] +**product_name** | **String** | The name of the Regulated SuperFund | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperFundProduct.new(abn: 839182848805, + usi: 839182848805001, + spin: NML0117AU, + product_name: MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC Superannuation Fund)) +``` + + diff --git a/docs/payroll_au/SuperFundProducts.md b/docs/payroll_au/SuperFundProducts.md new file mode 100644 index 00000000..a6e59c90 --- /dev/null +++ b/docs/payroll_au/SuperFundProducts.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::SuperFundProducts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_fund_products** | [**Array<SuperFundProduct>**](SuperFundProduct.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperFundProducts.new(super_fund_products: null) +``` + + diff --git a/docs/payroll_au/SuperFundType.md b/docs/payroll_au/SuperFundType.md new file mode 100644 index 00000000..ff4673ed --- /dev/null +++ b/docs/payroll_au/SuperFundType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::SuperFundType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperFundType.new() +``` + + diff --git a/docs/payroll_au/SuperFunds.md b/docs/payroll_au/SuperFunds.md new file mode 100644 index 00000000..0ba3a1a1 --- /dev/null +++ b/docs/payroll_au/SuperFunds.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::SuperFunds + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_funds** | [**Array<SuperFund>**](SuperFund.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperFunds.new(super_funds: null) +``` + + diff --git a/docs/payroll_au/SuperLine.md b/docs/payroll_au/SuperLine.md new file mode 100644 index 00000000..16c20676 --- /dev/null +++ b/docs/payroll_au/SuperLine.md @@ -0,0 +1,31 @@ +# XeroRuby::PayrollAu::SuperLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_membership_id** | **String** | Xero super membership ID | [optional] +**contribution_type** | [**SuperannuationContributionType**](SuperannuationContributionType.md) | | [optional] +**calculation_type** | [**SuperannuationCalculationType**](SuperannuationCalculationType.md) | | [optional] +**minimum_monthly_earnings** | **BigDecimal** | amount of mimimum earnings | [optional] +**expense_account_code** | **String** | expense account code | [optional] +**liability_account_code** | **String** | liabilty account code | [optional] +**percentage** | **BigDecimal** | percentage for super line | [optional] +**amount** | **BigDecimal** | Super membership amount | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperLine.new(super_membership_id: 4333d5cd-53a5-4c31-98e5-a8b4e5676b0b, + contribution_type: null, + calculation_type: null, + minimum_monthly_earnings: 450.0, + expense_account_code: 478, + liability_account_code: 826, + percentage: 9.0, + amount: 10.0) +``` + + diff --git a/docs/payroll_au/SuperMembership.md b/docs/payroll_au/SuperMembership.md new file mode 100644 index 00000000..4c86a683 --- /dev/null +++ b/docs/payroll_au/SuperMembership.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollAu::SuperMembership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_membership_id** | **String** | Xero unique identifier for Super membership | [optional] +**super_fund_id** | **String** | Xero identifier for super fund | +**employee_number** | **String** | The memberhsip number assigned to the employee by the super fund. | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperMembership.new(super_membership_id: 4333d5cd-53a5-4c31-98e5-a8b4e5676b0b, + super_fund_id: 2187a42b-639a-45cb-9eed-cd4ae488306a, + employee_number: 1234) +``` + + diff --git a/docs/payroll_au/SuperannuationCalculationType.md b/docs/payroll_au/SuperannuationCalculationType.md new file mode 100644 index 00000000..3b75b7df --- /dev/null +++ b/docs/payroll_au/SuperannuationCalculationType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::SuperannuationCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperannuationCalculationType.new() +``` + + diff --git a/docs/payroll_au/SuperannuationContributionType.md b/docs/payroll_au/SuperannuationContributionType.md new file mode 100644 index 00000000..5eb4f420 --- /dev/null +++ b/docs/payroll_au/SuperannuationContributionType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::SuperannuationContributionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperannuationContributionType.new() +``` + + diff --git a/docs/payroll_au/SuperannuationLine.md b/docs/payroll_au/SuperannuationLine.md new file mode 100644 index 00000000..342d127a --- /dev/null +++ b/docs/payroll_au/SuperannuationLine.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollAu::SuperannuationLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**super_membership_id** | **String** | Xero identifier for payroll super fund membership ID. | [optional] +**contribution_type** | [**SuperannuationContributionType**](SuperannuationContributionType.md) | | [optional] +**calculation_type** | [**SuperannuationCalculationType**](SuperannuationCalculationType.md) | | [optional] +**minimum_monthly_earnings** | **BigDecimal** | Superannuation minimum monthly earnings. | [optional] +**expense_account_code** | **String** | Superannuation expense account code. | [optional] +**liability_account_code** | **String** | Superannuation liability account code | [optional] +**payment_date_for_this_period** | **Date** | Superannuation payment date for the current period (YYYY-MM-DD) | [optional] +**percentage** | **BigDecimal** | Superannuation percentage | [optional] +**amount** | **BigDecimal** | Superannuation amount | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::SuperannuationLine.new(super_membership_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + contribution_type: null, + calculation_type: null, + minimum_monthly_earnings: 100.5, + expense_account_code: 450, + liability_account_code: 650, + payment_date_for_this_period: /Date(322560000000+0000)/, + percentage: 4.0, + amount: 10.5) +``` + + diff --git a/docs/payroll_au/TFNExemptionType.md b/docs/payroll_au/TFNExemptionType.md new file mode 100644 index 00000000..a3912c75 --- /dev/null +++ b/docs/payroll_au/TFNExemptionType.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::TFNExemptionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TFNExemptionType.new() +``` + + diff --git a/docs/payroll_au/TaxDeclaration.md b/docs/payroll_au/TaxDeclaration.md new file mode 100644 index 00000000..c6ea632c --- /dev/null +++ b/docs/payroll_au/TaxDeclaration.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollAu::TaxDeclaration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | Address line 1 for employee home address | [optional] +**employment_basis** | [**EmploymentBasis**](EmploymentBasis.md) | | [optional] +**tfn_exemption_type** | [**TFNExemptionType**](TFNExemptionType.md) | | [optional] +**tax_file_number** | **String** | The tax file number e.g 123123123. | [optional] +**australian_resident_for_tax_purposes** | **Boolean** | If the employee is Australian resident for tax purposes. e.g true or false | [optional] +**residency_status** | [**ResidencyStatus**](ResidencyStatus.md) | | [optional] +**tax_free_threshold_claimed** | **Boolean** | If tax free threshold claimed. e.g true or false | [optional] +**tax_offset_estimated_amount** | **Float** | If has tax offset estimated then the tax offset estimated amount. e.g 100 | [optional] +**has_help_debt** | **Boolean** | If employee has HECS or HELP debt. e.g true or false | [optional] +**has_sfss_debt** | **Boolean** | If employee has financial supplement debt. e.g true or false | [optional] +**has_trade_support_loan_debt** | **Boolean** | If employee has trade support loan. e.g true or false | [optional] +**upward_variation_tax_withholding_amount** | **Float** | If the employee has requested that additional tax be withheld each pay run. e.g 50 | [optional] +**eligible_to_receive_leave_loading** | **Boolean** | If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false | [optional] +**approved_withholding_variation_percentage** | **Float** | If the employee has approved withholding variation. e.g (0 - 100) | [optional] +**has_student_startup_loan** | **Boolean** | If the employee is eligible for student startup loan rules | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TaxDeclaration.new(employee_id: null, + employment_basis: null, + tfn_exemption_type: null, + tax_file_number: 123123123, + australian_resident_for_tax_purposes: true, + residency_status: null, + tax_free_threshold_claimed: false, + tax_offset_estimated_amount: 100, + has_help_debt: false, + has_sfss_debt: false, + has_trade_support_loan_debt: false, + upward_variation_tax_withholding_amount: 50, + eligible_to_receive_leave_loading: false, + approved_withholding_variation_percentage: 75, + has_student_startup_loan: true, + updated_date_utc: /Date(1583967733054+0000)/) +``` + + diff --git a/docs/payroll_au/TaxLine.md b/docs/payroll_au/TaxLine.md new file mode 100644 index 00000000..62fe1362 --- /dev/null +++ b/docs/payroll_au/TaxLine.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollAu::TaxLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payslip_tax_line_id** | **String** | Xero identifier for payslip tax line ID. | [optional] +**amount** | **BigDecimal** | The tax line amount | [optional] +**tax_type_name** | **String** | Name of the tax type. | [optional] +**description** | **String** | Description of the tax line. | [optional] +**manual_tax_type** | [**ManualTaxType**](ManualTaxType.md) | | [optional] +**liability_account** | **String** | The tax line liability account code. For posted pay run you should be able to see liability account code | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TaxLine.new(payslip_tax_line_id: e0eb6747-7c17-4075-b804-989f8d4e5d39, + amount: 50.0, + tax_type_name: Manual Adjustment, + description: null, + manual_tax_type: null, + liability_account: 620) +``` + + diff --git a/docs/payroll_au/Timesheet.md b/docs/payroll_au/Timesheet.md new file mode 100644 index 00000000..3fe2cd1f --- /dev/null +++ b/docs/payroll_au/Timesheet.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollAu::Timesheet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | The Xero identifier for an employee | +**start_date** | **Date** | Period start date (YYYY-MM-DD) | +**end_date** | **Date** | Period end date (YYYY-MM-DD) | +**status** | [**TimesheetStatus**](TimesheetStatus.md) | | [optional] +**hours** | **BigDecimal** | Timesheet total hours | [optional] +**timesheet_id** | **String** | The Xero identifier for a Payroll Timesheet | [optional] +**timesheet_lines** | [**Array<TimesheetLine>**](TimesheetLine.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Timesheet.new(employee_id: 72a0d0c2-0cf8-4f0b-ade1-33231f47b41b, + start_date: /Date(322560000000+0000)/, + end_date: /Date(322560000000+0000)/, + status: null, + hours: 31.0, + timesheet_id: 049765fc-4506-48fb-bf88-3578dec0ec47, + timesheet_lines: null, + updated_date_utc: /Date(1583967733054+0000)/, + validation_errors: null) +``` + + diff --git a/docs/payroll_au/TimesheetLine.md b/docs/payroll_au/TimesheetLine.md new file mode 100644 index 00000000..aceed3bd --- /dev/null +++ b/docs/payroll_au/TimesheetLine.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollAu::TimesheetLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | The Xero identifier for an Earnings Rate | [optional] +**tracking_item_id** | **String** | The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. | [optional] +**number_of_units** | **Array<Float>** | The number of units on a timesheet line | [optional] +**updated_date_utc** | **DateTime** | Last modified timestamp | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TimesheetLine.new(earnings_rate_id: 966c5c77-2ef0-4320-b6a9-6c27b080ecc5, + tracking_item_id: ae777a87-5ef3-4fa0-a4f0-d10e1f13073a, + number_of_units: null, + updated_date_utc: /Date(1583967733054+0000)/) +``` + + diff --git a/docs/payroll_au/TimesheetObject.md b/docs/payroll_au/TimesheetObject.md new file mode 100644 index 00000000..e41bb103 --- /dev/null +++ b/docs/payroll_au/TimesheetObject.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::TimesheetObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheet** | [**Timesheet**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TimesheetObject.new(timesheet: null) +``` + + diff --git a/docs/payroll_au/TimesheetStatus.md b/docs/payroll_au/TimesheetStatus.md new file mode 100644 index 00000000..36c0970f --- /dev/null +++ b/docs/payroll_au/TimesheetStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollAu::TimesheetStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::TimesheetStatus.new() +``` + + diff --git a/docs/payroll_au/Timesheets.md b/docs/payroll_au/Timesheets.md new file mode 100644 index 00000000..5c3aaf74 --- /dev/null +++ b/docs/payroll_au/Timesheets.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::Timesheets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheets** | [**Array<Timesheet>**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::Timesheets.new(timesheets: null) +``` + + diff --git a/docs/payroll_au/ValidationError.md b/docs/payroll_au/ValidationError.md new file mode 100644 index 00000000..19d8512e --- /dev/null +++ b/docs/payroll_au/ValidationError.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollAu::ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | Validation error message | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollAu' + +instance = XeroRuby::PayrollAu::ValidationError.new(message: null) +``` + + diff --git a/docs/payroll_nz/Account.md b/docs/payroll_nz/Account.md new file mode 100644 index 00000000..6608105a --- /dev/null +++ b/docs/payroll_nz/Account.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **String** | The Xero identifier for Settings. | [optional] +**type** | **String** | The assigned AccountType | [optional] +**code** | **String** | A unique 3 digit number for each Account | [optional] +**name** | **String** | Name of the Account. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Account.new(account_id: null, + type: null, + code: null, + name: null) +``` + + diff --git a/docs/payroll_nz/Accounts.md b/docs/payroll_nz/Accounts.md new file mode 100644 index 00000000..18f375f8 --- /dev/null +++ b/docs/payroll_nz/Accounts.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollNz::Accounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**Array<Account>**](Account.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Accounts.new(accounts: null) +``` + + diff --git a/docs/payroll_nz/Address.md b/docs/payroll_nz/Address.md new file mode 100644 index 00000000..52de2d74 --- /dev/null +++ b/docs/payroll_nz/Address.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_line1** | **String** | Address line 1 for employee home address | +**address_line2** | **String** | Address line 2 for employee home address | [optional] +**city** | **String** | Suburb for employee home address | +**suburb** | **String** | Suburb for employee home address | [optional] +**post_code** | **String** | PostCode for employee home address | +**country_name** | **String** | Country of HomeAddress | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Address.new(address_line1: 19 Taranaki Street, + address_line2: Apt 4, + city: Wellington, + suburb: Te Aro, + post_code: 6011, + country_name: NEW ZEALAND) +``` + + diff --git a/docs/payroll_nz/BankAccount.md b/docs/payroll_nz/BankAccount.md new file mode 100644 index 00000000..b41c3e6d --- /dev/null +++ b/docs/payroll_nz/BankAccount.md @@ -0,0 +1,31 @@ +# XeroRuby::PayrollNz::BankAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_name** | **String** | Bank account name (max length = 32) | +**account_number** | **String** | Bank account number (digits only; max length = 8) | +**sort_code** | **String** | Bank account sort code (6 digits) | +**particulars** | **String** | Particulars that appear on the statement. | [optional] +**code** | **String** | Code of a transaction that appear on the statement. | [optional] +**dollar_amount** | **BigDecimal** | Dollar amount of a transaction. | [optional] +**reference** | **String** | Statement Text/reference for a transaction that appear on the statement. | [optional] +**calculation_type** | **String** | Calculation type for the transaction can be 'Fixed Amount' or 'Balance' | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::BankAccount.new(account_name: null, + account_number: null, + sort_code: null, + particulars: null, + code: null, + dollar_amount: null, + reference: null, + calculation_type: null) +``` + + diff --git a/docs/payroll_nz/Benefit.md b/docs/payroll_nz/Benefit.md new file mode 100644 index 00000000..f34a7481 --- /dev/null +++ b/docs/payroll_nz/Benefit.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::Benefit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The Xero identifier for superannuation | [optional] +**name** | **String** | Name of the superannuations | +**category** | **String** | Superannuations Category type | +**liability_account_id** | **String** | Xero identifier for Liability Account | +**expense_account_id** | **String** | Xero identifier for Expense Account | +**calculation_type_nz** | **String** | Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings | [optional] +**standard_amount** | **BigDecimal** | Standard amount of the superannuation | [optional] +**percentage** | **BigDecimal** | Percentage of Taxable Earnings of the superannuation | [optional] +**company_max** | **BigDecimal** | Company Maximum amount of the superannuation | [optional] +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Benefit.new(id: null, + name: null, + category: null, + liability_account_id: null, + expense_account_id: null, + calculation_type_nz: null, + standard_amount: null, + percentage: null, + company_max: null, + current_record: null) +``` + + diff --git a/docs/payroll_nz/Deduction.md b/docs/payroll_nz/Deduction.md new file mode 100644 index 00000000..8ddd66bc --- /dev/null +++ b/docs/payroll_nz/Deduction.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::Deduction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deduction_id** | **String** | The Xero identifier for Deduction | [optional] +**deduction_name** | **String** | Name of the deduction | +**deduction_category** | **String** | Deduction Category type | +**liability_account_id** | **String** | Xero identifier for Liability Account | +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] +**standard_amount** | **BigDecimal** | Standard amount of the deduction. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Deduction.new(deduction_id: null, + deduction_name: null, + deduction_category: null, + liability_account_id: null, + current_record: null, + standard_amount: null) +``` + + diff --git a/docs/payroll_nz/DeductionLine.md b/docs/payroll_nz/DeductionLine.md new file mode 100644 index 00000000..81bd3afa --- /dev/null +++ b/docs/payroll_nz/DeductionLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::DeductionLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deduction_type_id** | **String** | Xero identifier for payroll deduction | [optional] +**display_name** | **String** | name of earnings rate for display in UI | [optional] +**amount** | **BigDecimal** | The amount of the deduction line | [optional] +**subject_to_tax** | **Boolean** | Identifies if the deduction is subject to tax | [optional] +**percentage** | **BigDecimal** | Deduction rate percentage | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::DeductionLine.new(deduction_type_id: null, + display_name: null, + amount: null, + subject_to_tax: null, + percentage: null) +``` + + diff --git a/docs/payroll_nz/DeductionObject.md b/docs/payroll_nz/DeductionObject.md new file mode 100644 index 00000000..73cf73a3 --- /dev/null +++ b/docs/payroll_nz/DeductionObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::DeductionObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**deduction** | [**Deduction**](Deduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::DeductionObject.new(pagination: null, + problem: null, + deduction: null) +``` + + diff --git a/docs/payroll_nz/Deductions.md b/docs/payroll_nz/Deductions.md new file mode 100644 index 00000000..d2e671f9 --- /dev/null +++ b/docs/payroll_nz/Deductions.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Deductions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**deductions** | [**Array<Deduction>**](Deduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Deductions.new(pagination: null, + problem: null, + deductions: null) +``` + + diff --git a/docs/payroll_nz/EarningsLine.md b/docs/payroll_nz/EarningsLine.md new file mode 100644 index 00000000..cd3062e5 --- /dev/null +++ b/docs/payroll_nz/EarningsLine.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::EarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_line_id** | **String** | Xero identifier for payroll earnings line | [optional] +**earnings_rate_id** | **String** | Xero identifier for payroll earnings rate | [optional] +**display_name** | **String** | name of earnings rate for display in UI | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit for earnings line | [optional] +**number_of_units** | **BigDecimal** | Earnings number of units | [optional] +**fixed_amount** | **BigDecimal** | Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **BigDecimal** | The amount of the earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the earnings is taken from the timesheet. False for earnings line | [optional] +**is_average_daily_pay_rate** | **Boolean** | Identifies if the earnings is using an average daily pay rate | [optional] +**is_system_generated** | **Boolean** | Flag to indentify whether the earnings line is system generated or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsLine.new(earnings_line_id: null, + earnings_rate_id: null, + display_name: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null, + is_average_daily_pay_rate: null, + is_system_generated: null) +``` + + diff --git a/docs/payroll_nz/EarningsOrder.md b/docs/payroll_nz/EarningsOrder.md new file mode 100644 index 00000000..143e61c8 --- /dev/null +++ b/docs/payroll_nz/EarningsOrder.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::EarningsOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | Xero unique identifier for an earning rate | [optional] +**name** | **String** | Name of the earning order | +**statutory_deduction_category** | [**StatutoryDeductionCategory**](StatutoryDeductionCategory.md) | | [optional] +**liability_account_id** | **String** | Xero identifier for Liability Account | [optional] +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] [default to true] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsOrder.new(id: null, + name: null, + statutory_deduction_category: null, + liability_account_id: null, + current_record: null) +``` + + diff --git a/docs/payroll_nz/EarningsOrderObject.md b/docs/payroll_nz/EarningsOrderObject.md new file mode 100644 index 00000000..0114689b --- /dev/null +++ b/docs/payroll_nz/EarningsOrderObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EarningsOrderObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deduction** | [**EarningsOrder**](EarningsOrder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsOrderObject.new(pagination: null, + problem: null, + statutory_deduction: null) +``` + + diff --git a/docs/payroll_nz/EarningsOrders.md b/docs/payroll_nz/EarningsOrders.md new file mode 100644 index 00000000..a8916208 --- /dev/null +++ b/docs/payroll_nz/EarningsOrders.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EarningsOrders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deductions** | [**Array<EarningsOrder>**](EarningsOrder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsOrders.new(pagination: null, + problem: null, + statutory_deductions: null) +``` + + diff --git a/docs/payroll_nz/EarningsRate.md b/docs/payroll_nz/EarningsRate.md new file mode 100644 index 00000000..d08b27c7 --- /dev/null +++ b/docs/payroll_nz/EarningsRate.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::EarningsRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero unique identifier for an earning rate | [optional] +**name** | **String** | Name of the earning rate | +**earnings_type** | **String** | Indicates how an employee will be paid when taking this type of earning | +**rate_type** | **String** | Indicates the type of the earning rate | +**type_of_units** | **String** | The type of units used to record earnings | +**current_record** | **Boolean** | Indicates whether an earning type is active | [optional] +**expense_account_id** | **String** | The account that will be used for the earnings rate | +**rate_per_unit** | **BigDecimal** | Default rate per unit (optional). Only applicable if RateType is RatePerUnit | [optional] +**multiple_of_ordinary_earnings_rate** | **BigDecimal** | This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate | [optional] +**fixed_amount** | **BigDecimal** | Optional Fixed Rate Amount. Applicable for FixedAmount Rate | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsRate.new(earnings_rate_id: null, + name: null, + earnings_type: null, + rate_type: null, + type_of_units: null, + current_record: null, + expense_account_id: null, + rate_per_unit: null, + multiple_of_ordinary_earnings_rate: null, + fixed_amount: null) +``` + + diff --git a/docs/payroll_nz/EarningsRateObject.md b/docs/payroll_nz/EarningsRateObject.md new file mode 100644 index 00000000..3f142b70 --- /dev/null +++ b/docs/payroll_nz/EarningsRateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EarningsRateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earnings_rate** | [**EarningsRate**](EarningsRate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsRateObject.new(pagination: null, + problem: null, + earnings_rate: null) +``` + + diff --git a/docs/payroll_nz/EarningsRates.md b/docs/payroll_nz/EarningsRates.md new file mode 100644 index 00000000..a4271ec0 --- /dev/null +++ b/docs/payroll_nz/EarningsRates.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EarningsRates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earnings_rates** | [**Array<EarningsRate>**](EarningsRate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsRates.new(pagination: null, + problem: null, + earnings_rates: null) +``` + + diff --git a/docs/payroll_nz/EarningsTemplate.md b/docs/payroll_nz/EarningsTemplate.md new file mode 100644 index 00000000..7cf836db --- /dev/null +++ b/docs/payroll_nz/EarningsTemplate.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::EarningsTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_template_earning_id** | **String** | The Xero identifier for the earnings template | [optional] +**rate_per_unit** | **BigDecimal** | The rate per unit | [optional] +**number_of_units** | **BigDecimal** | The rate per unit | [optional] +**fixed_amount** | **BigDecimal** | The fixed amount per period | [optional] +**earnings_rate_id** | **String** | The corresponding earnings rate identifier | [optional] +**name** | **String** | The read-only name of the Earning Template. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsTemplate.new(pay_template_earning_id: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + earnings_rate_id: null, + name: null) +``` + + diff --git a/docs/payroll_nz/EarningsTemplateObject.md b/docs/payroll_nz/EarningsTemplateObject.md new file mode 100644 index 00000000..6c32cfcc --- /dev/null +++ b/docs/payroll_nz/EarningsTemplateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EarningsTemplateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earning_template** | [**EarningsTemplate**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EarningsTemplateObject.new(pagination: null, + problem: null, + earning_template: null) +``` + + diff --git a/docs/payroll_nz/Employee.md b/docs/payroll_nz/Employee.md new file mode 100644 index 00000000..c25100ce --- /dev/null +++ b/docs/payroll_nz/Employee.md @@ -0,0 +1,43 @@ +# XeroRuby::PayrollNz::Employee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | Xero unique identifier for the employee | [optional] +**title** | **String** | Title of the employee | [optional] +**first_name** | **String** | First name of employee | [optional] +**last_name** | **String** | Last name of employee | [optional] +**date_of_birth** | **Date** | Date of birth of the employee (YYYY-MM-DD) | [optional] +**address** | [**Address**](Address.md) | | [optional] +**email** | **String** | The email address for the employee | [optional] +**gender** | **String** | The employee’s gender | [optional] +**phone_number** | **String** | Employee phone number | [optional] +**start_date** | **Date** | Employment start date of the employee at the time it was requested | [optional] +**end_date** | **Date** | Employment end date of the employee at the time it was requested | [optional] +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the employee | [optional] +**created_date_utc** | **DateTime** | UTC timestamp when the employee was created in Xero | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Employee.new(employee_id: d90457c4-f1be-4f2e-b4e3-f766390a7e30, + title: Mrs, + first_name: Karen, + last_name: Jones, + date_of_birth: Wed Jan 02 00:00:00 GMT 2019, + address: null, + email: developer@me.com, + gender: F, + phone_number: 415-555-1212, + start_date: Sun Jan 19 00:00:00 GMT 2020, + end_date: Sun Jan 19 00:00:00 GMT 2020, + payroll_calendar_id: null, + updated_date_utc: null, + created_date_utc: null) +``` + + diff --git a/docs/payroll_nz/EmployeeEarningsTemplates.md b/docs/payroll_nz/EmployeeEarningsTemplates.md new file mode 100644 index 00000000..defadc54 --- /dev/null +++ b/docs/payroll_nz/EmployeeEarningsTemplates.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeEarningsTemplates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earning_templates** | [**Array<EarningsTemplate>**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeEarningsTemplates.new(pagination: null, + problem: null, + earning_templates: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeave.md b/docs/payroll_nz/EmployeeLeave.md new file mode 100644 index 00000000..36716646 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeave.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollNz::EmployeeLeave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_id** | **String** | The Xero identifier for LeaveType | [optional] +**leave_type_id** | **String** | The Xero identifier for LeaveType | +**description** | **String** | The description of the leave (max length = 50) | +**start_date** | **Date** | Start date of the leave (YYYY-MM-DD) | +**end_date** | **Date** | End date of the leave (YYYY-MM-DD) | +**periods** | [**Array<LeavePeriod>**](LeavePeriod.md) | The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the leave type note | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeave.new(leave_id: null, + leave_type_id: null, + description: null, + start_date: null, + end_date: null, + periods: null, + updated_date_utc: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveBalance.md b/docs/payroll_nz/EmployeeLeaveBalance.md new file mode 100644 index 00000000..ea6a1111 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveBalance.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::EmployeeLeaveBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the leave type. | [optional] +**leave_type_id** | **String** | The Xero identifier for leave type | [optional] +**balance** | **BigDecimal** | The employees current balance for the corresponding leave type. | [optional] +**type_of_units** | **String** | The type of the units of the leave. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveBalance.new(name: Holiday, + leave_type_id: null, + balance: null, + type_of_units: hours) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveBalances.md b/docs/payroll_nz/EmployeeLeaveBalances.md new file mode 100644 index 00000000..1a6054d5 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveBalances.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaveBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_balances** | [**Array<EmployeeLeaveBalance>**](EmployeeLeaveBalance.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveBalances.new(pagination: null, + problem: null, + leave_balances: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveObject.md b/docs/payroll_nz/EmployeeLeaveObject.md new file mode 100644 index 00000000..4eefa9d0 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaveObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave** | [**EmployeeLeave**](EmployeeLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveObject.new(pagination: null, + problem: null, + leave: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveSetup.md b/docs/payroll_nz/EmployeeLeaveSetup.md new file mode 100644 index 00000000..62d2b55b --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveSetup.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollNz::EmployeeLeaveSetup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**include_holiday_pay** | **Boolean** | Identifier if holiday pay will be included in each payslip | [optional] +**holiday_pay_opening_balance** | **BigDecimal** | Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. | [optional] +**annual_leave_opening_balance** | **BigDecimal** | Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. | [optional] +**negative_annual_leave_balance_paid_amount** | **BigDecimal** | The dollar value of annual leave opening balance if negative. | [optional] +**sick_leave_hours_to_accrue_annually** | **BigDecimal** | Number of hours accrued annually for sick leave. Multiply the number of days they're entitled to by the hours worked per day | [optional] +**sick_leave_maximum_hours_to_accrue** | **BigDecimal** | Maximum number of hours accrued annually for sick leave. Multiply the maximum days they can accrue by the hours worked per day | [optional] +**sick_leave_opening_balance** | **BigDecimal** | Initial sick leave balance. This will be positive unless they've taken sick leave in advance | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveSetup.new(include_holiday_pay: false, + holiday_pay_opening_balance: 10.5, + annual_leave_opening_balance: 25.89, + negative_annual_leave_balance_paid_amount: 10.0, + sick_leave_hours_to_accrue_annually: 100.5, + sick_leave_maximum_hours_to_accrue: 200.5, + sick_leave_opening_balance: 10.5) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveSetupObject.md b/docs/payroll_nz/EmployeeLeaveSetupObject.md new file mode 100644 index 00000000..a0085b1a --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveSetupObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaveSetupObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_setup** | [**EmployeeLeaveSetup**](EmployeeLeaveSetup.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveSetupObject.new(pagination: null, + problem: null, + leave_setup: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveType.md b/docs/payroll_nz/EmployeeLeaveType.md new file mode 100644 index 00000000..cd53b7e3 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveType.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::EmployeeLeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | The Xero identifier for leave type | [optional] +**schedule_of_accrual** | **String** | The schedule of accrual | [optional] +**hours_accrued_annually** | **BigDecimal** | The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" | [optional] +**maximum_to_accrue** | **BigDecimal** | The maximum number of hours that can be accrued for the leave | [optional] +**opening_balance** | **BigDecimal** | The initial number of hours assigned when the leave was added to the employee | [optional] +**rate_accrued_hourly** | **BigDecimal** | The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" | [optional] +**percentage_of_gross_earnings** | **BigDecimal** | Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. | [optional] +**include_holiday_pay_every_pay** | **Boolean** | Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. | [optional] +**show_annual_leave_in_advance** | **Boolean** | Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip | [optional] +**annual_leave_total_amount_paid** | **BigDecimal** | Specific to Annual Leave. Annual leave balance in dollars | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveType.new(leave_type_id: null, + schedule_of_accrual: null, + hours_accrued_annually: null, + maximum_to_accrue: null, + opening_balance: null, + rate_accrued_hourly: null, + percentage_of_gross_earnings: null, + include_holiday_pay_every_pay: null, + show_annual_leave_in_advance: null, + annual_leave_total_amount_paid: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveTypeObject.md b/docs/payroll_nz/EmployeeLeaveTypeObject.md new file mode 100644 index 00000000..34ddf089 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveTypeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaveTypeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_type** | [**EmployeeLeaveType**](EmployeeLeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveTypeObject.new(pagination: null, + problem: null, + leave_type: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaveTypes.md b/docs/payroll_nz/EmployeeLeaveTypes.md new file mode 100644 index 00000000..6693d398 --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaveTypes.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaveTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_types** | [**Array<EmployeeLeaveType>**](EmployeeLeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaveTypes.new(pagination: null, + problem: null, + leave_types: null) +``` + + diff --git a/docs/payroll_nz/EmployeeLeaves.md b/docs/payroll_nz/EmployeeLeaves.md new file mode 100644 index 00000000..cb70499d --- /dev/null +++ b/docs/payroll_nz/EmployeeLeaves.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeLeaves + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave** | [**Array<EmployeeLeave>**](EmployeeLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeLeaves.new(pagination: null, + problem: null, + leave: null) +``` + + diff --git a/docs/payroll_nz/EmployeeObject.md b/docs/payroll_nz/EmployeeObject.md new file mode 100644 index 00000000..587433fc --- /dev/null +++ b/docs/payroll_nz/EmployeeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**employee** | [**Employee**](Employee.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeObject.new(pagination: null, + employee: null, + problem: null) +``` + + diff --git a/docs/payroll_nz/EmployeeOpeningBalance.md b/docs/payroll_nz/EmployeeOpeningBalance.md new file mode 100644 index 00000000..42fe59d4 --- /dev/null +++ b/docs/payroll_nz/EmployeeOpeningBalance.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::EmployeeOpeningBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period_end_date** | **Date** | The opening balance period end date. | [optional] +**days_paid** | **Integer** | The paid number of days. | [optional] +**unpaid_weeks** | **Integer** | The number of unpaid weeks. | [optional] +**gross_earnings** | **BigDecimal** | The gross earnings during the period. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeOpeningBalance.new(period_end_date: null, + days_paid: null, + unpaid_weeks: null, + gross_earnings: null) +``` + + diff --git a/docs/payroll_nz/EmployeeOpeningBalancesObject.md b/docs/payroll_nz/EmployeeOpeningBalancesObject.md new file mode 100644 index 00000000..1d330f36 --- /dev/null +++ b/docs/payroll_nz/EmployeeOpeningBalancesObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeOpeningBalancesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**opening_balances** | [**Array<EmployeeOpeningBalance>**](EmployeeOpeningBalance.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeOpeningBalancesObject.new(pagination: null, + problem: null, + opening_balances: null) +``` + + diff --git a/docs/payroll_nz/EmployeePayTemplate.md b/docs/payroll_nz/EmployeePayTemplate.md new file mode 100644 index 00000000..d5cea6ab --- /dev/null +++ b/docs/payroll_nz/EmployeePayTemplate.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::EmployeePayTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | Unique identifier for the employee | [optional] +**earning_templates** | [**Array<EarningsTemplate>**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeePayTemplate.new(employee_id: null, + earning_templates: null) +``` + + diff --git a/docs/payroll_nz/EmployeePayTemplateObject.md b/docs/payroll_nz/EmployeePayTemplateObject.md new file mode 100644 index 00000000..7ee5c451 --- /dev/null +++ b/docs/payroll_nz/EmployeePayTemplateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeePayTemplateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_template** | [**EmployeePayTemplate**](EmployeePayTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeePayTemplateObject.new(pagination: null, + problem: null, + pay_template: null) +``` + + diff --git a/docs/payroll_nz/EmployeePayTemplates.md b/docs/payroll_nz/EmployeePayTemplates.md new file mode 100644 index 00000000..900e818c --- /dev/null +++ b/docs/payroll_nz/EmployeePayTemplates.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeePayTemplates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_template** | [**EmployeePayTemplate**](EmployeePayTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeePayTemplates.new(pagination: null, + problem: null, + pay_template: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutoryLeaveBalance.md b/docs/payroll_nz/EmployeeStatutoryLeaveBalance.md new file mode 100644 index 00000000..11dc34e1 --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutoryLeaveBalance.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type** | **String** | The type of statutory leave | [optional] +**balance_remaining** | **BigDecimal** | The balance remaining for the corresponding leave type as of specified date. | [optional] +**units** | **String** | The units will be \"Hours\" | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance.new(leave_type: null, + balance_remaining: null, + units: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutoryLeaveBalanceObject.md b/docs/payroll_nz/EmployeeStatutoryLeaveBalanceObject.md new file mode 100644 index 00000000..b055f0ec --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutoryLeaveBalanceObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_balance** | [**EmployeeStatutoryLeaveBalance**](EmployeeStatutoryLeaveBalance.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject.new(pagination: null, + problem: null, + leave_balance: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutoryLeaveSummary.md b/docs/payroll_nz/EmployeeStatutoryLeaveSummary.md new file mode 100644 index 00000000..f5d1a2ac --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutoryLeaveSummary.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_leave_id** | **String** | The unique identifier (guid) of a statutory leave. | [optional] +**employee_id** | **String** | The unique identifier (guid) of the employee | [optional] +**type** | **String** | The category of statutory leave | [optional] +**start_date** | **Date** | The date when the leave starts | [optional] +**end_date** | **Date** | The date when the leave ends | [optional] +**is_entitled** | **Boolean** | Whether the leave was entitled to receive payment | [optional] +**status** | **String** | The status of the leave | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary.new(statutory_leave_id: null, + employee_id: null, + type: null, + start_date: null, + end_date: null, + is_entitled: null, + status: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutoryLeavesSummaries.md b/docs/payroll_nz/EmployeeStatutoryLeavesSummaries.md new file mode 100644 index 00000000..8efaf653 --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutoryLeavesSummaries.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_leaves** | [**Array<EmployeeStatutoryLeaveSummary>**](EmployeeStatutoryLeaveSummary.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries.new(pagination: null, + problem: null, + statutory_leaves: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutorySickLeave.md b/docs/payroll_nz/EmployeeStatutorySickLeave.md new file mode 100644 index 00000000..0b6f1ddc --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutorySickLeave.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollNz::EmployeeStatutorySickLeave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_leave_id** | **String** | The unique identifier (guid) of a statutory leave | [optional] +**employee_id** | **String** | The unique identifier (guid) of the employee | +**leave_type_id** | **String** | The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item | +**start_date** | **Date** | The date when the leave starts | +**end_date** | **Date** | The date when the leave ends | +**type** | **String** | the type of statutory leave | [optional] +**status** | **String** | the type of statutory leave | [optional] +**work_pattern** | **Array<String>** | The days of the work week the employee is scheduled to work at the time the leave is taken | +**is_pregnancy_related** | **Boolean** | Whether the sick leave was pregnancy related | +**sufficient_notice** | **Boolean** | Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request | +**is_entitled** | **Boolean** | Whether the leave was entitled to receive payment | [optional] +**entitlement_weeks_requested** | **BigDecimal** | The amount of requested time (in weeks) | [optional] +**entitlement_weeks_qualified** | **BigDecimal** | The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested | [optional] +**entitlement_weeks_remaining** | **BigDecimal** | A calculated amount of time (in weeks) that remains for the statutory sick leave period | [optional] +**overlaps_with_other_leave** | **Boolean** | Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts | [optional] +**entitlement_failure_reasons** | **Array<String>** | If the leave requested was considered \"not entitled\", the reasons why are listed here. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeave.new(statutory_leave_id: null, + employee_id: null, + leave_type_id: null, + start_date: null, + end_date: null, + type: Sick, + status: Pending, + work_pattern: null, + is_pregnancy_related: null, + sufficient_notice: null, + is_entitled: null, + entitlement_weeks_requested: null, + entitlement_weeks_qualified: null, + entitlement_weeks_remaining: null, + overlaps_with_other_leave: null, + entitlement_failure_reasons: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutorySickLeaveObject.md b/docs/payroll_nz/EmployeeStatutorySickLeaveObject.md new file mode 100644 index 00000000..c7eb62eb --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutorySickLeaveObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_sick_leave** | [**EmployeeStatutorySickLeave**](EmployeeStatutorySickLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject.new(pagination: null, + problem: null, + statutory_sick_leave: null) +``` + + diff --git a/docs/payroll_nz/EmployeeStatutorySickLeaves.md b/docs/payroll_nz/EmployeeStatutorySickLeaves.md new file mode 100644 index 00000000..c53fe4f8 --- /dev/null +++ b/docs/payroll_nz/EmployeeStatutorySickLeaves.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeStatutorySickLeaves + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_sick_leave** | [**Array<EmployeeStatutorySickLeave>**](EmployeeStatutorySickLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeaves.new(pagination: null, + problem: null, + statutory_sick_leave: null) +``` + + diff --git a/docs/payroll_nz/EmployeeTax.md b/docs/payroll_nz/EmployeeTax.md new file mode 100644 index 00000000..49ddc29b --- /dev/null +++ b/docs/payroll_nz/EmployeeTax.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollNz::EmployeeTax + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ird_number** | **String** | The IRD Number. | [optional] +**tax_code** | [**TaxCode**](TaxCode.md) | | [optional] +**special_tax_rate_percentage** | **BigDecimal** | Special tax rate percentage. | [optional] +**has_special_student_loan_rate** | **Boolean** | Does the employee has a special student loan rate? | [optional] +**special_student_loan_rate_percentage** | **BigDecimal** | The employee student loan rate percentage. | [optional] +**is_eligible_for_kiwi_saver** | **Boolean** | The employee eligibility for KiwiSaver. | [optional] +**esct_rate_percentage** | **BigDecimal** | Employer superannuation contribution tax rate. | [optional] +**kiwi_saver_contributions** | **String** | Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership | [optional] +**kiwi_saver_employee_contribution_rate_percentage** | **BigDecimal** | Employee Contribution percentage. | [optional] +**kiwi_saver_employer_contribution_rate_percentage** | **BigDecimal** | Employer Contribution percentage. | [optional] +**kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage** | **BigDecimal** | Employer Contribution through Salary Sacrifice percentage. | [optional] +**kiwi_saver_opt_out_date** | **Date** | Opt Out Date. | [optional] +**kiwi_saver_contribution_holiday_end_date** | **Date** | Contribution holiday expiry date or end date. | [optional] +**has_student_loan_balance** | **Boolean** | Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. | [optional] +**student_loan_balance** | **BigDecimal** | The employee's student loan balance shown on the letter from IR. | [optional] +**student_loan_as_at** | **Date** | The date of the letter from IR. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeTax.new(ird_number: 111111111, + tax_code: null, + special_tax_rate_percentage: 17.5, + has_special_student_loan_rate: true, + special_student_loan_rate_percentage: 2.0, + is_eligible_for_kiwi_saver: true, + esct_rate_percentage: 1.0, + kiwi_saver_contributions: MakeContributions, + kiwi_saver_employee_contribution_rate_percentage: 4.0, + kiwi_saver_employer_contribution_rate_percentage: 10.0, + kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage: 2.0, + kiwi_saver_opt_out_date: null, + kiwi_saver_contribution_holiday_end_date: null, + has_student_loan_balance: false, + student_loan_balance: 30.0, + student_loan_as_at: null) +``` + + diff --git a/docs/payroll_nz/EmployeeTaxObject.md b/docs/payroll_nz/EmployeeTaxObject.md new file mode 100644 index 00000000..f5765e7a --- /dev/null +++ b/docs/payroll_nz/EmployeeTaxObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeTaxObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employee_tax** | [**EmployeeTax**](EmployeeTax.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeTaxObject.new(pagination: null, + problem: null, + employee_tax: null) +``` + + diff --git a/docs/payroll_nz/Employees.md b/docs/payroll_nz/Employees.md new file mode 100644 index 00000000..b5a4a2f3 --- /dev/null +++ b/docs/payroll_nz/Employees.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Employees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employees** | [**Array<Employee>**](Employee.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Employees.new(pagination: null, + problem: null, + employees: null) +``` + + diff --git a/docs/payroll_nz/Employment.md b/docs/payroll_nz/Employment.md new file mode 100644 index 00000000..18bb70f3 --- /dev/null +++ b/docs/payroll_nz/Employment.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Employment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional] +**pay_run_calendar_id** | **String** | Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) | [optional] +**start_date** | **Date** | Start date of the employment (YYYY-MM-DD) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Employment.new(payroll_calendar_id: null, + pay_run_calendar_id: null, + start_date: null) +``` + + diff --git a/docs/payroll_nz/EmploymentObject.md b/docs/payroll_nz/EmploymentObject.md new file mode 100644 index 00000000..7ed3a57c --- /dev/null +++ b/docs/payroll_nz/EmploymentObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmploymentObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employment** | [**Employment**](Employment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmploymentObject.new(pagination: null, + problem: null, + employment: null) +``` + + diff --git a/docs/payroll_nz/GrossEarningsHistory.md b/docs/payroll_nz/GrossEarningsHistory.md new file mode 100644 index 00000000..86ef940e --- /dev/null +++ b/docs/payroll_nz/GrossEarningsHistory.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::GrossEarningsHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**days_paid** | **Integer** | Number of days the employee worked in the pay period (0 - 365) | [optional] +**unpaid_weeks** | **Integer** | Number of full weeks the employee didn't work in the pay period (0 - 52) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::GrossEarningsHistory.new(days_paid: null, + unpaid_weeks: null) +``` + + diff --git a/docs/payroll_nz/InvalidField.md b/docs/payroll_nz/InvalidField.md new file mode 100644 index 00000000..69f6fb0b --- /dev/null +++ b/docs/payroll_nz/InvalidField.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::InvalidField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the field that caused the error | [optional] +**reason** | **String** | The reason the error occurred | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::InvalidField.new(name: DateOfBirth, + reason: The Date of Birth is required.) +``` + + diff --git a/docs/payroll_nz/LeaveAccrualLine.md b/docs/payroll_nz/LeaveAccrualLine.md new file mode 100644 index 00000000..ae70241b --- /dev/null +++ b/docs/payroll_nz/LeaveAccrualLine.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::LeaveAccrualLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | Xero identifier for the Leave type | [optional] +**number_of_units** | **BigDecimal** | Leave accrual number of units | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeaveAccrualLine.new(leave_type_id: null, + number_of_units: null) +``` + + diff --git a/docs/payroll_nz/LeaveEarningsLine.md b/docs/payroll_nz/LeaveEarningsLine.md new file mode 100644 index 00000000..2517f982 --- /dev/null +++ b/docs/payroll_nz/LeaveEarningsLine.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::LeaveEarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_line_id** | **String** | Xero identifier for payroll earnings line | [optional] +**earnings_rate_id** | **String** | Xero identifier for payroll leave earnings rate | [optional] +**display_name** | **String** | name of earnings rate for display in UI | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit for leave earnings line | [optional] +**number_of_units** | **BigDecimal** | Leave earnings number of units | [optional] +**fixed_amount** | **BigDecimal** | Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **BigDecimal** | The amount of the earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the leave earnings is taken from the timesheet. False for leave earnings line | [optional] +**is_average_daily_pay_rate** | **Boolean** | Identifies if the earnings is using an average daily pay rate | [optional] +**is_system_generated** | **Boolean** | Flag to indentify whether the earnings line is system generated or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeaveEarningsLine.new(earnings_line_id: null, + earnings_rate_id: null, + display_name: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null, + is_average_daily_pay_rate: null, + is_system_generated: null) +``` + + diff --git a/docs/payroll_nz/LeavePeriod.md b/docs/payroll_nz/LeavePeriod.md new file mode 100644 index 00000000..845ebea0 --- /dev/null +++ b/docs/payroll_nz/LeavePeriod.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::LeavePeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period_start_date** | **Date** | The Pay Period Start Date (YYYY-MM-DD) | [optional] +**period_end_date** | **Date** | The Pay Period End Date (YYYY-MM-DD) | [optional] +**number_of_units** | **BigDecimal** | The Number of Units for the leave | [optional] +**period_status** | **String** | Period Status | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeavePeriod.new(period_start_date: null, + period_end_date: null, + number_of_units: null, + period_status: null) +``` + + diff --git a/docs/payroll_nz/LeavePeriods.md b/docs/payroll_nz/LeavePeriods.md new file mode 100644 index 00000000..8eb66aa7 --- /dev/null +++ b/docs/payroll_nz/LeavePeriods.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::LeavePeriods + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**periods** | [**Array<LeavePeriod>**](LeavePeriod.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeavePeriods.new(pagination: null, + problem: null, + periods: null) +``` + + diff --git a/docs/payroll_nz/LeaveType.md b/docs/payroll_nz/LeaveType.md new file mode 100644 index 00000000..3cf42a0c --- /dev/null +++ b/docs/payroll_nz/LeaveType.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::LeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | Xero unique identifier for the leave type | [optional] +**name** | **String** | Name of the leave type | +**is_paid_leave** | **Boolean** | Indicate that an employee will be paid when taking this type of leave | +**show_on_payslip** | **Boolean** | Indicate that a balance for this leave type to be shown on the employee’s payslips | +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the leave type note | [optional] +**is_active** | **Boolean** | Shows whether the leave type is active or not | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeaveType.new(leave_type_id: null, + name: null, + is_paid_leave: null, + show_on_payslip: null, + updated_date_utc: null, + is_active: null) +``` + + diff --git a/docs/payroll_nz/LeaveTypeObject.md b/docs/payroll_nz/LeaveTypeObject.md new file mode 100644 index 00000000..17c9744f --- /dev/null +++ b/docs/payroll_nz/LeaveTypeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::LeaveTypeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_type** | [**LeaveType**](LeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeaveTypeObject.new(pagination: null, + problem: null, + leave_type: null) +``` + + diff --git a/docs/payroll_nz/LeaveTypes.md b/docs/payroll_nz/LeaveTypes.md new file mode 100644 index 00000000..84a927da --- /dev/null +++ b/docs/payroll_nz/LeaveTypes.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::LeaveTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_types** | [**Array<LeaveType>**](LeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::LeaveTypes.new(pagination: null, + problem: null, + leave_types: null) +``` + + diff --git a/docs/payroll_nz/Pagination.md b/docs/payroll_nz/Pagination.md new file mode 100644 index 00000000..706c38c6 --- /dev/null +++ b/docs/payroll_nz/Pagination.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::Pagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **Integer** | | [optional] +**page_size** | **Integer** | | [optional] +**page_count** | **Integer** | | [optional] +**item_count** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Pagination.new(page: 1, + page_size: 10, + page_count: 1, + item_count: 2) +``` + + diff --git a/docs/payroll_nz/PayRun.md b/docs/payroll_nz/PayRun.md new file mode 100644 index 00000000..29672f5d --- /dev/null +++ b/docs/payroll_nz/PayRun.md @@ -0,0 +1,39 @@ +# XeroRuby::PayrollNz::PayRun + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_run_id** | **String** | Xero unique identifier for the pay run | [optional] +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar | [optional] +**period_start_date** | **Date** | Period start date of the payroll calendar | [optional] +**period_end_date** | **Date** | Period end date of the payroll calendar | [optional] +**payment_date** | **Date** | Payment date of the pay run | [optional] +**total_cost** | **BigDecimal** | Total cost of the pay run | [optional] +**total_pay** | **BigDecimal** | Total pay of the pay run | [optional] +**pay_run_status** | **String** | Pay run status | [optional] +**pay_run_type** | **String** | Pay run type | [optional] +**calendar_type** | **String** | Calendar type of the pay run | [optional] +**posted_date_time** | **Date** | Posted date time of the pay run | [optional] +**pay_slips** | [**Array<PaySlip>**](PaySlip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRun.new(pay_run_id: null, + payroll_calendar_id: null, + period_start_date: null, + period_end_date: null, + payment_date: null, + total_cost: null, + total_pay: null, + pay_run_status: null, + pay_run_type: null, + calendar_type: null, + posted_date_time: null, + pay_slips: null) +``` + + diff --git a/docs/payroll_nz/PayRunCalendar.md b/docs/payroll_nz/PayRunCalendar.md new file mode 100644 index 00000000..2a9a0b90 --- /dev/null +++ b/docs/payroll_nz/PayRunCalendar.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollNz::PayRunCalendar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar | [optional] +**name** | **String** | Name of the calendar | +**calendar_type** | **String** | Type of the calendar | +**period_start_date** | **Date** | Period start date of the calendar | +**period_end_date** | **Date** | Period end date of the calendar | [optional] +**payment_date** | **Date** | Payment date of the calendar | +**updated_date_utc** | **DateTime** | UTC timestamp of the last update to the pay run calendar | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRunCalendar.new(payroll_calendar_id: null, + name: null, + calendar_type: null, + period_start_date: null, + period_end_date: null, + payment_date: null, + updated_date_utc: null) +``` + + diff --git a/docs/payroll_nz/PayRunCalendarObject.md b/docs/payroll_nz/PayRunCalendarObject.md new file mode 100644 index 00000000..014a4da9 --- /dev/null +++ b/docs/payroll_nz/PayRunCalendarObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PayRunCalendarObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run_calendar** | [**PayRunCalendar**](PayRunCalendar.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRunCalendarObject.new(pagination: null, + problem: null, + pay_run_calendar: null) +``` + + diff --git a/docs/payroll_nz/PayRunCalendars.md b/docs/payroll_nz/PayRunCalendars.md new file mode 100644 index 00000000..ac32ca4a --- /dev/null +++ b/docs/payroll_nz/PayRunCalendars.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PayRunCalendars + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run_calendars** | [**Array<PayRunCalendar>**](PayRunCalendar.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRunCalendars.new(pagination: null, + problem: null, + pay_run_calendars: null) +``` + + diff --git a/docs/payroll_nz/PayRunObject.md b/docs/payroll_nz/PayRunObject.md new file mode 100644 index 00000000..ff0412e8 --- /dev/null +++ b/docs/payroll_nz/PayRunObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PayRunObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run** | [**PayRun**](PayRun.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRunObject.new(pagination: null, + problem: null, + pay_run: null) +``` + + diff --git a/docs/payroll_nz/PayRuns.md b/docs/payroll_nz/PayRuns.md new file mode 100644 index 00000000..17f49568 --- /dev/null +++ b/docs/payroll_nz/PayRuns.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PayRuns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_runs** | [**Array<PayRun>**](PayRun.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PayRuns.new(pagination: null, + problem: null, + pay_runs: null) +``` + + diff --git a/docs/payroll_nz/PaySlip.md b/docs/payroll_nz/PaySlip.md new file mode 100644 index 00000000..9dafa589 --- /dev/null +++ b/docs/payroll_nz/PaySlip.md @@ -0,0 +1,75 @@ +# XeroRuby::PayrollNz::PaySlip + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_slip_id** | **String** | The Xero identifier for a PaySlip | [optional] +**employee_id** | **String** | The Xero identifier for payroll employee | [optional] +**pay_run_id** | **String** | The Xero identifier for the associated payrun | [optional] +**last_edited** | **Date** | The date payslip was last updated | [optional] +**first_name** | **String** | Employee first name | [optional] +**last_name** | **String** | Employee last name | [optional] +**total_earnings** | **BigDecimal** | Total earnings before any deductions. Same as gross earnings for NZ. | [optional] +**gross_earnings** | **BigDecimal** | Total earnings before any deductions. Same as total earnings for NZ. | [optional] +**total_pay** | **BigDecimal** | The employee net pay | [optional] +**total_employer_taxes** | **BigDecimal** | The employer's tax obligation | [optional] +**total_employee_taxes** | **BigDecimal** | The part of an employee's earnings that is deducted for tax purposes | [optional] +**total_deductions** | **BigDecimal** | Total amount subtracted from an employee's earnings to reach total pay | [optional] +**total_reimbursements** | **BigDecimal** | Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment | [optional] +**total_statutory_deductions** | **BigDecimal** | Total amounts required by law to subtract from the employee's earnings | [optional] +**total_superannuation** | **BigDecimal** | Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries | [optional] +**bacs_hash** | **String** | BACS Service User Number | [optional] +**payment_method** | **String** | The payment method code | [optional] +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**leave_earnings_lines** | [**Array<LeaveEarningsLine>**](LeaveEarningsLine.md) | | [optional] +**timesheet_earnings_lines** | [**Array<TimesheetEarningsLine>**](TimesheetEarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**leave_accrual_lines** | [**Array<LeaveAccrualLine>**](LeaveAccrualLine.md) | | [optional] +**superannuation_lines** | [**Array<SuperannuationLine>**](SuperannuationLine.md) | | [optional] +**payment_lines** | [**Array<PaymentLine>**](PaymentLine.md) | | [optional] +**employee_tax_lines** | [**Array<TaxLine>**](TaxLine.md) | | [optional] +**employer_tax_lines** | [**Array<TaxLine>**](TaxLine.md) | | [optional] +**statutory_deduction_lines** | [**Array<StatutoryDeductionLine>**](StatutoryDeductionLine.md) | | [optional] +**tax_settings** | [**TaxSettings**](TaxSettings.md) | | [optional] +**gross_earnings_history** | [**GrossEarningsHistory**](GrossEarningsHistory.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaySlip.new(pay_slip_id: null, + employee_id: null, + pay_run_id: null, + last_edited: null, + first_name: null, + last_name: null, + total_earnings: null, + gross_earnings: null, + total_pay: null, + total_employer_taxes: null, + total_employee_taxes: null, + total_deductions: null, + total_reimbursements: null, + total_statutory_deductions: null, + total_superannuation: null, + bacs_hash: null, + payment_method: null, + earnings_lines: null, + leave_earnings_lines: null, + timesheet_earnings_lines: null, + deduction_lines: null, + reimbursement_lines: null, + leave_accrual_lines: null, + superannuation_lines: null, + payment_lines: null, + employee_tax_lines: null, + employer_tax_lines: null, + statutory_deduction_lines: null, + tax_settings: null, + gross_earnings_history: null) +``` + + diff --git a/docs/payroll_nz/PaySlipObject.md b/docs/payroll_nz/PaySlipObject.md new file mode 100644 index 00000000..edcd1f1b --- /dev/null +++ b/docs/payroll_nz/PaySlipObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PaySlipObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_slip** | [**PaySlip**](PaySlip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaySlipObject.new(pagination: null, + problem: null, + pay_slip: null) +``` + + diff --git a/docs/payroll_nz/PaySlips.md b/docs/payroll_nz/PaySlips.md new file mode 100644 index 00000000..dcec34bb --- /dev/null +++ b/docs/payroll_nz/PaySlips.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PaySlips + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_slips** | [**Array<PaySlip>**](PaySlip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaySlips.new(pagination: null, + problem: null, + pay_slips: null) +``` + + diff --git a/docs/payroll_nz/PaymentLine.md b/docs/payroll_nz/PaymentLine.md new file mode 100644 index 00000000..43318b5c --- /dev/null +++ b/docs/payroll_nz/PaymentLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::PaymentLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_line_id** | **String** | Xero identifier for payroll payment line | [optional] +**amount** | **BigDecimal** | The amount of the payment line | [optional] +**account_number** | **String** | The account number | [optional] +**sort_code** | **String** | The account sort code | [optional] +**account_name** | **String** | The account name | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaymentLine.new(payment_line_id: null, + amount: null, + account_number: null, + sort_code: null, + account_name: null) +``` + + diff --git a/docs/payroll_nz/PaymentMethod.md b/docs/payroll_nz/PaymentMethod.md new file mode 100644 index 00000000..7d50f673 --- /dev/null +++ b/docs/payroll_nz/PaymentMethod.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::PaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_method** | **String** | The payment method code | +**bank_accounts** | [**Array<BankAccount>**](BankAccount.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaymentMethod.new(payment_method: null, + bank_accounts: null) +``` + + diff --git a/docs/payroll_nz/PaymentMethodObject.md b/docs/payroll_nz/PaymentMethodObject.md new file mode 100644 index 00000000..39621d72 --- /dev/null +++ b/docs/payroll_nz/PaymentMethodObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::PaymentMethodObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**payment_method** | [**PaymentMethod**](PaymentMethod.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::PaymentMethodObject.new(pagination: null, + problem: null, + payment_method: null) +``` + + diff --git a/docs/payroll_nz/PayrollNzApi.md b/docs/payroll_nz/PayrollNzApi.md new file mode 100644 index 00000000..f850e620 --- /dev/null +++ b/docs/payroll_nz/PayrollNzApi.md @@ -0,0 +1,4544 @@ +# XeroRuby::PayrollNz::PayrollNzApi + +All URIs are relative to *https://api.xero.com/payroll.xro/2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**approve_timesheet**](PayrollNzApi.md#approve_timesheet) | **POST** /Timesheets/{TimesheetID}/Approve | approve a timesheet +[**create_deduction**](PayrollNzApi.md#create_deduction) | **POST** /Deductions | create a new deduction +[**create_earnings_rate**](PayrollNzApi.md#create_earnings_rate) | **POST** /EarningsRates | create a new earnings rate +[**create_employee**](PayrollNzApi.md#create_employee) | **POST** /Employees | creates employees +[**create_employee_earnings_template**](PayrollNzApi.md#create_employee_earnings_template) | **POST** /Employees/{EmployeeId}/PayTemplates/earnings | creates employee earnings template records +[**create_employee_leave**](PayrollNzApi.md#create_employee_leave) | **POST** /Employees/{EmployeeId}/Leave | creates employee leave records +[**create_employee_leave_setup**](PayrollNzApi.md#create_employee_leave_setup) | **POST** /Employees/{EmployeeId}/leaveSetup | Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee +[**create_employee_leave_type**](PayrollNzApi.md#create_employee_leave_type) | **POST** /Employees/{EmployeeId}/LeaveTypes | creates employee leave type records +[**create_employee_opening_balances**](PayrollNzApi.md#create_employee_opening_balances) | **POST** /Employees/{EmployeeId}/openingBalances | creates employee opening balances +[**create_employee_payment_method**](PayrollNzApi.md#create_employee_payment_method) | **POST** /Employees/{EmployeeId}/PaymentMethods | creates employee payment method +[**create_employee_salary_and_wage**](PayrollNzApi.md#create_employee_salary_and_wage) | **POST** /Employees/{EmployeeId}/SalaryAndWages | creates employee salary and wage record +[**create_employment**](PayrollNzApi.md#create_employment) | **POST** /Employees/{EmployeeId}/Employment | creates employment +[**create_leave_type**](PayrollNzApi.md#create_leave_type) | **POST** /LeaveTypes | create a new leave type +[**create_multiple_employee_earnings_template**](PayrollNzApi.md#create_multiple_employee_earnings_template) | **POST** /Employees/{EmployeeId}/paytemplateearnings | creates multiple employee earnings template records +[**create_pay_run**](PayrollNzApi.md#create_pay_run) | **POST** /PayRuns | create a pay run +[**create_pay_run_calendar**](PayrollNzApi.md#create_pay_run_calendar) | **POST** /PayRunCalendars | create a new payrun calendar +[**create_reimbursement**](PayrollNzApi.md#create_reimbursement) | **POST** /Reimbursements | create a new reimbursement +[**create_superannuation**](PayrollNzApi.md#create_superannuation) | **POST** /superannuations | create a new superannuation +[**create_timesheet**](PayrollNzApi.md#create_timesheet) | **POST** /Timesheets | create a new timesheet +[**create_timesheet_line**](PayrollNzApi.md#create_timesheet_line) | **POST** /Timesheets/{TimesheetID}/Lines | create a new timesheet line +[**delete_employee_earnings_template**](PayrollNzApi.md#delete_employee_earnings_template) | **DELETE** /Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} | deletes an employee earnings template record +[**delete_employee_leave**](PayrollNzApi.md#delete_employee_leave) | **DELETE** /Employees/{EmployeeId}/Leave/{LeaveID} | deletes an employee leave record +[**delete_employee_salary_and_wage**](PayrollNzApi.md#delete_employee_salary_and_wage) | **DELETE** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | deletes an employee salary and wages record +[**delete_timesheet**](PayrollNzApi.md#delete_timesheet) | **DELETE** /Timesheets/{TimesheetID} | delete a timesheet +[**delete_timesheet_line**](PayrollNzApi.md#delete_timesheet_line) | **DELETE** /Timesheets/{TimesheetID}/Lines/{TimesheetLineID} | delete a timesheet line +[**get_deduction**](PayrollNzApi.md#get_deduction) | **GET** /Deductions/{deductionId} | retrieve a single deduction by id +[**get_deductions**](PayrollNzApi.md#get_deductions) | **GET** /Deductions | searches deductions +[**get_earnings_rate**](PayrollNzApi.md#get_earnings_rate) | **GET** /EarningsRates/{EarningsRateID} | retrieve a single earnings rates by id +[**get_earnings_rates**](PayrollNzApi.md#get_earnings_rates) | **GET** /EarningsRates | searches earnings rates +[**get_employee**](PayrollNzApi.md#get_employee) | **GET** /Employees/{EmployeeId} | searches employees +[**get_employee_leave_balances**](PayrollNzApi.md#get_employee_leave_balances) | **GET** /Employees/{EmployeeId}/LeaveBalances | search employee leave balances +[**get_employee_leave_periods**](PayrollNzApi.md#get_employee_leave_periods) | **GET** /Employees/{EmployeeId}/LeavePeriods | searches employee leave periods +[**get_employee_leave_types**](PayrollNzApi.md#get_employee_leave_types) | **GET** /Employees/{EmployeeId}/LeaveTypes | searches employee leave types +[**get_employee_leaves**](PayrollNzApi.md#get_employee_leaves) | **GET** /Employees/{EmployeeId}/Leave | search employee leave records +[**get_employee_opening_balances**](PayrollNzApi.md#get_employee_opening_balances) | **GET** /Employees/{EmployeeId}/openingBalances | retrieve employee openingbalances +[**get_employee_pay_templates**](PayrollNzApi.md#get_employee_pay_templates) | **GET** /Employees/{EmployeeId}/PayTemplates | searches employee pay templates +[**get_employee_payment_method**](PayrollNzApi.md#get_employee_payment_method) | **GET** /Employees/{EmployeeId}/PaymentMethods | retrieves an employee's payment method +[**get_employee_salary_and_wage**](PayrollNzApi.md#get_employee_salary_and_wage) | **GET** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | get employee salary and wages record by id +[**get_employee_salary_and_wages**](PayrollNzApi.md#get_employee_salary_and_wages) | **GET** /Employees/{EmployeeId}/SalaryAndWages | retrieves an employee's salary and wages +[**get_employee_tax**](PayrollNzApi.md#get_employee_tax) | **GET** /Employees/{EmployeeId}/Tax | searches tax records for an employee +[**get_employees**](PayrollNzApi.md#get_employees) | **GET** /Employees | searches employees +[**get_leave_type**](PayrollNzApi.md#get_leave_type) | **GET** /LeaveTypes/{LeaveTypeID} | retrieve a single leave type by id +[**get_leave_types**](PayrollNzApi.md#get_leave_types) | **GET** /LeaveTypes | searches leave types +[**get_pay_run**](PayrollNzApi.md#get_pay_run) | **GET** /PayRuns/{PayRunID} | retrieve a single pay run by id +[**get_pay_run_calendar**](PayrollNzApi.md#get_pay_run_calendar) | **GET** /PayRunCalendars/{PayrollCalendarID} | retrieve a single payrun calendar by id +[**get_pay_run_calendars**](PayrollNzApi.md#get_pay_run_calendars) | **GET** /PayRunCalendars | searches payrun calendars +[**get_pay_runs**](PayrollNzApi.md#get_pay_runs) | **GET** /PayRuns | searches pay runs +[**get_pay_slip**](PayrollNzApi.md#get_pay_slip) | **GET** /PaySlips/{PaySlipID} | retrieve a single payslip by id +[**get_pay_slips**](PayrollNzApi.md#get_pay_slips) | **GET** /PaySlips | searches payslips +[**get_reimbursement**](PayrollNzApi.md#get_reimbursement) | **GET** /Reimbursements/{ReimbursementID} | retrieve a single reimbursement by id +[**get_reimbursements**](PayrollNzApi.md#get_reimbursements) | **GET** /Reimbursements | searches reimbursements +[**get_settings**](PayrollNzApi.md#get_settings) | **GET** /Settings | searches settings +[**get_statutory_deduction**](PayrollNzApi.md#get_statutory_deduction) | **GET** /StatutoryDeductions/{Id} | retrieve a single statutory deduction by id +[**get_statutory_deductions**](PayrollNzApi.md#get_statutory_deductions) | **GET** /StatutoryDeductions | searches statutory deductions +[**get_superannuation**](PayrollNzApi.md#get_superannuation) | **GET** /superannuations/{SuperannuationID} | searches for a unique superannuation +[**get_superannuations**](PayrollNzApi.md#get_superannuations) | **GET** /superannuations | searches statutory deductions +[**get_timesheet**](PayrollNzApi.md#get_timesheet) | **GET** /Timesheets/{TimesheetID} | retrieve a single timesheet by id +[**get_timesheets**](PayrollNzApi.md#get_timesheets) | **GET** /Timesheets | searches timesheets +[**get_tracking_categories**](PayrollNzApi.md#get_tracking_categories) | **GET** /settings/trackingCategories | searches tracking categories +[**revert_timesheet**](PayrollNzApi.md#revert_timesheet) | **POST** /Timesheets/{TimesheetID}/RevertToDraft | revert a timesheet to draft +[**update_employee**](PayrollNzApi.md#update_employee) | **PUT** /Employees/{EmployeeId} | updates employee +[**update_employee_earnings_template**](PayrollNzApi.md#update_employee_earnings_template) | **PUT** /Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} | updates employee earnings template records +[**update_employee_leave**](PayrollNzApi.md#update_employee_leave) | **PUT** /Employees/{EmployeeId}/Leave/{LeaveID} | updates employee leave records +[**update_employee_salary_and_wage**](PayrollNzApi.md#update_employee_salary_and_wage) | **PUT** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | updates employee salary and wages record +[**update_employee_tax**](PayrollNzApi.md#update_employee_tax) | **POST** /Employees/{EmployeeId}/Tax | updates the tax records for an employee +[**update_pay_run**](PayrollNzApi.md#update_pay_run) | **PUT** /PayRuns/{PayRunID} | update a pay run +[**update_pay_slip_line_items**](PayrollNzApi.md#update_pay_slip_line_items) | **PUT** /PaySlips/{PaySlipID} | creates employee pay slip +[**update_timesheet_line**](PayrollNzApi.md#update_timesheet_line) | **PUT** /Timesheets/{TimesheetID}/Lines/{TimesheetLineID} | update a timesheet line + + + +## approve_timesheet + +> TimesheetObject approve_timesheet(xero_tenant_id, timesheet_id) + +approve a timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #approve a timesheet + result = api_instance.approve_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->approve_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## create_deduction + +> DeductionObject create_deduction(xero_tenant_id, deduction) + +create a new deduction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +deduction = { "deductionName": "My new deducation", "deductionCategory": "NzOther", "liabilityAccountId": "568f2e9a-0870-46cc-8678-f83f132ed4e3" } # Deduction | +begin + #create a new deduction + result = api_instance.create_deduction(xero_tenant_id, deduction) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_deduction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **deduction** | [**Deduction**](Deduction.md)| | + +### Return type + +[**DeductionObject**](DeductionObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_earnings_rate + +> EarningsRateObject create_earnings_rate(xero_tenant_id, earnings_rate) + +create a new earnings rate + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +earnings_rate = { "name": "My Earnings Rate", "earningsType": "RegularEarnings", "rateType": "RatePerUnit", "typeOfUnits": "hours", "expenseAccountID": "e4eb36f6-97e3-4427-a394-dd4e1b355c2e" } # EarningsRate | +begin + #create a new earnings rate + result = api_instance.create_earnings_rate(xero_tenant_id, earnings_rate) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_earnings_rate: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **earnings_rate** | [**EarningsRate**](EarningsRate.md)| | + +### Return type + +[**EarningsRateObject**](EarningsRateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee + +> EmployeeObject create_employee(xero_tenant_id, employee) + +creates employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee = { "title": "Mr", "firstName": "Mike", "lastName": "Johntzxzpxhmkgson", "dateOfBirth": "2000-01-01", "address": { "addressLine1": "101 Green St", "city": "San Francisco", "postCode": "4351", "countryName": "United Kingdom" }, "email": "83139@starkindustries.com", "gender": "M" } # Employee | +begin + #creates employees + result = api_instance.create_employee(xero_tenant_id, employee) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee** | [**Employee**](Employee.md)| | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_earnings_template + +> EarningsTemplateObject create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + +creates employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +earnings_template = { "ratePerUnit": 20, "numberOfUnits": 8, "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "name": "My New One" } # EarningsTemplate | +begin + #creates employee earnings template records + result = api_instance.create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **earnings_template** | [**EarningsTemplate**](EarningsTemplate.md)| | + +### Return type + +[**EarningsTemplateObject**](EarningsTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_leave + +> EmployeeLeaveObject create_employee_leave(xero_tenant_id, employee_id, employee_leave) + +creates employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_leave = { "leaveTypeID": "b0b1b79e-2a25-46c2-ad08-ca25ef48d7e4", "description": "Creating a Desription", "startDate": "2020-04-24", "endDate": "2020-04-26" } # EmployeeLeave | +begin + #creates employee leave records + result = api_instance.create_employee_leave(xero_tenant_id, employee_id, employee_leave) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_leave** | [**EmployeeLeave**](EmployeeLeave.md)| | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_leave_setup + +> EmployeeLeaveSetupObject create_employee_leave_setup(xero_tenant_id, employee_id, employee_leave_setup) + +Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_leave_setup = { "holidayPayOpeningBalance": 10, "annualLeaveOpeningBalance": 100, "sickLeaveHoursToAccrueAnnually": 20, "sickLeaveOpeningBalance": 10 } # EmployeeLeaveSetup | +begin + #Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee + result = api_instance.create_employee_leave_setup(xero_tenant_id, employee_id, employee_leave_setup) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_leave_setup: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_leave_setup** | [**EmployeeLeaveSetup**](EmployeeLeaveSetup.md)| | + +### Return type + +[**EmployeeLeaveSetupObject**](EmployeeLeaveSetupObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_leave_type + +> EmployeeLeaveTypeObject create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type) + +creates employee leave type records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_leave_type = { "leaveTypeID": "35da97ae-05b9-427f-9a98-69157ba42cec", "scheduleOfAccrual": "AnnuallyAfter6Months", "hoursAccruedAnnually": 10, "maximumToAccrue": 80, "openingBalance": 100, "rateAccruedHourly": 3.5 } # EmployeeLeaveType | +begin + #creates employee leave type records + result = api_instance.create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_leave_type** | [**EmployeeLeaveType**](EmployeeLeaveType.md)| | + +### Return type + +[**EmployeeLeaveTypeObject**](EmployeeLeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_opening_balances + +> EmployeeOpeningBalancesObject create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balance) + +creates employee opening balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_opening_balance = [{"periodEndDate":"2020-10-01","daysPaid":3,"unpaidWeeks":2,"grossEarnings":40.0}] # Array | +begin + #creates employee opening balances + result = api_instance.create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balance) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_opening_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_opening_balance** | [**Array<EmployeeOpeningBalance>**](EmployeeOpeningBalance.md)| | + +### Return type + +[**EmployeeOpeningBalancesObject**](EmployeeOpeningBalancesObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_payment_method + +> PaymentMethodObject create_employee_payment_method(xero_tenant_id, employee_id, payment_method) + +creates employee payment method + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +payment_method = XeroRuby::PayrollNz::PaymentMethod.new # PaymentMethod | +begin + #creates employee payment method + result = api_instance.create_employee_payment_method(xero_tenant_id, employee_id, payment_method) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_payment_method: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **payment_method** | [**PaymentMethod**](PaymentMethod.md)| | + +### Return type + +[**PaymentMethodObject**](PaymentMethodObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_salary_and_wage + +> SalaryAndWageObject create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage) + +creates employee salary and wage record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wage = { "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnitsPerWeek": 2, "ratePerUnit": 10, "numberOfUnitsPerDay": 2, "daysPerWeek": 1, "effectiveFrom": "2020-05-01", "annualSalary": 100, "status": "Active", "paymentType": "Salary" } # SalaryAndWage | +begin + #creates employee salary and wage record + result = api_instance.create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wage** | [**SalaryAndWage**](SalaryAndWage.md)| | + +### Return type + +[**SalaryAndWageObject**](SalaryAndWageObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employment + +> EmploymentObject create_employment(xero_tenant_id, employee_id, employment) + +creates employment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employment = { "payrollCalendarID": "9aa56064-990f-4ad3-a189-d966d8f6a030", "startDate": "2020-09-02" } # Employment | +begin + #creates employment + result = api_instance.create_employment(xero_tenant_id, employee_id, employment) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employment** | [**Employment**](Employment.md)| | + +### Return type + +[**EmploymentObject**](EmploymentObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_leave_type + +> LeaveTypeObject create_leave_type(xero_tenant_id, leave_type) + +create a new leave type + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_type = { "name": "My wqwhhiktun Leave", "isPaidLeave": false, "showOnPayslip": true } # LeaveType | +begin + #create a new leave type + result = api_instance.create_leave_type(xero_tenant_id, leave_type) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_type** | [**LeaveType**](LeaveType.md)| | + +### Return type + +[**LeaveTypeObject**](LeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_multiple_employee_earnings_template + +> EmployeeEarningsTemplates create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + +creates multiple employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +earnings_template = [{"ratePerUnit":20.0,"numberOfUnits":8.0,"earningsRateID":"f9d8f5b5-9049-47f4-8541-35e200f750a5"},{"ratePerUnit":0.0,"numberOfUnits":8.0,"earningsRateID":"65b83d94-f20f-45e1-85ae-387fcf460c26"}] # Array | +begin + #creates multiple employee earnings template records + result = api_instance.create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_multiple_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **earnings_template** | [**Array<EarningsTemplate>**](EarningsTemplate.md)| | + +### Return type + +[**EmployeeEarningsTemplates**](EmployeeEarningsTemplates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_pay_run + +> PayRunObject create_pay_run(xero_tenant_id, pay_run) + +create a pay run + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run = { "payrollCalendarID": "9aa56064-990f-4ad3-a189-d966d8f6a030", "periodStartDate": "2020-09-08", "periodEndDate": "2020-09-15", "paymentDate": "2020-09-20", "payRunStatus": "Draft", "payRunType": "Scheduled", "calendarType": "Weekly" } # PayRun | +begin + #create a pay run + result = api_instance.create_pay_run(xero_tenant_id, pay_run) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run** | [**PayRun**](PayRun.md)| | + +### Return type + +[**PayRunObject**](PayRunObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_pay_run_calendar + +> PayRunCalendarObject create_pay_run_calendar(xero_tenant_id, pay_run_calendar) + +create a new payrun calendar + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_calendar = { "name": "My Weekly Cal", "calendarType": "Weekly", "periodStartDate": "2020-05-01", "paymentDate": "2020-05-15" } # PayRunCalendar | +begin + #create a new payrun calendar + result = api_instance.create_pay_run_calendar(xero_tenant_id, pay_run_calendar) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_pay_run_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_calendar** | [**PayRunCalendar**](PayRunCalendar.md)| | + +### Return type + +[**PayRunCalendarObject**](PayRunCalendarObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_reimbursement + +> ReimbursementObject create_reimbursement(xero_tenant_id, reimbursement) + +create a new reimbursement + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +reimbursement = { "name": "My new Reimburse", "accountID": "fa5cdc43-643b-4ad8-b4ac-3ffe0d0f4488", "reimbursementCategory": "GSTInclusive", "calculationType": "FixedAmount" } # Reimbursement | +begin + #create a new reimbursement + result = api_instance.create_reimbursement(xero_tenant_id, reimbursement) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_reimbursement: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **reimbursement** | [**Reimbursement**](Reimbursement.md)| | + +### Return type + +[**ReimbursementObject**](ReimbursementObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_superannuation + +> SuperannuationObject create_superannuation(xero_tenant_id, benefit) + +create a new superannuation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +benefit = { "name": "SidSaver", "category": "Other", "liabilityAccountId": "568f2e9a-0870-46cc-8678-f83f132ed4e3", "expenseAccountId": "e4eb36f6-97e3-4427-a394-dd4e1b355c2e", "CalculationTypeNZ": "FixedAmount", "standardAmount": 10 } # Benefit | +begin + #create a new superannuation + result = api_instance.create_superannuation(xero_tenant_id, benefit) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_superannuation: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **benefit** | [**Benefit**](Benefit.md)| | + +### Return type + +[**SuperannuationObject**](SuperannuationObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_timesheet + +> TimesheetObject create_timesheet(xero_tenant_id, timesheet) + +create a new timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet = { "payrollCalendarID": "9aa56064-990f-4ad3-a189-d966d8f6a030", "employeeID": "68342973-c405-4b86-b5d3-d7b877c27995", "startDate": "2020-04-13", "endDate": "2020-04-19", "timesheetLines": [ { "date": "2020-04-13", "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnits": 8 }, { "date": "2020-04-15", "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnits": 6 } ] } # Timesheet | +begin + #create a new timesheet + result = api_instance.create_timesheet(xero_tenant_id, timesheet) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet** | [**Timesheet**](Timesheet.md)| | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_timesheet_line + +> TimesheetLineObject create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line) + +create a new timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line = { "date": "2020-08-03", "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnits": 1 } # TimesheetLine | +begin + #create a new timesheet line + result = api_instance.create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line** | [**TimesheetLine**](TimesheetLine.md)| | + +### Return type + +[**TimesheetLineObject**](TimesheetLineObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_employee_earnings_template + +> EarningsTemplateObject delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id) + +deletes an employee earnings template record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +begin + #deletes an employee earnings template record + result = api_instance.delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **pay_template_earning_id** | [**String**](.md)| Id for single pay template earnings object | + +### Return type + +[**EarningsTemplateObject**](EarningsTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_employee_leave + +> EmployeeLeaveObject delete_employee_leave(xero_tenant_id, employee_id, leave_id) + +deletes an employee leave record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314' # String | Leave id for single object +begin + #deletes an employee leave record + result = api_instance.delete_employee_leave(xero_tenant_id, employee_id, leave_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_id** | [**String**](.md)| Leave id for single object | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_employee_salary_and_wage + +> SalaryAndWageObject delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + +deletes an employee salary and wages record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single salary and wages object +begin + #deletes an employee salary and wages record + result = api_instance.delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single salary and wages object | + +### Return type + +[**SalaryAndWageObject**](SalaryAndWageObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_timesheet + +> TimesheetLine delete_timesheet(xero_tenant_id, timesheet_id) + +delete a timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #delete a timesheet + result = api_instance.delete_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetLine**](TimesheetLine.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_timesheet_line + +> TimesheetLine delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id) + +delete a timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line_id = 'timesheet_line_id_example' # String | Identifier for the timesheet line +begin + #delete a timesheet line + result = api_instance.delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line_id** | [**String**](.md)| Identifier for the timesheet line | + +### Return type + +[**TimesheetLine**](TimesheetLine.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_deduction + +> DeductionObject get_deduction(xero_tenant_id, deduction_id) + +retrieve a single deduction by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +deduction_id = 'deduction_id_example' # String | Identifier for the deduction +begin + #retrieve a single deduction by id + result = api_instance.get_deduction(xero_tenant_id, deduction_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_deduction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **deduction_id** | [**String**](.md)| Identifier for the deduction | + +### Return type + +[**DeductionObject**](DeductionObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_deductions + +> Deductions get_deductions(xero_tenant_id, opts) + +searches deductions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches deductions + result = api_instance.get_deductions(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_deductions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Deductions**](Deductions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_rate + +> EarningsRateObject get_earnings_rate(xero_tenant_id, earnings_rate_id) + +retrieve a single earnings rates by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +earnings_rate_id = 'earnings_rate_id_example' # String | Identifier for the earnings rate +begin + #retrieve a single earnings rates by id + result = api_instance.get_earnings_rate(xero_tenant_id, earnings_rate_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_earnings_rate: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **earnings_rate_id** | [**String**](.md)| Identifier for the earnings rate | + +### Return type + +[**EarningsRateObject**](EarningsRateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_rates + +> EarningsRates get_earnings_rates(xero_tenant_id, opts) + +searches earnings rates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches earnings rates + result = api_instance.get_earnings_rates(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_earnings_rates: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**EarningsRates**](EarningsRates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee + +> EmployeeObject get_employee(xero_tenant_id, employee_id) + +searches employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employees + result = api_instance.get_employee(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_balances + +> EmployeeLeaveBalances get_employee_leave_balances(xero_tenant_id, employee_id) + +search employee leave balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #search employee leave balances + result = api_instance.get_employee_leave_balances(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_leave_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaveBalances**](EmployeeLeaveBalances.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_periods + +> LeavePeriods get_employee_leave_periods(xero_tenant_id, employee_id, opts) + +searches employee leave periods + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + start_date: Date.parse('2013-10-20'), # Date | Filter by start date + + end_date: Date.parse('Johnson') # Date | Filter by end date +} + +begin + #searches employee leave periods + result = api_instance.get_employee_leave_periods(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_leave_periods: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **start_date** | **Date**| Filter by start date | [optional] + **end_date** | **Date**| Filter by end date | [optional] + +### Return type + +[**LeavePeriods**](LeavePeriods.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_types + +> EmployeeLeaveTypes get_employee_leave_types(xero_tenant_id, employee_id) + +searches employee leave types + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employee leave types + result = api_instance.get_employee_leave_types(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_leave_types: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaveTypes**](EmployeeLeaveTypes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leaves + +> EmployeeLeaves get_employee_leaves(xero_tenant_id, employee_id) + +search employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #search employee leave records + result = api_instance.get_employee_leaves(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_leaves: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaves**](EmployeeLeaves.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_opening_balances + +> EmployeeOpeningBalancesObject get_employee_opening_balances(xero_tenant_id, employee_id) + +retrieve employee openingbalances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #retrieve employee openingbalances + result = api_instance.get_employee_opening_balances(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_opening_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeOpeningBalancesObject**](EmployeeOpeningBalancesObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_pay_templates + +> EmployeePayTemplates get_employee_pay_templates(xero_tenant_id, employee_id) + +searches employee pay templates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employee pay templates + result = api_instance.get_employee_pay_templates(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_pay_templates: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeePayTemplates**](EmployeePayTemplates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_payment_method + +> PaymentMethodObject get_employee_payment_method(xero_tenant_id, employee_id) + +retrieves an employee's payment method + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #retrieves an employee's payment method + result = api_instance.get_employee_payment_method(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_payment_method: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**PaymentMethodObject**](PaymentMethodObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_salary_and_wage + +> SalaryAndWages get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + +get employee salary and wages record by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +begin + #get employee salary and wages record by id + result = api_instance.get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single pay template earnings object | + +### Return type + +[**SalaryAndWages**](SalaryAndWages.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_salary_and_wages + +> SalaryAndWages get_employee_salary_and_wages(xero_tenant_id, employee_id, opts) + +retrieves an employee's salary and wages + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #retrieves an employee's salary and wages + result = api_instance.get_employee_salary_and_wages(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_salary_and_wages: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**SalaryAndWages**](SalaryAndWages.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_tax + +> EmployeeTaxObject get_employee_tax(xero_tenant_id, employee_id) + +searches tax records for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches tax records for an employee + result = api_instance.get_employee_tax(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_tax: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeTaxObject**](EmployeeTaxObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employees + +> Employees get_employees(xero_tenant_id, opts) + +searches employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + first_name: 'John', # String | Filter by first name + + last_name: 'Johnson', # String | Filter by last name + + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches employees + result = api_instance.get_employees(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **first_name** | **String**| Filter by first name | [optional] + **last_name** | **String**| Filter by last name | [optional] + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_type + +> LeaveTypeObject get_leave_type(xero_tenant_id, leave_type_id) + +retrieve a single leave type by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_type_id = 'leave_type_id_example' # String | Identifier for the leave type +begin + #retrieve a single leave type by id + result = api_instance.get_leave_type(xero_tenant_id, leave_type_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_type_id** | [**String**](.md)| Identifier for the leave type | + +### Return type + +[**LeaveTypeObject**](LeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_types + +> LeaveTypes get_leave_types(xero_tenant_id, opts) + +searches leave types + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + active_only: true # Boolean | Filters leave types by active status. By default the API returns all leave types. +} + +begin + #searches leave types + result = api_instance.get_leave_types(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_leave_types: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **active_only** | **Boolean**| Filters leave types by active status. By default the API returns all leave types. | [optional] + +### Return type + +[**LeaveTypes**](LeaveTypes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run + +> PayRunObject get_pay_run(xero_tenant_id, pay_run_id) + +retrieve a single pay run by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | Identifier for the pay run +begin + #retrieve a single pay run by id + result = api_instance.get_pay_run(xero_tenant_id, pay_run_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| Identifier for the pay run | + +### Return type + +[**PayRunObject**](PayRunObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run_calendar + +> PayRunCalendarObject get_pay_run_calendar(xero_tenant_id, payroll_calendar_id) + +retrieve a single payrun calendar by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payroll_calendar_id = 'payroll_calendar_id_example' # String | Identifier for the payrun calendars +begin + #retrieve a single payrun calendar by id + result = api_instance.get_pay_run_calendar(xero_tenant_id, payroll_calendar_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_run_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payroll_calendar_id** | [**String**](.md)| Identifier for the payrun calendars | + +### Return type + +[**PayRunCalendarObject**](PayRunCalendarObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run_calendars + +> PayRunCalendars get_pay_run_calendars(xero_tenant_id, opts) + +searches payrun calendars + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches payrun calendars + result = api_instance.get_pay_run_calendars(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_run_calendars: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**PayRunCalendars**](PayRunCalendars.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_runs + +> PayRuns get_pay_runs(xero_tenant_id, opts) + +searches pay runs + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + status: 'status_example' # String | By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. +} + +begin + #searches pay runs + result = api_instance.get_pay_runs(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_runs: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **status** | **String**| By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. | [optional] + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_slip + +> PaySlipObject get_pay_slip(xero_tenant_id, pay_slip_id) + +retrieve a single payslip by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_slip_id = 'pay_slip_id_example' # String | Identifier for the payslip +begin + #retrieve a single payslip by id + result = api_instance.get_pay_slip(xero_tenant_id, pay_slip_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_slip: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_slip_id** | [**String**](.md)| Identifier for the payslip | + +### Return type + +[**PaySlipObject**](PaySlipObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_slips + +> PaySlips get_pay_slips(xero_tenant_id, pay_run_id, opts) + +searches payslips + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches payslips + result = api_instance.get_pay_slips(xero_tenant_id, pay_run_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_pay_slips: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**PaySlips**](PaySlips.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_reimbursement + +> ReimbursementObject get_reimbursement(xero_tenant_id, reimbursement_id) + +retrieve a single reimbursement by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +reimbursement_id = 'reimbursement_id_example' # String | Identifier for the reimbursement +begin + #retrieve a single reimbursement by id + result = api_instance.get_reimbursement(xero_tenant_id, reimbursement_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_reimbursement: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **reimbursement_id** | [**String**](.md)| Identifier for the reimbursement | + +### Return type + +[**ReimbursementObject**](ReimbursementObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_reimbursements + +> Reimbursements get_reimbursements(xero_tenant_id, opts) + +searches reimbursements + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches reimbursements + result = api_instance.get_reimbursements(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_reimbursements: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Reimbursements**](Reimbursements.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_settings + +> Settings get_settings(xero_tenant_id) + +searches settings + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches settings + result = api_instance.get_settings(xero_tenant_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Settings**](Settings.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_statutory_deduction + +> StatutoryDeductionObject get_statutory_deduction(xero_tenant_id, id) + +retrieve a single statutory deduction by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +id = 'id_example' # String | Identifier for the statutory deduction +begin + #retrieve a single statutory deduction by id + result = api_instance.get_statutory_deduction(xero_tenant_id, id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_statutory_deduction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **id** | [**String**](.md)| Identifier for the statutory deduction | + +### Return type + +[**StatutoryDeductionObject**](StatutoryDeductionObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_statutory_deductions + +> StatutoryDeductions get_statutory_deductions(xero_tenant_id, opts) + +searches statutory deductions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches statutory deductions + result = api_instance.get_statutory_deductions(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_statutory_deductions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**StatutoryDeductions**](StatutoryDeductions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_superannuation + +> SuperannuationObject get_superannuation(xero_tenant_id, superannuation_id) + +searches for a unique superannuation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +superannuation_id = 'superannuation_id_example' # String | Identifier for the superannuation +begin + #searches for a unique superannuation + result = api_instance.get_superannuation(xero_tenant_id, superannuation_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_superannuation: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **superannuation_id** | [**String**](.md)| Identifier for the superannuation | + +### Return type + +[**SuperannuationObject**](SuperannuationObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_superannuations + +> Superannuations get_superannuations(xero_tenant_id, opts) + +searches statutory deductions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches statutory deductions + result = api_instance.get_superannuations(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_superannuations: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Superannuations**](Superannuations.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheet + +> TimesheetObject get_timesheet(xero_tenant_id, timesheet_id) + +retrieve a single timesheet by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #retrieve a single timesheet by id + result = api_instance.get_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheets + +> Timesheets get_timesheets(xero_tenant_id, opts) + +searches timesheets + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + employee_id: 'employee_id_example', # String | By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + + payroll_calendar_id: 'payroll_calendar_id_example' # String | By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id +} + +begin + #searches timesheets + result = api_instance.get_timesheets(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_timesheets: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **employee_id** | [**String**](.md)| By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. | [optional] + **payroll_calendar_id** | [**String**](.md)| By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id | [optional] + +### Return type + +[**Timesheets**](Timesheets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tracking_categories + +> TrackingCategories get_tracking_categories(xero_tenant_id) + +searches tracking categories + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches tracking categories + result = api_instance.get_tracking_categories(xero_tenant_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_tracking_categories: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## revert_timesheet + +> TimesheetObject revert_timesheet(xero_tenant_id, timesheet_id) + +revert a timesheet to draft + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #revert a timesheet to draft + result = api_instance.revert_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->revert_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_employee + +> EmployeeObject update_employee(xero_tenant_id, employee_id, employee) + +updates employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee = { "title": "Mr", "firstName": "Tony", "lastName": "Starkgtrzgquusrson", "dateOfBirth": "1999-01-01", "address": { "addressLine1": "101 Green St", "city": "San Francisco", "postCode": "4432", "countryName": "United Kingdom" }, "email": "58315@starkindustries.com", "gender": "M" } # Employee | +begin + #updates employee + result = api_instance.update_employee(xero_tenant_id, employee_id, employee) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee** | [**Employee**](Employee.md)| | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_earnings_template + +> EarningsTemplateObject update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template) + +updates employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +earnings_template = { "ratePerUnit": 25, "numberOfUnits": 4, "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5" } # EarningsTemplate | +begin + #updates employee earnings template records + result = api_instance.update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **pay_template_earning_id** | [**String**](.md)| Id for single pay template earnings object | + **earnings_template** | [**EarningsTemplate**](EarningsTemplate.md)| | + +### Return type + +[**EarningsTemplateObject**](EarningsTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_leave + +> EmployeeLeaveObject update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave) + +updates employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314' # String | Leave id for single object +employee_leave = { "leaveTypeID": "b0b1b79e-2a25-46c2-ad08-ca25ef48d7e4", "description": "Creating a Desription", "startDate": "2020-04-24", "endDate": "2020-04-26", "periods": [ { "periodStartDate": "2020-04-20", "periodEndDate": "2020-04-26", "numberOfUnits": 1, "periodStatus": "Approved" } ] } # EmployeeLeave | +begin + #updates employee leave records + result = api_instance.update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_id** | [**String**](.md)| Leave id for single object | + **employee_leave** | [**EmployeeLeave**](EmployeeLeave.md)| | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_salary_and_wage + +> SalaryAndWageObject update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage) + +updates employee salary and wages record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +salary_and_wage = { "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnitsPerWeek": 3, "ratePerUnit": 11, "numberOfUnitsPerDay": 3, "daysPerWeek": 1, "effectiveFrom": "2020-05-15", "annualSalary": 101, "status": "Active", "paymentType": "Salary" } # SalaryAndWage | +begin + #updates employee salary and wages record + result = api_instance.update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single pay template earnings object | + **salary_and_wage** | [**SalaryAndWage**](SalaryAndWage.md)| | + +### Return type + +[**SalaryAndWageObject**](SalaryAndWageObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_tax + +> EmployeeTaxObject update_employee_tax(xero_tenant_id, employee_id, employee_tax) + +updates the tax records for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_tax = XeroRuby::PayrollNz::EmployeeTax.new # EmployeeTax | +begin + #updates the tax records for an employee + result = api_instance.update_employee_tax(xero_tenant_id, employee_id, employee_tax) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_employee_tax: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_tax** | [**EmployeeTax**](EmployeeTax.md)| | + +### Return type + +[**EmployeeTaxObject**](EmployeeTaxObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_pay_run + +> PayRunObject update_pay_run(xero_tenant_id, pay_run_id, pay_run) + +update a pay run + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | Identifier for the pay run +pay_run = { "paymentDate": "2019-07-01" } # PayRun | +begin + #update a pay run + result = api_instance.update_pay_run(xero_tenant_id, pay_run_id, pay_run) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| Identifier for the pay run | + **pay_run** | [**PayRun**](PayRun.md)| | + +### Return type + +[**PayRunObject**](PayRunObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_pay_slip_line_items + +> PaySlipObject update_pay_slip_line_items(xero_tenant_id, pay_slip_id, pay_slip) + +creates employee pay slip + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_slip_id = 'pay_slip_id_example' # String | Identifier for the payslip +pay_slip = { "earningsLines": [ { "earningsLineID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "displayName": "Ordinary Time", "ratePerUnit": 25, "numberOfUnits": 0, "amount": 0, "isLinkedToTimesheet": false, "isSystemGenerated": true }, { "earningsLineID": "65b83d94-f20f-45e1-85ae-387fcf460c26", "earningsRateID": "65b83d94-f20f-45e1-85ae-387fcf460c26", "displayName": "Salary", "ratePerUnit": 0, "numberOfUnits": 8, "amount": 0, "isLinkedToTimesheet": false, "isSystemGenerated": false } ], "leaveEarningsLines": [ { "earningsLineID": "0441497f-5dc7-4cd3-a90d-f2e07e21b2a6", "earningsRateID": "39b3560a-5d2f-4538-924a-4349dc86396e", "displayName": "Holiday Pay", "fixedAmount": 268.8, "amount": 268.8, "isLinkedToTimesheet": false, "isSystemGenerated": true } ], "deductionLines": [ { "deductionTypeID": "a3760fe4-68a4-4e38-8326-fe616af7dc74", "amount": 100 } ], "leaveAccrualLines": [ { "leaveTypeID": "0441497f-5dc7-4cd3-a90d-f2e07e21b2a6", "numberOfUnits": 268.8 }, { "leaveTypeID": "b0b1b79e-2a25-46c2-ad08-ca25ef48d7e4", "numberOfUnits": 0 }, { "leaveTypeID": "f2f994cf-1899-46f3-ad4f-5d92d78c3719", "numberOfUnits": 0 }, { "leaveTypeID": "34129765-11cb-4d8c-b568-84a2219beda3", "numberOfUnits": 0 } ], "superannuationLines": [ { "superannuationTypeID": "563273ea-0dae-4f82-86a4-e0db77c008ea", "displayName": "KiwiSaver", "amount": 108.86, "fixedAmount": 3, "percentage": 3, "manualAdjustment": false } ], "employeeTaxLines": [ { "taxLineID": "1084146b-e890-489c-aed3-06de80f63d84", "amount": 1057.22, "globalTaxTypeID": "11", "manualAdjustment": false } ], "employerTaxLines": [ { "taxLineID": "6f9eb8cd-0f4a-440b-939c-bdb0f6ad694c", "amount": 18.9, "globalTaxTypeID": "10", "manualAdjustment": false } ], "statutoryDeductionLines": [ { "statutoryDeductionTypeID": "b5efd8d1-0c93-4a14-a314-b5cba4a4e6b3", "amount": 108.86 } ], "grossEarningsHistory": { "daysPaid": 3, "unpaidWeeks": 0 } } # PaySlip | +begin + #creates employee pay slip + result = api_instance.update_pay_slip_line_items(xero_tenant_id, pay_slip_id, pay_slip) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_pay_slip_line_items: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_slip_id** | [**String**](.md)| Identifier for the payslip | + **pay_slip** | [**PaySlip**](PaySlip.md)| | + +### Return type + +[**PaySlipObject**](PaySlipObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_timesheet_line + +> TimesheetLineObject update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line) + +update a timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line_id = 'timesheet_line_id_example' # String | Identifier for the timesheet line +timesheet_line = { "date": "2020-08-04", "earningsRateID": "f9d8f5b5-9049-47f4-8541-35e200f750a5", "numberOfUnits": 2 } # TimesheetLine | +begin + #update a timesheet line + result = api_instance.update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->update_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line_id** | [**String**](.md)| Identifier for the timesheet line | + **timesheet_line** | [**TimesheetLine**](TimesheetLine.md)| | + +### Return type + +[**TimesheetLineObject**](TimesheetLineObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/payroll_nz/Problem.md b/docs/payroll_nz/Problem.md new file mode 100644 index 00000000..d532af74 --- /dev/null +++ b/docs/payroll_nz/Problem.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::Problem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The type of error format | [optional] +**title** | **String** | The type of the error | [optional] +**status** | **String** | The error status code | [optional] +**detail** | **String** | A description of the error | [optional] +**instance** | **String** | | [optional] +**invalid_fields** | [**Array<InvalidField>**](InvalidField.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Problem.new(type: application/problem+json, + title: BadRequest, + status: 400, + detail: Validation error occurred., + instance: null, + invalid_fields: null) +``` + + diff --git a/docs/payroll_nz/Reimbursement.md b/docs/payroll_nz/Reimbursement.md new file mode 100644 index 00000000..670bb0e5 --- /dev/null +++ b/docs/payroll_nz/Reimbursement.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollNz::Reimbursement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_id** | **String** | Xero unique identifier for a reimbursement | [optional] +**name** | **String** | Name of the reimbursement | +**account_id** | **String** | Xero unique identifier for the account used for the reimbursement | +**current_record** | **Boolean** | Indicates that whether the reimbursement is active | [optional] +**reimbursement_category** | **String** | See Reimbursement Categories | [optional] +**calculation_type** | **String** | See Calculation Types | [optional] +**standard_amount** | **String** | Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount | [optional] +**standard_type_of_units** | **String** | Optional Type Of Units. Applicable when calculation type is Rate Per Unit | [optional] +**standard_rate_per_unit** | **BigDecimal** | Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Reimbursement.new(reimbursement_id: null, + name: null, + account_id: null, + current_record: null, + reimbursement_category: null, + calculation_type: null, + standard_amount: null, + standard_type_of_units: null, + standard_rate_per_unit: null) +``` + + diff --git a/docs/payroll_nz/ReimbursementLine.md b/docs/payroll_nz/ReimbursementLine.md new file mode 100644 index 00000000..046ab241 --- /dev/null +++ b/docs/payroll_nz/ReimbursementLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::ReimbursementLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_type_id** | **String** | Xero identifier for payroll reimbursement | [optional] +**description** | **String** | Reimbursement line description | [optional] +**amount** | **BigDecimal** | Reimbursement amount | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit for leave earnings line | [optional] +**number_of_units** | **BigDecimal** | Leave earnings number of units | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::ReimbursementLine.new(reimbursement_type_id: null, + description: null, + amount: null, + rate_per_unit: null, + number_of_units: null) +``` + + diff --git a/docs/payroll_nz/ReimbursementObject.md b/docs/payroll_nz/ReimbursementObject.md new file mode 100644 index 00000000..0c149351 --- /dev/null +++ b/docs/payroll_nz/ReimbursementObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::ReimbursementObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**reimbursement** | [**Reimbursement**](Reimbursement.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::ReimbursementObject.new(pagination: null, + problem: null, + reimbursement: null) +``` + + diff --git a/docs/payroll_nz/Reimbursements.md b/docs/payroll_nz/Reimbursements.md new file mode 100644 index 00000000..e28b2348 --- /dev/null +++ b/docs/payroll_nz/Reimbursements.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Reimbursements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**reimbursements** | [**Array<Reimbursement>**](Reimbursement.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Reimbursements.new(pagination: null, + problem: null, + reimbursements: null) +``` + + diff --git a/docs/payroll_nz/SalaryAndWage.md b/docs/payroll_nz/SalaryAndWage.md new file mode 100644 index 00000000..fde7e79d --- /dev/null +++ b/docs/payroll_nz/SalaryAndWage.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::SalaryAndWage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**salary_and_wages_id** | **String** | Xero unique identifier for a salary and wages record | [optional] +**earnings_rate_id** | **String** | Xero unique identifier for an earnings rate | +**number_of_units_per_week** | **BigDecimal** | The Number of Units per week for the corresponding salary and wages | +**rate_per_unit** | **BigDecimal** | The rate of each unit for the corresponding salary and wages | +**number_of_units_per_day** | **BigDecimal** | The Number of Units per day for the corresponding salary and wages | +**days_per_week** | **Integer** | The days per week for the salary. | [optional] +**effective_from** | **Date** | The effective date of the corresponding salary and wages | +**annual_salary** | **BigDecimal** | The annual salary | +**status** | **String** | The current status of the corresponding salary and wages | +**payment_type** | **String** | The type of the payment of the corresponding salary and wages | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::SalaryAndWage.new(salary_and_wages_id: null, + earnings_rate_id: null, + number_of_units_per_week: null, + rate_per_unit: null, + number_of_units_per_day: null, + days_per_week: null, + effective_from: null, + annual_salary: null, + status: null, + payment_type: null) +``` + + diff --git a/docs/payroll_nz/SalaryAndWageObject.md b/docs/payroll_nz/SalaryAndWageObject.md new file mode 100644 index 00000000..6387d9ee --- /dev/null +++ b/docs/payroll_nz/SalaryAndWageObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::SalaryAndWageObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**salary_and_wages** | [**SalaryAndWage**](SalaryAndWage.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::SalaryAndWageObject.new(pagination: null, + problem: null, + salary_and_wages: null) +``` + + diff --git a/docs/payroll_nz/SalaryAndWages.md b/docs/payroll_nz/SalaryAndWages.md new file mode 100644 index 00000000..3cd39a1e --- /dev/null +++ b/docs/payroll_nz/SalaryAndWages.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::SalaryAndWages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**salary_and_wages** | [**Array<SalaryAndWage>**](SalaryAndWage.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::SalaryAndWages.new(pagination: null, + problem: null, + salary_and_wages: null) +``` + + diff --git a/docs/payroll_nz/Settings.md b/docs/payroll_nz/Settings.md new file mode 100644 index 00000000..89b507b4 --- /dev/null +++ b/docs/payroll_nz/Settings.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**settings** | [**Accounts**](Accounts.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Settings.new(pagination: null, + problem: null, + settings: null) +``` + + diff --git a/docs/payroll_nz/StatutoryDeduction.md b/docs/payroll_nz/StatutoryDeduction.md new file mode 100644 index 00000000..c6c88836 --- /dev/null +++ b/docs/payroll_nz/StatutoryDeduction.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::StatutoryDeduction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The Xero identifier for earnings order | [optional] +**name** | **String** | Name of the earnings order | [optional] +**statutory_deduction_category** | [**StatutoryDeductionCategory**](StatutoryDeductionCategory.md) | | [optional] +**liability_account_id** | **String** | Xero identifier for Liability Account | [optional] +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::StatutoryDeduction.new(id: null, + name: null, + statutory_deduction_category: null, + liability_account_id: null, + current_record: null) +``` + + diff --git a/docs/payroll_nz/StatutoryDeductionCategory.md b/docs/payroll_nz/StatutoryDeductionCategory.md new file mode 100644 index 00000000..32825ef8 --- /dev/null +++ b/docs/payroll_nz/StatutoryDeductionCategory.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollNz::StatutoryDeductionCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::StatutoryDeductionCategory.new() +``` + + diff --git a/docs/payroll_nz/StatutoryDeductionLine.md b/docs/payroll_nz/StatutoryDeductionLine.md new file mode 100644 index 00000000..24f94267 --- /dev/null +++ b/docs/payroll_nz/StatutoryDeductionLine.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollNz::StatutoryDeductionLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_deduction_type_id** | **String** | Xero identifier for payroll statutory deduction type | [optional] +**amount** | **BigDecimal** | The amount of the statutory deduction line | [optional] +**fixed_amount** | **BigDecimal** | Fixed Amount | [optional] +**manual_adjustment** | **Boolean** | Identifies if the tax line is a manual adjustment | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::StatutoryDeductionLine.new(statutory_deduction_type_id: null, + amount: null, + fixed_amount: null, + manual_adjustment: null) +``` + + diff --git a/docs/payroll_nz/StatutoryDeductionObject.md b/docs/payroll_nz/StatutoryDeductionObject.md new file mode 100644 index 00000000..922aaef4 --- /dev/null +++ b/docs/payroll_nz/StatutoryDeductionObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::StatutoryDeductionObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deduction** | [**StatutoryDeduction**](StatutoryDeduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::StatutoryDeductionObject.new(pagination: null, + problem: null, + statutory_deduction: null) +``` + + diff --git a/docs/payroll_nz/StatutoryDeductions.md b/docs/payroll_nz/StatutoryDeductions.md new file mode 100644 index 00000000..816e5af4 --- /dev/null +++ b/docs/payroll_nz/StatutoryDeductions.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::StatutoryDeductions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deductions** | [**Array<StatutoryDeduction>**](StatutoryDeduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::StatutoryDeductions.new(pagination: null, + problem: null, + statutory_deductions: null) +``` + + diff --git a/docs/payroll_nz/SuperannuationLine.md b/docs/payroll_nz/SuperannuationLine.md new file mode 100644 index 00000000..790e8642 --- /dev/null +++ b/docs/payroll_nz/SuperannuationLine.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::SuperannuationLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**superannuation_type_id** | **String** | Xero identifier for payroll superannucation type | [optional] +**display_name** | **String** | Benefit display name | [optional] +**amount** | **BigDecimal** | The amount of the superannuation line | [optional] +**fixed_amount** | **BigDecimal** | Superannuation fixed amount | [optional] +**percentage** | **BigDecimal** | Superannuation rate percentage | [optional] +**manual_adjustment** | **Boolean** | manual adjustment made | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::SuperannuationLine.new(superannuation_type_id: null, + display_name: null, + amount: null, + fixed_amount: null, + percentage: null, + manual_adjustment: null) +``` + + diff --git a/docs/payroll_nz/SuperannuationObject.md b/docs/payroll_nz/SuperannuationObject.md new file mode 100644 index 00000000..71130092 --- /dev/null +++ b/docs/payroll_nz/SuperannuationObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::SuperannuationObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**benefit** | [**Benefit**](Benefit.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::SuperannuationObject.new(pagination: null, + problem: null, + benefit: null) +``` + + diff --git a/docs/payroll_nz/Superannuations.md b/docs/payroll_nz/Superannuations.md new file mode 100644 index 00000000..cd8776f7 --- /dev/null +++ b/docs/payroll_nz/Superannuations.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Superannuations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**benefits** | [**Array<Benefit>**](Benefit.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Superannuations.new(pagination: null, + problem: null, + benefits: null) +``` + + diff --git a/docs/payroll_nz/TaxCode.md b/docs/payroll_nz/TaxCode.md new file mode 100644 index 00000000..24a377ff --- /dev/null +++ b/docs/payroll_nz/TaxCode.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollNz::TaxCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TaxCode.new() +``` + + diff --git a/docs/payroll_nz/TaxLine.md b/docs/payroll_nz/TaxLine.md new file mode 100644 index 00000000..fea3c65a --- /dev/null +++ b/docs/payroll_nz/TaxLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::TaxLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tax_line_id** | **String** | Xero identifier for payroll tax line | [optional] +**description** | **String** | Tax line description | [optional] +**amount** | **BigDecimal** | The amount of the tax line | [optional] +**global_tax_type_id** | **String** | Tax type ID | [optional] +**manual_adjustment** | **Boolean** | Identifies if the tax line is a manual adjustment | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TaxLine.new(tax_line_id: null, + description: null, + amount: null, + global_tax_type_id: null, + manual_adjustment: null) +``` + + diff --git a/docs/payroll_nz/TaxSettings.md b/docs/payroll_nz/TaxSettings.md new file mode 100644 index 00000000..9609bc07 --- /dev/null +++ b/docs/payroll_nz/TaxSettings.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollNz::TaxSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period_units** | **Integer** | The number of units for the period type | [optional] +**period_type** | **String** | The type of period (\"weeks\" or \"months\") | [optional] +**tax_code** | [**TaxCode**](TaxCode.md) | | [optional] +**special_tax_rate** | **String** | Tax rate for STC and WT | [optional] +**lump_sum_tax_code** | **String** | Tax code for a lump sum amount | [optional] +**lump_sum_amount** | **String** | The total of the lump sum amount | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TaxSettings.new(period_units: null, + period_type: weeks, + tax_code: null, + special_tax_rate: null, + lump_sum_tax_code: null, + lump_sum_amount: null) +``` + + diff --git a/docs/payroll_nz/Timesheet.md b/docs/payroll_nz/Timesheet.md new file mode 100644 index 00000000..4be7b15b --- /dev/null +++ b/docs/payroll_nz/Timesheet.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollNz::Timesheet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheet_id** | **String** | The Xero identifier for a Timesheet | [optional] +**payroll_calendar_id** | **String** | The Xero identifier for the Payroll Calandar that the Timesheet applies to | +**employee_id** | **String** | The Xero identifier for the Employee that the Timesheet is for | +**start_date** | **Date** | The Start Date of the Timesheet period (YYYY-MM-DD) | +**end_date** | **Date** | The End Date of the Timesheet period (YYYY-MM-DD) | +**status** | **String** | Status of the timesheet | [optional] +**total_hours** | **BigDecimal** | The Total Hours of the Timesheet | [optional] +**updated_date_utc** | **DateTime** | The UTC date time that the Timesheet was last updated | [optional] +**timesheet_lines** | [**Array<TimesheetLine>**](TimesheetLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Timesheet.new(timesheet_id: null, + payroll_calendar_id: null, + employee_id: null, + start_date: null, + end_date: null, + status: null, + total_hours: null, + updated_date_utc: null, + timesheet_lines: null) +``` + + diff --git a/docs/payroll_nz/TimesheetEarningsLine.md b/docs/payroll_nz/TimesheetEarningsLine.md new file mode 100644 index 00000000..c8b46e09 --- /dev/null +++ b/docs/payroll_nz/TimesheetEarningsLine.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollNz::TimesheetEarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_line_id** | **String** | Xero identifier for payroll earnings line | [optional] +**earnings_rate_id** | **String** | Xero identifier for payroll leave earnings rate | [optional] +**display_name** | **String** | name of earnings rate for display in UI | [optional] +**rate_per_unit** | **BigDecimal** | Rate per unit for leave earnings line | [optional] +**number_of_units** | **BigDecimal** | Leave earnings number of units | [optional] +**fixed_amount** | **BigDecimal** | Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **BigDecimal** | The amount of the earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the leave earnings is taken from the timesheet. False for leave earnings line | [optional] +**is_average_daily_pay_rate** | **Boolean** | Identifies if the earnings is using an average daily pay rate | [optional] +**is_system_generated** | **Boolean** | Flag to indentify whether the earnings line is system generated or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TimesheetEarningsLine.new(earnings_line_id: null, + earnings_rate_id: null, + display_name: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null, + is_average_daily_pay_rate: null, + is_system_generated: null) +``` + + diff --git a/docs/payroll_nz/TimesheetLine.md b/docs/payroll_nz/TimesheetLine.md new file mode 100644 index 00000000..d78543aa --- /dev/null +++ b/docs/payroll_nz/TimesheetLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollNz::TimesheetLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheet_line_id** | **String** | The Xero identifier for a Timesheet Line | [optional] +**date** | **Date** | The Date that this Timesheet Line is for (YYYY-MM-DD) | +**earnings_rate_id** | **String** | The Xero identifier for the Earnings Rate that the Timesheet is for | +**tracking_item_id** | **String** | The Xero identifier for the Tracking Item that the Timesheet is for | [optional] +**number_of_units** | **BigDecimal** | The Number of Units of the Timesheet Line | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TimesheetLine.new(timesheet_line_id: null, + date: null, + earnings_rate_id: null, + tracking_item_id: null, + number_of_units: null) +``` + + diff --git a/docs/payroll_nz/TimesheetLineObject.md b/docs/payroll_nz/TimesheetLineObject.md new file mode 100644 index 00000000..504ba480 --- /dev/null +++ b/docs/payroll_nz/TimesheetLineObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::TimesheetLineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheet_line** | [**TimesheetLine**](TimesheetLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TimesheetLineObject.new(pagination: null, + problem: null, + timesheet_line: null) +``` + + diff --git a/docs/payroll_nz/TimesheetObject.md b/docs/payroll_nz/TimesheetObject.md new file mode 100644 index 00000000..8860055e --- /dev/null +++ b/docs/payroll_nz/TimesheetObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::TimesheetObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheet** | [**Timesheet**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TimesheetObject.new(pagination: null, + problem: null, + timesheet: null) +``` + + diff --git a/docs/payroll_nz/Timesheets.md b/docs/payroll_nz/Timesheets.md new file mode 100644 index 00000000..6dfa2238 --- /dev/null +++ b/docs/payroll_nz/Timesheets.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::Timesheets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheets** | [**Array<Timesheet>**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::Timesheets.new(pagination: null, + problem: null, + timesheets: null) +``` + + diff --git a/docs/payroll_nz/TrackingCategories.md b/docs/payroll_nz/TrackingCategories.md new file mode 100644 index 00000000..afbc694a --- /dev/null +++ b/docs/payroll_nz/TrackingCategories.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::TrackingCategories + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**tracking_categories** | [**TrackingCategory**](TrackingCategory.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TrackingCategories.new(pagination: null, + problem: null, + tracking_categories: null) +``` + + diff --git a/docs/payroll_nz/TrackingCategory.md b/docs/payroll_nz/TrackingCategory.md new file mode 100644 index 00000000..51100eca --- /dev/null +++ b/docs/payroll_nz/TrackingCategory.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::TrackingCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_groups_tracking_category_id** | **String** | The Xero identifier for Employee groups tracking category. | [optional] +**timesheet_tracking_category_id** | **String** | The Xero identifier for Timesheet tracking category. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::TrackingCategory.new(employee_groups_tracking_category_id: null, + timesheet_tracking_category_id: null) +``` + + diff --git a/docs/payroll_uk/Account.md b/docs/payroll_uk/Account.md new file mode 100644 index 00000000..7704f0cd --- /dev/null +++ b/docs/payroll_uk/Account.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **String** | The Xero identifier for Settings. | [optional] +**type** | **String** | The assigned AccountType | [optional] +**code** | **String** | A unique 3 digit number for each Account | [optional] +**name** | **String** | Name of the Account. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Account.new(account_id: null, + type: null, + code: null, + name: null) +``` + + diff --git a/docs/payroll_uk/Accounts.md b/docs/payroll_uk/Accounts.md new file mode 100644 index 00000000..2e52a795 --- /dev/null +++ b/docs/payroll_uk/Accounts.md @@ -0,0 +1,17 @@ +# XeroRuby::PayrollUk::Accounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**Array<Account>**](Account.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Accounts.new(accounts: null) +``` + + diff --git a/docs/payroll_uk/Address.md b/docs/payroll_uk/Address.md new file mode 100644 index 00000000..b6e36d82 --- /dev/null +++ b/docs/payroll_uk/Address.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_line1** | **String** | Address line 1 for employee home address | +**address_line2** | **String** | Address line 2 for employee home address | [optional] +**city** | **String** | Suburb for employee home address | +**post_code** | **String** | PostCode for employee home address | +**country_name** | **String** | Country of HomeAddress | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Address.new(address_line1: 123 Main St, + address_line2: Apt 4, + city: Fulham, + post_code: SW6 6EY, + country_name: United Kingdom) +``` + + diff --git a/docs/payroll_uk/BankAccount.md b/docs/payroll_uk/BankAccount.md new file mode 100644 index 00000000..0c0e46f5 --- /dev/null +++ b/docs/payroll_uk/BankAccount.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::BankAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_name** | **String** | Bank account name (max length = 32) | +**account_number** | **String** | Bank account number (digits only; max length = 8) | +**sort_code** | **String** | Bank account sort code (6 digits) | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::BankAccount.new(account_name: null, + account_number: null, + sort_code: null) +``` + + diff --git a/docs/payroll_uk/Benefit.md b/docs/payroll_uk/Benefit.md new file mode 100644 index 00000000..40f9ee42 --- /dev/null +++ b/docs/payroll_uk/Benefit.md @@ -0,0 +1,43 @@ +# XeroRuby::PayrollUk::Benefit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | unique identifier in Xero | [optional] +**name** | **String** | Name of the employer pension | +**category** | **String** | Category type of the employer pension | +**liability_account_id** | **String** | Xero identifier for Liability Account | +**expense_account_id** | **String** | Xero identifier for Expense Account | +**standard_amount** | **BigDecimal** | Standard amount of the employer pension | [optional] +**percentage** | **BigDecimal** | Percentage of gross of the employer pension | +**calculation_type** | **String** | Calculation Type of the employer pension (FixedAmount or PercentageOfGross). | +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] +**subject_to_nic** | **Boolean** | Identifier of subject To NIC | [optional] +**subject_to_pension** | **Boolean** | Identifier of subject To pension | [optional] +**subject_to_tax** | **Boolean** | Identifier of subject To Tax | [optional] +**is_calculating_on_qualifying_earnings** | **Boolean** | Identifier of calculating on qualifying earnings | [optional] +**show_balance_to_employee** | **Boolean** | display the balance to employee | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Benefit.new(id: null, + name: null, + category: null, + liability_account_id: null, + expense_account_id: null, + standard_amount: null, + percentage: null, + calculation_type: null, + current_record: null, + subject_to_nic: null, + subject_to_pension: null, + subject_to_tax: null, + is_calculating_on_qualifying_earnings: null, + show_balance_to_employee: null) +``` + + diff --git a/docs/payroll_uk/BenefitLine.md b/docs/payroll_uk/BenefitLine.md new file mode 100644 index 00000000..caca61b9 --- /dev/null +++ b/docs/payroll_uk/BenefitLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::BenefitLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**benefit_type_id** | **String** | Xero identifier for payroll benefit type | [optional] +**display_name** | **String** | Benefit display name | [optional] +**amount** | **Float** | The amount of the benefit line. | [optional] +**fixed_amount** | **Float** | Benefit fixed amount | [optional] +**percentage** | **Float** | Benefit rate percentage | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::BenefitLine.new(benefit_type_id: null, + display_name: null, + amount: null, + fixed_amount: null, + percentage: null) +``` + + diff --git a/docs/payroll_uk/BenefitObject.md b/docs/payroll_uk/BenefitObject.md new file mode 100644 index 00000000..7216f866 --- /dev/null +++ b/docs/payroll_uk/BenefitObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::BenefitObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**benefit** | [**Benefit**](Benefit.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::BenefitObject.new(pagination: null, + problem: null, + benefit: null) +``` + + diff --git a/docs/payroll_uk/Benefits.md b/docs/payroll_uk/Benefits.md new file mode 100644 index 00000000..d52e205f --- /dev/null +++ b/docs/payroll_uk/Benefits.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Benefits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**benefits** | [**Array<Benefit>**](Benefit.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Benefits.new(pagination: null, + problem: null, + benefits: null) +``` + + diff --git a/docs/payroll_uk/CourtOrderLine.md b/docs/payroll_uk/CourtOrderLine.md new file mode 100644 index 00000000..421ba45a --- /dev/null +++ b/docs/payroll_uk/CourtOrderLine.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::CourtOrderLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**court_order_type_id** | **String** | Xero identifier for payroll court order type | [optional] +**amount** | **Float** | Amount | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::CourtOrderLine.new(court_order_type_id: null, + amount: null) +``` + + diff --git a/docs/payroll_uk/Deduction.md b/docs/payroll_uk/Deduction.md new file mode 100644 index 00000000..417ab1c0 --- /dev/null +++ b/docs/payroll_uk/Deduction.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollUk::Deduction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deduction_id** | **String** | The Xero identifier for Deduction | [optional] +**deduction_name** | **String** | Name of the deduction | +**deduction_category** | **String** | Deduction Category type | [optional] +**liability_account_id** | **String** | Xero identifier for Liability Account | +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] +**standard_amount** | **BigDecimal** | Standard amount of the deduction | [optional] +**reduces_super_liability** | **Boolean** | Identifier of reduces super liability | [optional] +**reduces_tax_liability** | **Boolean** | Identifier of reduces tax liability | [optional] +**calculation_type** | **String** | determine the calculation type whether fixed amount or percentage of gross | [optional] +**percentage** | **BigDecimal** | Percentage of gross | [optional] +**subject_to_nic** | **Boolean** | Identifier of subject To NIC | [optional] +**subject_to_tax** | **Boolean** | Identifier of subject To Tax | [optional] +**is_reduced_by_basic_rate** | **Boolean** | Identifier of reduced by basic rate applicable or not | [optional] +**apply_to_pension_calculations** | **Boolean** | Identifier for apply to pension calculations | [optional] +**is_calculating_on_qualifying_earnings** | **Boolean** | Identifier of calculating on qualifying earnings | [optional] +**is_pension** | **Boolean** | Identifier of applicable for pension or not | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Deduction.new(deduction_id: null, + deduction_name: null, + deduction_category: null, + liability_account_id: null, + current_record: null, + standard_amount: null, + reduces_super_liability: null, + reduces_tax_liability: null, + calculation_type: null, + percentage: null, + subject_to_nic: null, + subject_to_tax: null, + is_reduced_by_basic_rate: null, + apply_to_pension_calculations: null, + is_calculating_on_qualifying_earnings: null, + is_pension: null) +``` + + diff --git a/docs/payroll_uk/DeductionLine.md b/docs/payroll_uk/DeductionLine.md new file mode 100644 index 00000000..c90c4192 --- /dev/null +++ b/docs/payroll_uk/DeductionLine.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::DeductionLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deduction_type_id** | **String** | Xero identifier for payroll deduction | [optional] +**amount** | **Float** | The amount of the deduction line | [optional] +**subject_to_tax** | **Boolean** | Identifies if the deduction is subject to tax | [optional] +**percentage** | **Float** | Deduction rate percentage | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::DeductionLine.new(deduction_type_id: null, + amount: null, + subject_to_tax: null, + percentage: null) +``` + + diff --git a/docs/payroll_uk/DeductionObject.md b/docs/payroll_uk/DeductionObject.md new file mode 100644 index 00000000..92e0fe72 --- /dev/null +++ b/docs/payroll_uk/DeductionObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::DeductionObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**deduction** | [**Deduction**](Deduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::DeductionObject.new(pagination: null, + problem: null, + deduction: null) +``` + + diff --git a/docs/payroll_uk/Deductions.md b/docs/payroll_uk/Deductions.md new file mode 100644 index 00000000..6499f5b7 --- /dev/null +++ b/docs/payroll_uk/Deductions.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Deductions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**deductions** | [**Array<Deduction>**](Deduction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Deductions.new(pagination: null, + problem: null, + deductions: null) +``` + + diff --git a/docs/payroll_uk/EarningsLine.md b/docs/payroll_uk/EarningsLine.md new file mode 100644 index 00000000..019976e2 --- /dev/null +++ b/docs/payroll_uk/EarningsLine.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollUk::EarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_line_id** | **String** | Xero identifier for payroll earnings line | [optional] +**earnings_rate_id** | **String** | Xero identifier for payroll earnings rate | [optional] +**display_name** | **String** | name of earnings rate for display in UI | [optional] +**rate_per_unit** | **Float** | Rate per unit for earnings line | [optional] +**number_of_units** | **Float** | Earnings number of units | [optional] +**fixed_amount** | **Float** | Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **Float** | The amount of the earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the earnings is taken from the timesheet. False for earnings line | [optional] +**is_average_daily_pay_rate** | **Boolean** | Identifies if the earnings is using an average daily pay rate | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsLine.new(earnings_line_id: null, + earnings_rate_id: null, + display_name: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null, + is_average_daily_pay_rate: null) +``` + + diff --git a/docs/payroll_uk/EarningsOrder.md b/docs/payroll_uk/EarningsOrder.md new file mode 100644 index 00000000..722c2c8c --- /dev/null +++ b/docs/payroll_uk/EarningsOrder.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::EarningsOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | Xero unique identifier for an earning rate | [optional] +**name** | **String** | Name of the earning order | +**statutory_deduction_category** | [**StatutoryDeductionCategory**](StatutoryDeductionCategory.md) | | [optional] +**liability_account_id** | **String** | Xero identifier for Liability Account | [optional] +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] [default to true] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsOrder.new(id: null, + name: null, + statutory_deduction_category: null, + liability_account_id: null, + current_record: null) +``` + + diff --git a/docs/payroll_uk/EarningsOrderObject.md b/docs/payroll_uk/EarningsOrderObject.md new file mode 100644 index 00000000..d0d9d153 --- /dev/null +++ b/docs/payroll_uk/EarningsOrderObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EarningsOrderObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deduction** | [**EarningsOrder**](EarningsOrder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsOrderObject.new(pagination: null, + problem: null, + statutory_deduction: null) +``` + + diff --git a/docs/payroll_uk/EarningsOrders.md b/docs/payroll_uk/EarningsOrders.md new file mode 100644 index 00000000..0593ad8d --- /dev/null +++ b/docs/payroll_uk/EarningsOrders.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EarningsOrders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_deductions** | [**Array<EarningsOrder>**](EarningsOrder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsOrders.new(pagination: null, + problem: null, + statutory_deductions: null) +``` + + diff --git a/docs/payroll_uk/EarningsRate.md b/docs/payroll_uk/EarningsRate.md new file mode 100644 index 00000000..59820943 --- /dev/null +++ b/docs/payroll_uk/EarningsRate.md @@ -0,0 +1,35 @@ +# XeroRuby::PayrollUk::EarningsRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero unique identifier for an earning rate | [optional] +**name** | **String** | Name of the earning rate | +**earnings_type** | **String** | Indicates how an employee will be paid when taking this type of earning | +**rate_type** | **String** | Indicates the type of the earning rate | +**type_of_units** | **String** | The type of units used to record earnings | +**current_record** | **Boolean** | Indicates whether an earning type is active | [optional] +**expense_account_id** | **String** | The account that will be used for the earnings rate | +**rate_per_unit** | **BigDecimal** | Default rate per unit (optional). Only applicable if RateType is RatePerUnit | [optional] +**multiple_of_ordinary_earnings_rate** | **BigDecimal** | This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate | [optional] +**fixed_amount** | **BigDecimal** | Optional Fixed Rate Amount. Applicable for FixedAmount Rate | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsRate.new(earnings_rate_id: null, + name: null, + earnings_type: null, + rate_type: null, + type_of_units: null, + current_record: null, + expense_account_id: null, + rate_per_unit: null, + multiple_of_ordinary_earnings_rate: null, + fixed_amount: null) +``` + + diff --git a/docs/payroll_uk/EarningsRateObject.md b/docs/payroll_uk/EarningsRateObject.md new file mode 100644 index 00000000..f6979396 --- /dev/null +++ b/docs/payroll_uk/EarningsRateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EarningsRateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earnings_rate** | [**EarningsRate**](EarningsRate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsRateObject.new(pagination: null, + problem: null, + earnings_rate: null) +``` + + diff --git a/docs/payroll_uk/EarningsRates.md b/docs/payroll_uk/EarningsRates.md new file mode 100644 index 00000000..eceb52bb --- /dev/null +++ b/docs/payroll_uk/EarningsRates.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EarningsRates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earnings_rates** | [**Array<EarningsRate>**](EarningsRate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsRates.new(pagination: null, + problem: null, + earnings_rates: null) +``` + + diff --git a/docs/payroll_uk/EarningsTemplate.md b/docs/payroll_uk/EarningsTemplate.md new file mode 100644 index 00000000..36b38cb5 --- /dev/null +++ b/docs/payroll_uk/EarningsTemplate.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::EarningsTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_template_earning_id** | **String** | The Xero identifier for the earnings template | [optional] +**rate_per_unit** | **BigDecimal** | The rate per unit | [optional] +**number_of_units** | **BigDecimal** | The rate per unit | [optional] +**fixed_amount** | **BigDecimal** | The fixed amount per period | [optional] +**earnings_rate_id** | **String** | The corresponding earnings rate identifier | [optional] +**name** | **String** | The read-only name of the Earning Template. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsTemplate.new(pay_template_earning_id: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + earnings_rate_id: null, + name: null) +``` + + diff --git a/docs/payroll_uk/EarningsTemplateObject.md b/docs/payroll_uk/EarningsTemplateObject.md new file mode 100644 index 00000000..936c6a2a --- /dev/null +++ b/docs/payroll_uk/EarningsTemplateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EarningsTemplateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earning_template** | [**EarningsTemplate**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EarningsTemplateObject.new(pagination: null, + problem: null, + earning_template: null) +``` + + diff --git a/docs/payroll_uk/Employee.md b/docs/payroll_uk/Employee.md new file mode 100644 index 00000000..8325f3f4 --- /dev/null +++ b/docs/payroll_uk/Employee.md @@ -0,0 +1,45 @@ +# XeroRuby::PayrollUk::Employee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | Xero unique identifier for the employee | [optional] +**title** | **String** | Title of the employee | [optional] +**first_name** | **String** | First name of employee | [optional] +**last_name** | **String** | Last name of employee | [optional] +**date_of_birth** | **Date** | Date of birth of the employee (YYYY-MM-DD) | [optional] +**address** | [**Address**](Address.md) | | [optional] +**email** | **String** | The email address for the employee | [optional] +**gender** | **String** | The employee’s gender | [optional] +**phone_number** | **String** | Employee phone number | [optional] +**start_date** | **Date** | Employment start date of the employee at the time it was requested | [optional] +**end_date** | **Date** | Employment end date of the employee at the time it was requested | [optional] +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the employee | [optional] +**created_date_utc** | **DateTime** | UTC timestamp when the employee was created in Xero | [optional] +**national_insurance_number** | **String** | National insurance number of the employee | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Employee.new(employee_id: d90457c4-f1be-4f2e-b4e3-f766390a7e30, + title: Mrs, + first_name: Karen, + last_name: Jones, + date_of_birth: Wed Jan 02 00:00:00 GMT 2019, + address: null, + email: developer@me.com, + gender: F, + phone_number: 415-555-1212, + start_date: Sun Jan 19 00:00:00 GMT 2020, + end_date: Sun Jan 19 00:00:00 GMT 2020, + payroll_calendar_id: null, + updated_date_utc: null, + created_date_utc: null, + national_insurance_number: AB123456C) +``` + + diff --git a/docs/payroll_uk/EmployeeLeave.md b/docs/payroll_uk/EmployeeLeave.md new file mode 100644 index 00000000..2fe1f8e2 --- /dev/null +++ b/docs/payroll_uk/EmployeeLeave.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollUk::EmployeeLeave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_id** | **String** | The Xero identifier for LeaveType | [optional] +**leave_type_id** | **String** | The Xero identifier for LeaveType | +**description** | **String** | The description of the leave (max length = 50) | +**start_date** | **Date** | Start date of the leave (YYYY-MM-DD) | +**end_date** | **Date** | End date of the leave (YYYY-MM-DD) | +**periods** | [**Array<LeavePeriod>**](LeavePeriod.md) | The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the leave type note | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeave.new(leave_id: null, + leave_type_id: null, + description: null, + start_date: null, + end_date: null, + periods: null, + updated_date_utc: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveBalance.md b/docs/payroll_uk/EmployeeLeaveBalance.md new file mode 100644 index 00000000..9e5672ac --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveBalance.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::EmployeeLeaveBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the leave type. | [optional] +**leave_type_id** | **String** | The Xero identifier for leave type | [optional] +**balance** | **Float** | The employees current balance for the corresponding leave type. | [optional] +**type_of_units** | **String** | The type of the units of the leave. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveBalance.new(name: Holiday, + leave_type_id: null, + balance: null, + type_of_units: hours) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveBalances.md b/docs/payroll_uk/EmployeeLeaveBalances.md new file mode 100644 index 00000000..28f838aa --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveBalances.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeLeaveBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_balances** | [**Array<EmployeeLeaveBalance>**](EmployeeLeaveBalance.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveBalances.new(pagination: null, + problem: null, + leave_balances: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveObject.md b/docs/payroll_uk/EmployeeLeaveObject.md new file mode 100644 index 00000000..47baf38e --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeLeaveObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave** | [**EmployeeLeave**](EmployeeLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveObject.new(pagination: null, + problem: null, + leave: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveType.md b/docs/payroll_uk/EmployeeLeaveType.md new file mode 100644 index 00000000..6d163876 --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveType.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::EmployeeLeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | The Xero identifier for leave type | +**schedule_of_accrual** | **String** | The schedule of accrual | +**hours_accrued_annually** | **Float** | The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" | [optional] +**maximum_to_accrue** | **Float** | The maximum number of hours that can be accrued for the leave | [optional] +**opening_balance** | **Float** | The initial number of hours assigned when the leave was added to the employee | [optional] +**rate_accrued_hourly** | **Float** | The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveType.new(leave_type_id: null, + schedule_of_accrual: null, + hours_accrued_annually: null, + maximum_to_accrue: null, + opening_balance: null, + rate_accrued_hourly: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveTypeObject.md b/docs/payroll_uk/EmployeeLeaveTypeObject.md new file mode 100644 index 00000000..c7237622 --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveTypeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeLeaveTypeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_type** | [**EmployeeLeaveType**](EmployeeLeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveTypeObject.new(pagination: null, + problem: null, + leave_type: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaveTypes.md b/docs/payroll_uk/EmployeeLeaveTypes.md new file mode 100644 index 00000000..ab2865ed --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaveTypes.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeLeaveTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_types** | [**Array<EmployeeLeaveType>**](EmployeeLeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaveTypes.new(pagination: null, + problem: null, + leave_types: null) +``` + + diff --git a/docs/payroll_uk/EmployeeLeaves.md b/docs/payroll_uk/EmployeeLeaves.md new file mode 100644 index 00000000..35d92caf --- /dev/null +++ b/docs/payroll_uk/EmployeeLeaves.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeLeaves + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave** | [**Array<EmployeeLeave>**](EmployeeLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeLeaves.new(pagination: null, + problem: null, + leave: null) +``` + + diff --git a/docs/payroll_uk/EmployeeObject.md b/docs/payroll_uk/EmployeeObject.md new file mode 100644 index 00000000..6c91bcb1 --- /dev/null +++ b/docs/payroll_uk/EmployeeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**employee** | [**Employee**](Employee.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeObject.new(pagination: null, + employee: null, + problem: null) +``` + + diff --git a/docs/payroll_uk/EmployeeOpeningBalances.md b/docs/payroll_uk/EmployeeOpeningBalances.md new file mode 100644 index 00000000..b4d1b48c --- /dev/null +++ b/docs/payroll_uk/EmployeeOpeningBalances.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::EmployeeOpeningBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_adoption_pay** | **BigDecimal** | The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date | [optional] +**statutory_maternity_pay** | **BigDecimal** | The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date | [optional] +**statutory_paternity_pay** | **BigDecimal** | The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date | [optional] +**statutory_shared_parental_pay** | **BigDecimal** | The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date | [optional] +**statutory_sick_pay** | **BigDecimal** | The total accumulated statutory sick pay amount received by the employee for current fiscal year to date | [optional] +**prior_employee_number** | **Float** | The unique employee number issued by the employee's former employer | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeOpeningBalances.new(statutory_adoption_pay: null, + statutory_maternity_pay: null, + statutory_paternity_pay: null, + statutory_shared_parental_pay: null, + statutory_sick_pay: null, + prior_employee_number: null) +``` + + diff --git a/docs/payroll_uk/EmployeeOpeningBalancesObject.md b/docs/payroll_uk/EmployeeOpeningBalancesObject.md new file mode 100644 index 00000000..aa06dfb3 --- /dev/null +++ b/docs/payroll_uk/EmployeeOpeningBalancesObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeOpeningBalancesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**opening_balances** | [**EmployeeOpeningBalances**](EmployeeOpeningBalances.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeOpeningBalancesObject.new(pagination: null, + problem: null, + opening_balances: null) +``` + + diff --git a/docs/payroll_uk/EmployeePayTemplate.md b/docs/payroll_uk/EmployeePayTemplate.md new file mode 100644 index 00000000..508efcf5 --- /dev/null +++ b/docs/payroll_uk/EmployeePayTemplate.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::EmployeePayTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | Unique identifier for the employee | [optional] +**earning_templates** | [**Array<EarningsTemplate>**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeePayTemplate.new(employee_id: null, + earning_templates: null) +``` + + diff --git a/docs/payroll_uk/EmployeePayTemplateObject.md b/docs/payroll_uk/EmployeePayTemplateObject.md new file mode 100644 index 00000000..6a3c8004 --- /dev/null +++ b/docs/payroll_uk/EmployeePayTemplateObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeePayTemplateObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_template** | [**EmployeePayTemplate**](EmployeePayTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeePayTemplateObject.new(pagination: null, + problem: null, + pay_template: null) +``` + + diff --git a/docs/payroll_uk/EmployeePayTemplates.md b/docs/payroll_uk/EmployeePayTemplates.md new file mode 100644 index 00000000..9ea56783 --- /dev/null +++ b/docs/payroll_uk/EmployeePayTemplates.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeePayTemplates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**earning_templates** | [**Array<EarningsTemplate>**](EarningsTemplate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeePayTemplates.new(pagination: null, + problem: null, + earning_templates: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutoryLeaveBalance.md b/docs/payroll_uk/EmployeeStatutoryLeaveBalance.md new file mode 100644 index 00000000..d37e472d --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutoryLeaveBalance.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type** | **String** | The type of statutory leave | [optional] +**balance_remaining** | **Float** | The balance remaining for the corresponding leave type as of specified date. | [optional] +**units** | **String** | The units will be \"Hours\" | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance.new(leave_type: null, + balance_remaining: null, + units: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutoryLeaveBalanceObject.md b/docs/payroll_uk/EmployeeStatutoryLeaveBalanceObject.md new file mode 100644 index 00000000..046a0d33 --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutoryLeaveBalanceObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_balance** | [**EmployeeStatutoryLeaveBalance**](EmployeeStatutoryLeaveBalance.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject.new(pagination: null, + problem: null, + leave_balance: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutoryLeaveSummary.md b/docs/payroll_uk/EmployeeStatutoryLeaveSummary.md new file mode 100644 index 00000000..fada932f --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutoryLeaveSummary.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_leave_id** | **String** | The unique identifier (guid) of a statutory leave. | [optional] +**employee_id** | **String** | The unique identifier (guid) of the employee | [optional] +**type** | **String** | The category of statutory leave | [optional] +**start_date** | **Date** | The date when the leave starts | [optional] +**end_date** | **Date** | The date when the leave ends | [optional] +**is_entitled** | **Boolean** | Whether the leave was entitled to receive payment | [optional] +**status** | **String** | The status of the leave | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary.new(statutory_leave_id: null, + employee_id: null, + type: null, + start_date: null, + end_date: null, + is_entitled: null, + status: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutoryLeavesSummaries.md b/docs/payroll_uk/EmployeeStatutoryLeavesSummaries.md new file mode 100644 index 00000000..cd7ffff7 --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutoryLeavesSummaries.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_leaves** | [**Array<EmployeeStatutoryLeaveSummary>**](EmployeeStatutoryLeaveSummary.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries.new(pagination: null, + problem: null, + statutory_leaves: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutorySickLeave.md b/docs/payroll_uk/EmployeeStatutorySickLeave.md new file mode 100644 index 00000000..4f019566 --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutorySickLeave.md @@ -0,0 +1,47 @@ +# XeroRuby::PayrollUk::EmployeeStatutorySickLeave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statutory_leave_id** | **String** | The unique identifier (guid) of a statutory leave | [optional] +**employee_id** | **String** | The unique identifier (guid) of the employee | +**leave_type_id** | **String** | The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item | +**start_date** | **Date** | The date when the leave starts | +**end_date** | **Date** | The date when the leave ends | +**type** | **String** | the type of statutory leave | [optional] +**status** | **String** | the type of statutory leave | [optional] +**work_pattern** | **Array<String>** | The days of the work week the employee is scheduled to work at the time the leave is taken | +**is_pregnancy_related** | **Boolean** | Whether the sick leave was pregnancy related | +**sufficient_notice** | **Boolean** | Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request | +**is_entitled** | **Boolean** | Whether the leave was entitled to receive payment | [optional] +**entitlement_weeks_requested** | **Float** | The amount of requested time (in weeks) | [optional] +**entitlement_weeks_qualified** | **Float** | The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested | [optional] +**entitlement_weeks_remaining** | **Float** | A calculated amount of time (in weeks) that remains for the statutory sick leave period | [optional] +**overlaps_with_other_leave** | **Boolean** | Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts | [optional] +**entitlement_failure_reasons** | **Array<String>** | If the leave requested was considered \"not entitled\", the reasons why are listed here. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeave.new(statutory_leave_id: null, + employee_id: null, + leave_type_id: null, + start_date: null, + end_date: null, + type: Sick, + status: Pending, + work_pattern: null, + is_pregnancy_related: null, + sufficient_notice: null, + is_entitled: null, + entitlement_weeks_requested: null, + entitlement_weeks_qualified: null, + entitlement_weeks_remaining: null, + overlaps_with_other_leave: null, + entitlement_failure_reasons: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutorySickLeaveObject.md b/docs/payroll_uk/EmployeeStatutorySickLeaveObject.md new file mode 100644 index 00000000..218adce7 --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutorySickLeaveObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_sick_leave** | [**EmployeeStatutorySickLeave**](EmployeeStatutorySickLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject.new(pagination: null, + problem: null, + statutory_sick_leave: null) +``` + + diff --git a/docs/payroll_uk/EmployeeStatutorySickLeaves.md b/docs/payroll_uk/EmployeeStatutorySickLeaves.md new file mode 100644 index 00000000..0e883d69 --- /dev/null +++ b/docs/payroll_uk/EmployeeStatutorySickLeaves.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeStatutorySickLeaves + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**statutory_sick_leave** | [**Array<EmployeeStatutorySickLeave>**](EmployeeStatutorySickLeave.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeaves.new(pagination: null, + problem: null, + statutory_sick_leave: null) +``` + + diff --git a/docs/payroll_uk/EmployeeTax.md b/docs/payroll_uk/EmployeeTax.md new file mode 100644 index 00000000..2c1f4909 --- /dev/null +++ b/docs/payroll_uk/EmployeeTax.md @@ -0,0 +1,37 @@ +# XeroRuby::PayrollUk::EmployeeTax + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**starter_type** | **String** | The Starter type. | [optional] +**starter_declaration** | **String** | Starter declaration. | [optional] +**tax_code** | **String** | The Tax code. | [optional] +**w1_m1** | **Boolean** | Describes whether the tax settings is W1M1 | [optional] +**previous_taxable_pay** | **BigDecimal** | The previous taxable pay | [optional] +**previous_tax_paid** | **BigDecimal** | The tax amount previously paid | [optional] +**student_loan_deduction** | **String** | The employee's student loan deduction type | [optional] +**has_post_graduate_loans** | **Boolean** | Describes whether the employee has post graduate loans | [optional] +**is_director** | **Boolean** | Describes whether the employee is director | [optional] +**directorship_start_date** | **Date** | The directorship start date | [optional] +**nic_calculation_method** | **String** | NICs calculation method | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeTax.new(starter_type: New Employee with P45, + starter_declaration: B.) This is currently their only job, + tax_code: 1185L, + w1_m1: null, + previous_taxable_pay: null, + previous_tax_paid: null, + student_loan_deduction: Plan Type 2, + has_post_graduate_loans: null, + is_director: null, + directorship_start_date: null, + nic_calculation_method: Annualized) +``` + + diff --git a/docs/payroll_uk/EmployeeTaxObject.md b/docs/payroll_uk/EmployeeTaxObject.md new file mode 100644 index 00000000..22a5eea8 --- /dev/null +++ b/docs/payroll_uk/EmployeeTaxObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmployeeTaxObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employee_tax** | [**EmployeeTax**](EmployeeTax.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmployeeTaxObject.new(pagination: null, + problem: null, + employee_tax: null) +``` + + diff --git a/docs/payroll_uk/Employees.md b/docs/payroll_uk/Employees.md new file mode 100644 index 00000000..4fd9383d --- /dev/null +++ b/docs/payroll_uk/Employees.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Employees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employees** | [**Array<Employee>**](Employee.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Employees.new(pagination: null, + problem: null, + employees: null) +``` + + diff --git a/docs/payroll_uk/Employment.md b/docs/payroll_uk/Employment.md new file mode 100644 index 00000000..a93e69f8 --- /dev/null +++ b/docs/payroll_uk/Employment.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::Employment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional] +**start_date** | **Date** | Start date of the employment (YYYY-MM-DD) | [optional] +**employee_number** | **String** | The employment number of the employee | [optional] +**ni_category** | **String** | The NI Category of the employee | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Employment.new(payroll_calendar_id: null, + start_date: null, + employee_number: 7, + ni_category: A) +``` + + diff --git a/docs/payroll_uk/EmploymentObject.md b/docs/payroll_uk/EmploymentObject.md new file mode 100644 index 00000000..9bbf2354 --- /dev/null +++ b/docs/payroll_uk/EmploymentObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::EmploymentObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**employment** | [**Employment**](Employment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::EmploymentObject.new(pagination: null, + problem: null, + employment: null) +``` + + diff --git a/docs/payroll_uk/InvalidField.md b/docs/payroll_uk/InvalidField.md new file mode 100644 index 00000000..926bf087 --- /dev/null +++ b/docs/payroll_uk/InvalidField.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::InvalidField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the field that caused the error | [optional] +**reason** | **String** | The reason the error occurred | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::InvalidField.new(name: DateOfBirth, + reason: The Date of Birth is required.) +``` + + diff --git a/docs/payroll_uk/LeaveAccrualLine.md b/docs/payroll_uk/LeaveAccrualLine.md new file mode 100644 index 00000000..965c782a --- /dev/null +++ b/docs/payroll_uk/LeaveAccrualLine.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::LeaveAccrualLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_type_id** | **String** | Xero identifier for the Leave type | [optional] +**number_of_units** | **Float** | Leave accrual number of units | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeaveAccrualLine.new(leave_type_id: null, + number_of_units: null) +``` + + diff --git a/docs/payroll_uk/LeaveEarningsLine.md b/docs/payroll_uk/LeaveEarningsLine.md new file mode 100644 index 00000000..c1d15a01 --- /dev/null +++ b/docs/payroll_uk/LeaveEarningsLine.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::LeaveEarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero identifier for payroll leave earnings rate | [optional] +**rate_per_unit** | **Float** | Rate per unit for leave earnings line | [optional] +**number_of_units** | **Float** | Leave earnings number of units | [optional] +**fixed_amount** | **Float** | Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **Float** | The amount of the earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the leave earnings is taken from the timesheet. False for leave earnings line | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeaveEarningsLine.new(earnings_rate_id: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null) +``` + + diff --git a/docs/payroll_uk/LeavePeriod.md b/docs/payroll_uk/LeavePeriod.md new file mode 100644 index 00000000..d9bf7a98 --- /dev/null +++ b/docs/payroll_uk/LeavePeriod.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::LeavePeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period_start_date** | **Date** | The Pay Period Start Date (YYYY-MM-DD) | [optional] +**period_end_date** | **Date** | The Pay Period End Date (YYYY-MM-DD) | [optional] +**number_of_units** | **Float** | The Number of Units for the leave | [optional] +**period_status** | **String** | Period Status | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeavePeriod.new(period_start_date: null, + period_end_date: null, + number_of_units: null, + period_status: null) +``` + + diff --git a/docs/payroll_uk/LeavePeriods.md b/docs/payroll_uk/LeavePeriods.md new file mode 100644 index 00000000..8784a9f7 --- /dev/null +++ b/docs/payroll_uk/LeavePeriods.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::LeavePeriods + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**periods** | [**Array<LeavePeriod>**](LeavePeriod.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeavePeriods.new(pagination: null, + problem: null, + periods: null) +``` + + diff --git a/docs/payroll_uk/LeaveType.md b/docs/payroll_uk/LeaveType.md new file mode 100644 index 00000000..4e7c9806 --- /dev/null +++ b/docs/payroll_uk/LeaveType.md @@ -0,0 +1,31 @@ +# XeroRuby::PayrollUk::LeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leave_id** | **String** | Xero unique identifier for the leave | [optional] +**leave_type_id** | **String** | Xero unique identifier for the leave type | [optional] +**name** | **String** | Name of the leave type | +**is_paid_leave** | **Boolean** | Indicate that an employee will be paid when taking this type of leave | +**show_on_payslip** | **Boolean** | Indicate that a balance for this leave type to be shown on the employee’s payslips | +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the leave type note | [optional] +**is_active** | **Boolean** | Shows whether the leave type is active or not | [optional] +**is_statutory_leave** | **Boolean** | Shows whether the leave type is a statutory leave type or not | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeaveType.new(leave_id: null, + leave_type_id: null, + name: null, + is_paid_leave: null, + show_on_payslip: null, + updated_date_utc: null, + is_active: null, + is_statutory_leave: null) +``` + + diff --git a/docs/payroll_uk/LeaveTypeObject.md b/docs/payroll_uk/LeaveTypeObject.md new file mode 100644 index 00000000..d042f8a7 --- /dev/null +++ b/docs/payroll_uk/LeaveTypeObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::LeaveTypeObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_type** | [**LeaveType**](LeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeaveTypeObject.new(pagination: null, + problem: null, + leave_type: null) +``` + + diff --git a/docs/payroll_uk/LeaveTypes.md b/docs/payroll_uk/LeaveTypes.md new file mode 100644 index 00000000..9bb0e564 --- /dev/null +++ b/docs/payroll_uk/LeaveTypes.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::LeaveTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**leave_types** | [**Array<LeaveType>**](LeaveType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::LeaveTypes.new(pagination: null, + problem: null, + leave_types: null) +``` + + diff --git a/docs/payroll_uk/Pagination.md b/docs/payroll_uk/Pagination.md new file mode 100644 index 00000000..60ee4827 --- /dev/null +++ b/docs/payroll_uk/Pagination.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::Pagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **Integer** | | [optional] +**page_size** | **Integer** | | [optional] +**page_count** | **Integer** | | [optional] +**item_count** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Pagination.new(page: 1, + page_size: 10, + page_count: 1, + item_count: 2) +``` + + diff --git a/docs/payroll_uk/PayRun.md b/docs/payroll_uk/PayRun.md new file mode 100644 index 00000000..e1e1dae3 --- /dev/null +++ b/docs/payroll_uk/PayRun.md @@ -0,0 +1,39 @@ +# XeroRuby::PayrollUk::PayRun + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_run_id** | **String** | Xero unique identifier for the pay run | [optional] +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar | [optional] +**period_start_date** | **Date** | Period start date of the payroll calendar | [optional] +**period_end_date** | **Date** | Period end date of the payroll calendar | [optional] +**payment_date** | **Date** | Payment date of the pay run | [optional] +**total_cost** | **Float** | Total cost of the pay run | [optional] +**total_pay** | **Float** | Total pay of the pay run | [optional] +**pay_run_status** | **String** | Pay run status | [optional] +**pay_run_type** | **String** | Pay run type | [optional] +**calendar_type** | **String** | Calendar type of the pay run | [optional] +**posted_date_time** | **Date** | Posted date time of the pay run | [optional] +**pay_slips** | [**Array<Payslip>**](Payslip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRun.new(pay_run_id: null, + payroll_calendar_id: null, + period_start_date: null, + period_end_date: null, + payment_date: null, + total_cost: null, + total_pay: null, + pay_run_status: null, + pay_run_type: null, + calendar_type: null, + posted_date_time: null, + pay_slips: null) +``` + + diff --git a/docs/payroll_uk/PayRunCalendar.md b/docs/payroll_uk/PayRunCalendar.md new file mode 100644 index 00000000..31825265 --- /dev/null +++ b/docs/payroll_uk/PayRunCalendar.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollUk::PayRunCalendar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar | [optional] +**name** | **String** | Name of the calendar | +**calendar_type** | **String** | Type of the calendar | +**period_start_date** | **Date** | Period start date of the calendar | +**period_end_date** | **Date** | Period end date of the calendar | [optional] +**payment_date** | **Date** | Payment date of the calendar | +**updated_date_utc** | **DateTime** | UTC timestamp of the last update to the pay run calendar | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRunCalendar.new(payroll_calendar_id: null, + name: null, + calendar_type: null, + period_start_date: null, + period_end_date: null, + payment_date: null, + updated_date_utc: null) +``` + + diff --git a/docs/payroll_uk/PayRunCalendarObject.md b/docs/payroll_uk/PayRunCalendarObject.md new file mode 100644 index 00000000..9532efdb --- /dev/null +++ b/docs/payroll_uk/PayRunCalendarObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PayRunCalendarObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run_calendar** | [**PayRunCalendar**](PayRunCalendar.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRunCalendarObject.new(pagination: null, + problem: null, + pay_run_calendar: null) +``` + + diff --git a/docs/payroll_uk/PayRunCalendars.md b/docs/payroll_uk/PayRunCalendars.md new file mode 100644 index 00000000..86532612 --- /dev/null +++ b/docs/payroll_uk/PayRunCalendars.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PayRunCalendars + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run_calendars** | [**Array<PayRunCalendar>**](PayRunCalendar.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRunCalendars.new(pagination: null, + problem: null, + pay_run_calendars: null) +``` + + diff --git a/docs/payroll_uk/PayRunObject.md b/docs/payroll_uk/PayRunObject.md new file mode 100644 index 00000000..89677fd8 --- /dev/null +++ b/docs/payroll_uk/PayRunObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PayRunObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_run** | [**PayRun**](PayRun.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRunObject.new(pagination: null, + problem: null, + pay_run: null) +``` + + diff --git a/docs/payroll_uk/PayRuns.md b/docs/payroll_uk/PayRuns.md new file mode 100644 index 00000000..37ba83da --- /dev/null +++ b/docs/payroll_uk/PayRuns.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PayRuns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_runs** | [**Array<PayRun>**](PayRun.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayRuns.new(pagination: null, + problem: null, + pay_runs: null) +``` + + diff --git a/docs/payroll_uk/PaymentLine.md b/docs/payroll_uk/PaymentLine.md new file mode 100644 index 00000000..7ebe86aa --- /dev/null +++ b/docs/payroll_uk/PaymentLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::PaymentLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_line_id** | **String** | Xero identifier for payroll payment line | [optional] +**amount** | **Float** | The amount of the payment line | [optional] +**account_number** | **String** | The account number | [optional] +**sort_code** | **String** | The account sort code | [optional] +**account_name** | **String** | The account name | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PaymentLine.new(payment_line_id: null, + amount: null, + account_number: null, + sort_code: null, + account_name: null) +``` + + diff --git a/docs/payroll_uk/PaymentMethod.md b/docs/payroll_uk/PaymentMethod.md new file mode 100644 index 00000000..1c9feee0 --- /dev/null +++ b/docs/payroll_uk/PaymentMethod.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::PaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_method** | **String** | The payment method code | +**bank_accounts** | [**Array<BankAccount>**](BankAccount.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PaymentMethod.new(payment_method: null, + bank_accounts: null) +``` + + diff --git a/docs/payroll_uk/PaymentMethodObject.md b/docs/payroll_uk/PaymentMethodObject.md new file mode 100644 index 00000000..9d3849a5 --- /dev/null +++ b/docs/payroll_uk/PaymentMethodObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PaymentMethodObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**payment_method** | [**PaymentMethod**](PaymentMethod.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PaymentMethodObject.new(pagination: null, + problem: null, + payment_method: null) +``` + + diff --git a/docs/payroll_uk/PayrollUkApi.md b/docs/payroll_uk/PayrollUkApi.md new file mode 100644 index 00000000..c2b580fd --- /dev/null +++ b/docs/payroll_uk/PayrollUkApi.md @@ -0,0 +1,4683 @@ +# XeroRuby::PayrollUk::PayrollUkApi + +All URIs are relative to *https://api.xero.com/payroll.xro/2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**approve_timesheet**](PayrollUkApi.md#approve_timesheet) | **POST** /Timesheets/{TimesheetID}/Approve | approve a timesheet +[**create_benefit**](PayrollUkApi.md#create_benefit) | **POST** /Benefits | create a new benefit +[**create_deduction**](PayrollUkApi.md#create_deduction) | **POST** /Deductions | create a new deduction +[**create_earnings_rate**](PayrollUkApi.md#create_earnings_rate) | **POST** /EarningsRates | create a new earnings rate +[**create_employee**](PayrollUkApi.md#create_employee) | **POST** /Employees | creates employees +[**create_employee_earnings_template**](PayrollUkApi.md#create_employee_earnings_template) | **POST** /Employees/{EmployeeId}/PayTemplates/earnings | creates employee earnings template records +[**create_employee_leave**](PayrollUkApi.md#create_employee_leave) | **POST** /Employees/{EmployeeId}/Leave | creates employee leave records +[**create_employee_leave_type**](PayrollUkApi.md#create_employee_leave_type) | **POST** /Employees/{EmployeeId}/LeaveTypes | creates employee leave type records +[**create_employee_opening_balances**](PayrollUkApi.md#create_employee_opening_balances) | **POST** /Employees/{EmployeeId}/ukopeningbalances | creates employee opening balances +[**create_employee_payment_method**](PayrollUkApi.md#create_employee_payment_method) | **POST** /Employees/{EmployeeId}/PaymentMethods | creates employee payment method +[**create_employee_salary_and_wage**](PayrollUkApi.md#create_employee_salary_and_wage) | **POST** /Employees/{EmployeeId}/SalaryAndWages | creates employee salary and wage record +[**create_employee_statutory_sick_leave**](PayrollUkApi.md#create_employee_statutory_sick_leave) | **POST** /StatutoryLeaves/Sick | creates employee statutory sick leave records +[**create_employment**](PayrollUkApi.md#create_employment) | **POST** /Employees/{EmployeeId}/Employment | creates employment +[**create_leave_type**](PayrollUkApi.md#create_leave_type) | **POST** /LeaveTypes | create a new leave type +[**create_multiple_employee_earnings_template**](PayrollUkApi.md#create_multiple_employee_earnings_template) | **POST** /Employees/{EmployeeId}/paytemplateearnings | creates multiple employee earnings template records +[**create_pay_run_calendar**](PayrollUkApi.md#create_pay_run_calendar) | **POST** /PayRunCalendars | create a new payrun calendar +[**create_reimbursement**](PayrollUkApi.md#create_reimbursement) | **POST** /Reimbursements | create a new reimbursement +[**create_timesheet**](PayrollUkApi.md#create_timesheet) | **POST** /Timesheets | create a new timesheet +[**create_timesheet_line**](PayrollUkApi.md#create_timesheet_line) | **POST** /Timesheets/{TimesheetID}/Lines | create a new timesheet line +[**delete_employee_earnings_template**](PayrollUkApi.md#delete_employee_earnings_template) | **DELETE** /Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} | deletes an employee earnings template record +[**delete_employee_leave**](PayrollUkApi.md#delete_employee_leave) | **DELETE** /Employees/{EmployeeId}/Leave/{LeaveID} | deletes an employee leave record +[**delete_employee_salary_and_wage**](PayrollUkApi.md#delete_employee_salary_and_wage) | **DELETE** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | deletes an employee salary and wages record +[**delete_timesheet**](PayrollUkApi.md#delete_timesheet) | **DELETE** /Timesheets/{TimesheetID} | delete a timesheet +[**delete_timesheet_line**](PayrollUkApi.md#delete_timesheet_line) | **DELETE** /Timesheets/{TimesheetID}/Lines/{TimesheetLineID} | delete a timesheet line +[**get_benefit**](PayrollUkApi.md#get_benefit) | **GET** /Benefits/{id} | retrieve a single benefit by id +[**get_benefits**](PayrollUkApi.md#get_benefits) | **GET** /Benefits | searches benefits +[**get_deduction**](PayrollUkApi.md#get_deduction) | **GET** /Deductions/{deductionId} | retrieve a single deduction by id +[**get_deductions**](PayrollUkApi.md#get_deductions) | **GET** /Deductions | searches deductions +[**get_earnings_order**](PayrollUkApi.md#get_earnings_order) | **GET** /EarningsOrders/{id} | retrieve a single deduction by id +[**get_earnings_orders**](PayrollUkApi.md#get_earnings_orders) | **GET** /EarningsOrders | searches earnings orders +[**get_earnings_rate**](PayrollUkApi.md#get_earnings_rate) | **GET** /EarningsRates/{EarningsRateID} | retrieve a single earnings rates by id +[**get_earnings_rates**](PayrollUkApi.md#get_earnings_rates) | **GET** /EarningsRates | searches earnings rates +[**get_employee**](PayrollUkApi.md#get_employee) | **GET** /Employees/{EmployeeId} | searches employees +[**get_employee_leave**](PayrollUkApi.md#get_employee_leave) | **GET** /Employees/{EmployeeId}/Leave/{LeaveID} | retrieve a single employee leave record +[**get_employee_leave_balances**](PayrollUkApi.md#get_employee_leave_balances) | **GET** /Employees/{EmployeeId}/LeaveBalances | search employee leave balances +[**get_employee_leave_periods**](PayrollUkApi.md#get_employee_leave_periods) | **GET** /Employees/{EmployeeId}/LeavePeriods | searches employee leave periods +[**get_employee_leave_types**](PayrollUkApi.md#get_employee_leave_types) | **GET** /Employees/{EmployeeId}/LeaveTypes | searches employee leave types +[**get_employee_leaves**](PayrollUkApi.md#get_employee_leaves) | **GET** /Employees/{EmployeeId}/Leave | search employee leave records +[**get_employee_opening_balances**](PayrollUkApi.md#get_employee_opening_balances) | **GET** /Employees/{EmployeeId}/ukopeningbalances | retrieve employee openingbalances +[**get_employee_pay_template**](PayrollUkApi.md#get_employee_pay_template) | **GET** /Employees/{EmployeeId}/PayTemplates | searches employee pay templates +[**get_employee_payment_method**](PayrollUkApi.md#get_employee_payment_method) | **GET** /Employees/{EmployeeId}/PaymentMethods | retrieves an employee's payment method +[**get_employee_salary_and_wage**](PayrollUkApi.md#get_employee_salary_and_wage) | **GET** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | get employee salary and wages record by id +[**get_employee_salary_and_wages**](PayrollUkApi.md#get_employee_salary_and_wages) | **GET** /Employees/{EmployeeId}/SalaryAndWages | retrieves an employee's salary and wages +[**get_employee_statutory_leave_balances**](PayrollUkApi.md#get_employee_statutory_leave_balances) | **GET** /Employees/{EmployeeId}/StatutoryLeaveBalance | search employee leave balances +[**get_employee_statutory_sick_leave**](PayrollUkApi.md#get_employee_statutory_sick_leave) | **GET** /StatutoryLeaves/Sick/{StatutorySickLeaveID} | retrieve a statutory sick leave for an employee +[**get_employee_tax**](PayrollUkApi.md#get_employee_tax) | **GET** /Employees/{EmployeeId}/Tax | searches tax records for an employee +[**get_employees**](PayrollUkApi.md#get_employees) | **GET** /Employees | searches employees +[**get_leave_type**](PayrollUkApi.md#get_leave_type) | **GET** /LeaveTypes/{LeaveTypeID} | retrieve a single leave type by id +[**get_leave_types**](PayrollUkApi.md#get_leave_types) | **GET** /LeaveTypes | searches leave types +[**get_pay_run**](PayrollUkApi.md#get_pay_run) | **GET** /PayRuns/{PayRunID} | retrieve a single pay run by id +[**get_pay_run_calendar**](PayrollUkApi.md#get_pay_run_calendar) | **GET** /PayRunCalendars/{PayRunCalendarID} | retrieve a single payrun calendar by id +[**get_pay_run_calendars**](PayrollUkApi.md#get_pay_run_calendars) | **GET** /PayRunCalendars | searches payrun calendars +[**get_pay_runs**](PayrollUkApi.md#get_pay_runs) | **GET** /PayRuns | searches pay runs +[**get_pay_slip**](PayrollUkApi.md#get_pay_slip) | **GET** /Payslips/{PayslipID} | retrieve a single payslip by id +[**get_pay_slips**](PayrollUkApi.md#get_pay_slips) | **GET** /Payslips | searches payslips +[**get_reimbursement**](PayrollUkApi.md#get_reimbursement) | **GET** /Reimbursements/{ReimbursementID} | retrieve a single reimbursement by id +[**get_reimbursements**](PayrollUkApi.md#get_reimbursements) | **GET** /Reimbursements | searches reimbursements +[**get_settings**](PayrollUkApi.md#get_settings) | **GET** /Settings | searches settings +[**get_statutory_leave_summary**](PayrollUkApi.md#get_statutory_leave_summary) | **GET** /statutoryleaves/summary/{EmployeeId} | retrieve a summary of statutory leaves for an employee +[**get_timesheet**](PayrollUkApi.md#get_timesheet) | **GET** /Timesheets/{TimesheetID} | retrieve a single timesheet by id +[**get_timesheets**](PayrollUkApi.md#get_timesheets) | **GET** /Timesheets | searches timesheets +[**get_tracking_categories**](PayrollUkApi.md#get_tracking_categories) | **GET** /settings/trackingCategories | searches tracking categories +[**revert_timesheet**](PayrollUkApi.md#revert_timesheet) | **POST** /Timesheets/{TimesheetID}/RevertToDraft | revert a timesheet to draft +[**update_employee**](PayrollUkApi.md#update_employee) | **PUT** /Employees/{EmployeeId} | updates employee +[**update_employee_earnings_template**](PayrollUkApi.md#update_employee_earnings_template) | **PUT** /Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} | updates employee earnings template records +[**update_employee_leave**](PayrollUkApi.md#update_employee_leave) | **PUT** /Employees/{EmployeeId}/Leave/{LeaveID} | updates employee leave records +[**update_employee_opening_balances**](PayrollUkApi.md#update_employee_opening_balances) | **PUT** /Employees/{EmployeeId}/ukopeningbalances | updates employee opening balances +[**update_employee_salary_and_wage**](PayrollUkApi.md#update_employee_salary_and_wage) | **PUT** /Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} | updates employee salary and wages record +[**update_pay_run**](PayrollUkApi.md#update_pay_run) | **PUT** /PayRuns/{PayRunID} | update a pay run +[**update_timesheet_line**](PayrollUkApi.md#update_timesheet_line) | **PUT** /Timesheets/{TimesheetID}/Lines/{TimesheetLineID} | update a timesheet line + + + +## approve_timesheet + +> TimesheetObject approve_timesheet(xero_tenant_id, timesheet_id) + +approve a timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #approve a timesheet + result = api_instance.approve_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->approve_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## create_benefit + +> BenefitObject create_benefit(xero_tenant_id, benefit) + +create a new benefit + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +benefit = { "name": "My Big Bennie", "category": "StakeholderPension", "liabilityAccountId": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a", "expenseAccountId": "4b03500d-32fd-4616-8d70-e1e56e0519c6", "standardAmount": 50, "percentage": 25, "calculationType": "PercentageOfGross" } # Benefit | +begin + #create a new benefit + result = api_instance.create_benefit(xero_tenant_id, benefit) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_benefit: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **benefit** | [**Benefit**](Benefit.md)| | + +### Return type + +[**BenefitObject**](BenefitObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_deduction + +> DeductionObject create_deduction(xero_tenant_id, deduction) + +create a new deduction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +deduction = { "deductionName": "My new deducation", "deductionCategory": "SalarySacrifice", "liabilityAccountId": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a", "calculationType": "FixedAmount" } # Deduction | +begin + #create a new deduction + result = api_instance.create_deduction(xero_tenant_id, deduction) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_deduction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **deduction** | [**Deduction**](Deduction.md)| | + +### Return type + +[**DeductionObject**](DeductionObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_earnings_rate + +> EarningsRateObject create_earnings_rate(xero_tenant_id, earnings_rate) + +create a new earnings rate + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +earnings_rate = { "name": "My Earnings Rate", "earningsType": "RegularEarnings", "rateType": "RatePerUnit", "typeOfUnits": "hours", "expenseAccountID": "4b03500d-32fd-4616-8d70-e1e56e0519c6" } # EarningsRate | +begin + #create a new earnings rate + result = api_instance.create_earnings_rate(xero_tenant_id, earnings_rate) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_earnings_rate: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **earnings_rate** | [**EarningsRate**](EarningsRate.md)| | + +### Return type + +[**EarningsRateObject**](EarningsRateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee + +> EmployeeObject create_employee(xero_tenant_id, employee) + +creates employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee = { "title":"Mr", "firstName":"Mike", "lastName":"Fancy", "dateOfBirth":"1999-01-01", "address":{ "addressLine1":"101 Green St", "city":"San Francisco", "postCode":"6TGR4F", "country":"UK" }, "email":"mike@starkindustries.com", "gender":"M" } # Employee | +begin + #creates employees + result = api_instance.create_employee(xero_tenant_id, employee) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee** | [**Employee**](Employee.md)| | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_earnings_template + +> EarningsTemplateObject create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + +creates employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +earnings_template = XeroRuby::PayrollUk::EarningsTemplate.new # EarningsTemplate | +begin + #creates employee earnings template records + result = api_instance.create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **earnings_template** | [**EarningsTemplate**](EarningsTemplate.md)| | + +### Return type + +[**EarningsTemplateObject**](EarningsTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_leave + +> EmployeeLeaveObject create_employee_leave(xero_tenant_id, employee_id, employee_leave) + +creates employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_leave = { "leaveTypeID": "1d2778ee-86ea-45c0-bbf8-1045485f6b3f", "description": "Creating a Desription", "startDate": "2020-03-24", "endDate": "2020-03-26" } # EmployeeLeave | +begin + #creates employee leave records + result = api_instance.create_employee_leave(xero_tenant_id, employee_id, employee_leave) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_leave** | [**EmployeeLeave**](EmployeeLeave.md)| | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_leave_type + +> EmployeeLeaveTypeObject create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type) + +creates employee leave type records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_leave_type = { "leaveTypeID": "4918f233-bd31-43f9-9633-bcc6de1178f2", "scheduleOfAccrual": "BeginningOfCalendarYear", "hoursAccruedAnnually": 10 } # EmployeeLeaveType | +begin + #creates employee leave type records + result = api_instance.create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_leave_type** | [**EmployeeLeaveType**](EmployeeLeaveType.md)| | + +### Return type + +[**EmployeeLeaveTypeObject**](EmployeeLeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_opening_balances + +> EmployeeOpeningBalancesObject create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances) + +creates employee opening balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_opening_balances = { "statutoryAdoptionPay": 10, "statutoryMaternityPay": 10, "statutoryPaternityPay": 10, "statutorySharedParentalPay": 10, "statutorySickPay": 10, "priorEmployeeNumber": 10 } # EmployeeOpeningBalances | +begin + #creates employee opening balances + result = api_instance.create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_opening_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_opening_balances** | [**EmployeeOpeningBalances**](EmployeeOpeningBalances.md)| | + +### Return type + +[**EmployeeOpeningBalancesObject**](EmployeeOpeningBalancesObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_payment_method + +> PaymentMethodObject create_employee_payment_method(xero_tenant_id, employee_id, payment_method) + +creates employee payment method + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +payment_method = { "paymentMethod": "Electronically", "bankAccounts": [ { "accountName": "Sid BofA", "accountNumber": "24987654", "sortCode": "287654" } ] } # PaymentMethod | +begin + #creates employee payment method + result = api_instance.create_employee_payment_method(xero_tenant_id, employee_id, payment_method) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_payment_method: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **payment_method** | [**PaymentMethod**](PaymentMethod.md)| | + +### Return type + +[**PaymentMethodObject**](PaymentMethodObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_salary_and_wage + +> SalaryAndWageObject create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage) + +creates employee salary and wage record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wage = { "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnitsPerWeek": 2, "ratePerUnit": 10, "numberOfUnitsPerDay": 2, "effectiveFrom": "2020-05-01", "annualSalary": 100, "status": "ACTIVE", "paymentType": "Salary" } # SalaryAndWage | +begin + #creates employee salary and wage record + result = api_instance.create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wage** | [**SalaryAndWage**](SalaryAndWage.md)| | + +### Return type + +[**SalaryAndWageObject**](SalaryAndWageObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employee_statutory_sick_leave + +> EmployeeStatutorySickLeaveObject create_employee_statutory_sick_leave(xero_tenant_id, employee_statutory_sick_leave) + +creates employee statutory sick leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_statutory_sick_leave = { "employeeID": "aad6b292-7b94-408b-93f6-e489867e3fb0", "leaveTypeID": "aab78802-e9d3-4bbd-bc87-df858054988f", "startDate": "2020-04-21", "endDate": "2020-04-24", "workPattern": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ], "isPregnancyRelated": false, "sufficientNotice": true } # EmployeeStatutorySickLeave | +begin + #creates employee statutory sick leave records + result = api_instance.create_employee_statutory_sick_leave(xero_tenant_id, employee_statutory_sick_leave) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employee_statutory_sick_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_statutory_sick_leave** | [**EmployeeStatutorySickLeave**](EmployeeStatutorySickLeave.md)| | + +### Return type + +[**EmployeeStatutorySickLeaveObject**](EmployeeStatutorySickLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employment + +> EmploymentObject create_employment(xero_tenant_id, employee_id, employment) + +creates employment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employment = { "PayrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "StartDate": "2020-04-01", "EmployeeNumber": "123ABC", "NICategory": "A" } # Employment | +begin + #creates employment + result = api_instance.create_employment(xero_tenant_id, employee_id, employment) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_employment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employment** | [**Employment**](Employment.md)| | + +### Return type + +[**EmploymentObject**](EmploymentObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_leave_type + +> LeaveTypeObject create_leave_type(xero_tenant_id, leave_type) + +create a new leave type + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_type = { "name": "My opebvwbfxf Leave", "isPaidLeave": false, "showOnPayslip": true } # LeaveType | +begin + #create a new leave type + result = api_instance.create_leave_type(xero_tenant_id, leave_type) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_type** | [**LeaveType**](LeaveType.md)| | + +### Return type + +[**LeaveTypeObject**](LeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_multiple_employee_earnings_template + +> EmployeePayTemplates create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + +creates multiple employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +earnings_template = [ { "ratePerUnit":20.0, "numberOfUnits":8.0, "earningsRateID":"87f5b43a-cf51-4b74-92de-94c819e82d27" }, { "ratePerUnit":20.0, "numberOfUnits":8.0, "earningsRateID":"973365f3-66b2-4c33-8ae6-14b75f78f68b" } ] # Array | +begin + #creates multiple employee earnings template records + result = api_instance.create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_multiple_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **earnings_template** | [**Array<EarningsTemplate>**](EarningsTemplate.md)| | + +### Return type + +[**EmployeePayTemplates**](EmployeePayTemplates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_pay_run_calendar + +> PayRunCalendarObject create_pay_run_calendar(xero_tenant_id, pay_run_calendar) + +create a new payrun calendar + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_calendar = { "name": "My Weekly Cal", "calendarType": "Weekly", "periodStartDate": "2020-05-01", "paymentDate": "2020-05-15" } # PayRunCalendar | +begin + #create a new payrun calendar + result = api_instance.create_pay_run_calendar(xero_tenant_id, pay_run_calendar) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_pay_run_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_calendar** | [**PayRunCalendar**](PayRunCalendar.md)| | + +### Return type + +[**PayRunCalendarObject**](PayRunCalendarObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_reimbursement + +> ReimbursementObject create_reimbursement(xero_tenant_id, reimbursement) + +create a new reimbursement + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +reimbursement = { "name": "My new Reimburse", "accountID": "9ee28149-32a9-4661-8eab-a28738696983" } # Reimbursement | +begin + #create a new reimbursement + result = api_instance.create_reimbursement(xero_tenant_id, reimbursement) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_reimbursement: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **reimbursement** | [**Reimbursement**](Reimbursement.md)| | + +### Return type + +[**ReimbursementObject**](ReimbursementObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_timesheet + +> TimesheetObject create_timesheet(xero_tenant_id, timesheet) + +create a new timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet = { "payrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "employeeID": "aad6b292-7b94-408b-93f6-e489867e3fb0", "startDate": "2020-04-13", "endDate": "2020-04-19", "timesheetLines": [ { "date": "2020-04-13", "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnits": 8 }, { "date": "2020-04-15", "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnits": 6 } ] } # Timesheet | +begin + #create a new timesheet + result = api_instance.create_timesheet(xero_tenant_id, timesheet) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet** | [**Timesheet**](Timesheet.md)| | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_timesheet_line + +> TimesheetLineObject create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line) + +create a new timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line = { "date": "2020-04-14", "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnits": 1 } # TimesheetLine | +begin + #create a new timesheet line + result = api_instance.create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->create_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line** | [**TimesheetLine**](TimesheetLine.md)| | + +### Return type + +[**TimesheetLineObject**](TimesheetLineObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_employee_earnings_template + +> delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id) + +deletes an employee earnings template record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +begin + #deletes an employee earnings template record + api_instance.delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id) +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->delete_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **pay_template_earning_id** | [**String**](.md)| Id for single pay template earnings object | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## delete_employee_leave + +> EmployeeLeaveObject delete_employee_leave(xero_tenant_id, employee_id, leave_id) + +deletes an employee leave record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314' # String | Leave id for single object +begin + #deletes an employee leave record + result = api_instance.delete_employee_leave(xero_tenant_id, employee_id, leave_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->delete_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_id** | [**String**](.md)| Leave id for single object | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_employee_salary_and_wage + +> delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + +deletes an employee salary and wages record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single salary and wages object +begin + #deletes an employee salary and wages record + api_instance.delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->delete_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single salary and wages object | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## delete_timesheet + +> TimesheetLine delete_timesheet(xero_tenant_id, timesheet_id) + +delete a timesheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #delete a timesheet + result = api_instance.delete_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->delete_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetLine**](TimesheetLine.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_timesheet_line + +> TimesheetLine delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id) + +delete a timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line_id = 'timesheet_line_id_example' # String | Identifier for the timesheet line +begin + #delete a timesheet line + result = api_instance.delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->delete_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line_id** | [**String**](.md)| Identifier for the timesheet line | + +### Return type + +[**TimesheetLine**](TimesheetLine.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_benefit + +> BenefitObject get_benefit(xero_tenant_id, id) + +retrieve a single benefit by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +id = 'id_example' # String | Identifier for the benefit +begin + #retrieve a single benefit by id + result = api_instance.get_benefit(xero_tenant_id, id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_benefit: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **id** | [**String**](.md)| Identifier for the benefit | + +### Return type + +[**BenefitObject**](BenefitObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_benefits + +> Benefits get_benefits(xero_tenant_id, opts) + +searches benefits + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches benefits + result = api_instance.get_benefits(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_benefits: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Benefits**](Benefits.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_deduction + +> DeductionObject get_deduction(xero_tenant_id, deduction_id) + +retrieve a single deduction by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +deduction_id = 'deduction_id_example' # String | Identifier for the deduction +begin + #retrieve a single deduction by id + result = api_instance.get_deduction(xero_tenant_id, deduction_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_deduction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **deduction_id** | [**String**](.md)| Identifier for the deduction | + +### Return type + +[**DeductionObject**](DeductionObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_deductions + +> Deductions get_deductions(xero_tenant_id, opts) + +searches deductions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches deductions + result = api_instance.get_deductions(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_deductions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Deductions**](Deductions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_order + +> EarningsOrderObject get_earnings_order(xero_tenant_id, id) + +retrieve a single deduction by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +id = 'id_example' # String | Identifier for the deduction +begin + #retrieve a single deduction by id + result = api_instance.get_earnings_order(xero_tenant_id, id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_earnings_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **id** | [**String**](.md)| Identifier for the deduction | + +### Return type + +[**EarningsOrderObject**](EarningsOrderObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_orders + +> EarningsOrders get_earnings_orders(xero_tenant_id, opts) + +searches earnings orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches earnings orders + result = api_instance.get_earnings_orders(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_earnings_orders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**EarningsOrders**](EarningsOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_rate + +> EarningsRateObject get_earnings_rate(xero_tenant_id, earnings_rate_id) + +retrieve a single earnings rates by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +earnings_rate_id = 'earnings_rate_id_example' # String | Identifier for the earnings rate +begin + #retrieve a single earnings rates by id + result = api_instance.get_earnings_rate(xero_tenant_id, earnings_rate_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_earnings_rate: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **earnings_rate_id** | [**String**](.md)| Identifier for the earnings rate | + +### Return type + +[**EarningsRateObject**](EarningsRateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_earnings_rates + +> EarningsRates get_earnings_rates(xero_tenant_id, opts) + +searches earnings rates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches earnings rates + result = api_instance.get_earnings_rates(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_earnings_rates: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**EarningsRates**](EarningsRates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee + +> EmployeeObject get_employee(xero_tenant_id, employee_id) + +searches employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employees + result = api_instance.get_employee(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave + +> EmployeeLeaveObject get_employee_leave(xero_tenant_id, employee_id, leave_id) + +retrieve a single employee leave record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314' # String | Leave id for single object +begin + #retrieve a single employee leave record + result = api_instance.get_employee_leave(xero_tenant_id, employee_id, leave_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_id** | [**String**](.md)| Leave id for single object | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_balances + +> EmployeeLeaveBalances get_employee_leave_balances(xero_tenant_id, employee_id) + +search employee leave balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #search employee leave balances + result = api_instance.get_employee_leave_balances(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_leave_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaveBalances**](EmployeeLeaveBalances.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_periods + +> LeavePeriods get_employee_leave_periods(xero_tenant_id, employee_id, opts) + +searches employee leave periods + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + start_date: Date.parse('2013-10-20'), # Date | Filter by start date + + end_date: Date.parse('Johnson') # Date | Filter by end date +} + +begin + #searches employee leave periods + result = api_instance.get_employee_leave_periods(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_leave_periods: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **start_date** | **Date**| Filter by start date | [optional] + **end_date** | **Date**| Filter by end date | [optional] + +### Return type + +[**LeavePeriods**](LeavePeriods.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leave_types + +> EmployeeLeaveTypes get_employee_leave_types(xero_tenant_id, employee_id) + +searches employee leave types + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employee leave types + result = api_instance.get_employee_leave_types(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_leave_types: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaveTypes**](EmployeeLeaveTypes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_leaves + +> EmployeeLeaves get_employee_leaves(xero_tenant_id, employee_id) + +search employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #search employee leave records + result = api_instance.get_employee_leaves(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_leaves: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeLeaves**](EmployeeLeaves.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_opening_balances + +> EmployeeOpeningBalancesObject get_employee_opening_balances(xero_tenant_id, employee_id) + +retrieve employee openingbalances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #retrieve employee openingbalances + result = api_instance.get_employee_opening_balances(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_opening_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeOpeningBalancesObject**](EmployeeOpeningBalancesObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_pay_template + +> EmployeePayTemplateObject get_employee_pay_template(xero_tenant_id, employee_id) + +searches employee pay templates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches employee pay templates + result = api_instance.get_employee_pay_template(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_pay_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeePayTemplateObject**](EmployeePayTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_payment_method + +> PaymentMethodObject get_employee_payment_method(xero_tenant_id, employee_id) + +retrieves an employee's payment method + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #retrieves an employee's payment method + result = api_instance.get_employee_payment_method(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_payment_method: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**PaymentMethodObject**](PaymentMethodObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_salary_and_wage + +> SalaryAndWages get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + +get employee salary and wages record by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +begin + #get employee salary and wages record by id + result = api_instance.get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single pay template earnings object | + +### Return type + +[**SalaryAndWages**](SalaryAndWages.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_salary_and_wages + +> SalaryAndWages get_employee_salary_and_wages(xero_tenant_id, employee_id, opts) + +retrieves an employee's salary and wages + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #retrieves an employee's salary and wages + result = api_instance.get_employee_salary_and_wages(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_salary_and_wages: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**SalaryAndWages**](SalaryAndWages.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_statutory_leave_balances + +> EmployeeStatutoryLeaveBalanceObject get_employee_statutory_leave_balances(xero_tenant_id, employee_id, opts) + +search employee leave balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + leave_type: 'sick', # String | Filter by the type of statutory leave + + as_of_date: Date.parse('2013-10-20') # Date | The date from which to calculate balance remaining. If not specified, current date UTC is used. +} + +begin + #search employee leave balances + result = api_instance.get_employee_statutory_leave_balances(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_statutory_leave_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_type** | **String**| Filter by the type of statutory leave | [optional] + **as_of_date** | **Date**| The date from which to calculate balance remaining. If not specified, current date UTC is used. | [optional] + +### Return type + +[**EmployeeStatutoryLeaveBalanceObject**](EmployeeStatutoryLeaveBalanceObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_statutory_sick_leave + +> EmployeeStatutorySickLeaveObject get_employee_statutory_sick_leave(xero_tenant_id, statutory_sick_leave_id) + +retrieve a statutory sick leave for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +statutory_sick_leave_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Statutory sick leave id for single object +begin + #retrieve a statutory sick leave for an employee + result = api_instance.get_employee_statutory_sick_leave(xero_tenant_id, statutory_sick_leave_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_statutory_sick_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **statutory_sick_leave_id** | [**String**](.md)| Statutory sick leave id for single object | + +### Return type + +[**EmployeeStatutorySickLeaveObject**](EmployeeStatutorySickLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_tax + +> EmployeeTaxObject get_employee_tax(xero_tenant_id, employee_id) + +searches tax records for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +begin + #searches tax records for an employee + result = api_instance.get_employee_tax(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employee_tax: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + +### Return type + +[**EmployeeTaxObject**](EmployeeTaxObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employees + +> Employees get_employees(xero_tenant_id, opts) + +searches employees + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + first_name: 'John', # String | Filter by first name + + last_name: 'Johnson', # String | Filter by last name + + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches employees + result = api_instance.get_employees(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **first_name** | **String**| Filter by first name | [optional] + **last_name** | **String**| Filter by last name | [optional] + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_type + +> LeaveTypeObject get_leave_type(xero_tenant_id, leave_type_id) + +retrieve a single leave type by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +leave_type_id = 'leave_type_id_example' # String | Identifier for the leave type +begin + #retrieve a single leave type by id + result = api_instance.get_leave_type(xero_tenant_id, leave_type_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_leave_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **leave_type_id** | [**String**](.md)| Identifier for the leave type | + +### Return type + +[**LeaveTypeObject**](LeaveTypeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_leave_types + +> LeaveTypes get_leave_types(xero_tenant_id, opts) + +searches leave types + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + active_only: true # Boolean | Filters leave types by active status. By default the API returns all leave types. +} + +begin + #searches leave types + result = api_instance.get_leave_types(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_leave_types: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **active_only** | **Boolean**| Filters leave types by active status. By default the API returns all leave types. | [optional] + +### Return type + +[**LeaveTypes**](LeaveTypes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run + +> PayRunObject get_pay_run(xero_tenant_id, pay_run_id) + +retrieve a single pay run by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | Identifier for the pay run +begin + #retrieve a single pay run by id + result = api_instance.get_pay_run(xero_tenant_id, pay_run_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| Identifier for the pay run | + +### Return type + +[**PayRunObject**](PayRunObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run_calendar + +> PayRunCalendarObject get_pay_run_calendar(xero_tenant_id, pay_run_calendar_id) + +retrieve a single payrun calendar by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_calendar_id = 'pay_run_calendar_id_example' # String | Identifier for the payrun calendars +begin + #retrieve a single payrun calendar by id + result = api_instance.get_pay_run_calendar(xero_tenant_id, pay_run_calendar_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_run_calendar: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_calendar_id** | [**String**](.md)| Identifier for the payrun calendars | + +### Return type + +[**PayRunCalendarObject**](PayRunCalendarObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_run_calendars + +> PayRunCalendars get_pay_run_calendars(xero_tenant_id, opts) + +searches payrun calendars + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches payrun calendars + result = api_instance.get_pay_run_calendars(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_run_calendars: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**PayRunCalendars**](PayRunCalendars.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_runs + +> PayRuns get_pay_runs(xero_tenant_id, opts) + +searches pay runs + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + status: 'status_example' # String | By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. +} + +begin + #searches pay runs + result = api_instance.get_pay_runs(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_runs: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **status** | **String**| By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. | [optional] + +### Return type + +[**PayRuns**](PayRuns.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_slip + +> PayslipObject get_pay_slip(xero_tenant_id, payslip_id) + +retrieve a single payslip by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +payslip_id = 'payslip_id_example' # String | Identifier for the payslip +begin + #retrieve a single payslip by id + result = api_instance.get_pay_slip(xero_tenant_id, payslip_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_slip: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payslip_id** | [**String**](.md)| Identifier for the payslip | + +### Return type + +[**PayslipObject**](PayslipObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_pay_slips + +> Payslips get_pay_slips(xero_tenant_id, pay_run_id, opts) + +searches payslips + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches payslips + result = api_instance.get_pay_slips(xero_tenant_id, pay_run_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_pay_slips: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Payslips**](Payslips.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_reimbursement + +> ReimbursementObject get_reimbursement(xero_tenant_id, reimbursement_id) + +retrieve a single reimbursement by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +reimbursement_id = 'reimbursement_id_example' # String | Identifier for the reimbursement +begin + #retrieve a single reimbursement by id + result = api_instance.get_reimbursement(xero_tenant_id, reimbursement_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_reimbursement: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **reimbursement_id** | [**String**](.md)| Identifier for the reimbursement | + +### Return type + +[**ReimbursementObject**](ReimbursementObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_reimbursements + +> Reimbursements get_reimbursements(xero_tenant_id, opts) + +searches reimbursements + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56 # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. +} + +begin + #searches reimbursements + result = api_instance.get_reimbursements(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_reimbursements: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + +### Return type + +[**Reimbursements**](Reimbursements.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_settings + +> Settings get_settings(xero_tenant_id) + +searches settings + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches settings + result = api_instance.get_settings(xero_tenant_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Settings**](Settings.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_statutory_leave_summary + +> EmployeeStatutoryLeavesSummaries get_statutory_leave_summary(xero_tenant_id, employee_id, opts) + +retrieve a summary of statutory leaves for an employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +opts = { + active_only: true # Boolean | Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned +} + +begin + #retrieve a summary of statutory leaves for an employee + result = api_instance.get_statutory_leave_summary(xero_tenant_id, employee_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_statutory_leave_summary: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **active_only** | **Boolean**| Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned | [optional] + +### Return type + +[**EmployeeStatutoryLeavesSummaries**](EmployeeStatutoryLeavesSummaries.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheet + +> TimesheetObject get_timesheet(xero_tenant_id, timesheet_id) + +retrieve a single timesheet by id + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #retrieve a single timesheet by id + result = api_instance.get_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_timesheets + +> Timesheets get_timesheets(xero_tenant_id, opts) + +searches timesheets + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 56, # Integer | Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + + employee_id: 'employee_id_example', # String | By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + + payroll_calendar_id: 'payroll_calendar_id_example' # String | By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id +} + +begin + #searches timesheets + result = api_instance.get_timesheets(xero_tenant_id, opts) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_timesheets: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. | [optional] + **employee_id** | [**String**](.md)| By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. | [optional] + **payroll_calendar_id** | [**String**](.md)| By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id | [optional] + +### Return type + +[**Timesheets**](Timesheets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tracking_categories + +> TrackingCategories get_tracking_categories(xero_tenant_id) + +searches tracking categories + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches tracking categories + result = api_instance.get_tracking_categories(xero_tenant_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->get_tracking_categories: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## revert_timesheet + +> TimesheetObject revert_timesheet(xero_tenant_id, timesheet_id) + +revert a timesheet to draft + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +begin + #revert a timesheet to draft + result = api_instance.revert_timesheet(xero_tenant_id, timesheet_id) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->revert_timesheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + +### Return type + +[**TimesheetObject**](TimesheetObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_employee + +> EmployeeObject update_employee(xero_tenant_id, employee_id, employee) + +updates employee + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee = { "title":"Mr", "firstName":"Mike", "lastName":"Johnllsbkrhwopson", "dateOfBirth":"1999-01-01", "address":{ "addressLine1":"101 Green St", "city":"San Francisco", "postCode":"6TGR4F", "country":"UK" }, "email":"84044@starkindustries.com", "gender":"M" } # Employee | +begin + #updates employee + result = api_instance.update_employee(xero_tenant_id, employee_id, employee) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee** | [**Employee**](Employee.md)| | + +### Return type + +[**EmployeeObject**](EmployeeObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_earnings_template + +> EarningsTemplateObject update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template) + +updates employee earnings template records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +earnings_template = { "ratePerUnit": 30, "numberOfUnits": 4, "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27" } # EarningsTemplate | +begin + #updates employee earnings template records + result = api_instance.update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_employee_earnings_template: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **pay_template_earning_id** | [**String**](.md)| Id for single pay template earnings object | + **earnings_template** | [**EarningsTemplate**](EarningsTemplate.md)| | + +### Return type + +[**EarningsTemplateObject**](EarningsTemplateObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_leave + +> EmployeeLeaveObject update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave) + +updates employee leave records + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314' # String | Leave id for single object +employee_leave = { "leaveTypeID": "ed08dffe-788e-4b24-9630-f0fa2f4d164c", "description": "Creating a Description", "startDate": "2020-04-24", "endDate": "2020-04-26", "periods": [ { "periodStartDate": "2020-04-20", "periodEndDate": "2020-04-26", "numberOfUnits": 1, "periodStatus": "Approved" } ] } # EmployeeLeave | +begin + #updates employee leave records + result = api_instance.update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_employee_leave: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **leave_id** | [**String**](.md)| Leave id for single object | + **employee_leave** | [**EmployeeLeave**](EmployeeLeave.md)| | + +### Return type + +[**EmployeeLeaveObject**](EmployeeLeaveObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_opening_balances + +> EmployeeOpeningBalancesObject update_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances) + +updates employee opening balances + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +employee_opening_balances = { "statutoryAdoptionPay": 20, "statutoryMaternityPay": 20, "statutoryPaternityPay": 20, "statutorySharedParentalPay": 20, "statutorySickPay": 20, "priorEmployeeNumber": 20 } # EmployeeOpeningBalances | +begin + #updates employee opening balances + result = api_instance.update_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_employee_opening_balances: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **employee_opening_balances** | [**EmployeeOpeningBalances**](EmployeeOpeningBalances.md)| | + +### Return type + +[**EmployeeOpeningBalancesObject**](EmployeeOpeningBalancesObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_employee_salary_and_wage + +> SalaryAndWageObject update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage) + +updates employee salary and wages record + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6' # String | Id for single pay template earnings object +salary_and_wage = { "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnitsPerWeek": 3, "ratePerUnit": 11, "effectiveFrom": "2020-05-15", "annualSalary": 101, "status": "ACTIVE", "paymentType": "Salary" } # SalaryAndWage | +begin + #updates employee salary and wages record + result = api_instance.update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_employee_salary_and_wage: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Employee id for single object | + **salary_and_wages_id** | [**String**](.md)| Id for single pay template earnings object | + **salary_and_wage** | [**SalaryAndWage**](SalaryAndWage.md)| | + +### Return type + +[**SalaryAndWageObject**](SalaryAndWageObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_pay_run + +> PayRunObject update_pay_run(xero_tenant_id, pay_run_id, pay_run) + +update a pay run + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +pay_run_id = 'pay_run_id_example' # String | Identifier for the pay run +pay_run = { "paymentDate": "2020-05-01" } # PayRun | +begin + #update a pay run + result = api_instance.update_pay_run(xero_tenant_id, pay_run_id, pay_run) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_pay_run: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **pay_run_id** | [**String**](.md)| Identifier for the pay run | + **pay_run** | [**PayRun**](PayRun.md)| | + +### Return type + +[**PayRunObject**](PayRunObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_timesheet_line + +> TimesheetLineObject update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line) + +update a timesheet line + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + + + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +timesheet_id = 'timesheet_id_example' # String | Identifier for the timesheet +timesheet_line_id = 'timesheet_line_id_example' # String | Identifier for the timesheet line +timesheet_line = { "date": "2020-04-14", "earningsRateID": "87f5b43a-cf51-4b74-92de-94c819e82d27", "numberOfUnits": 2 } # TimesheetLine | +begin + #update a timesheet line + result = api_instance.update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line) + p result +rescue XeroRuby::PayrollUk::ApiError => e + puts "Exception when calling PayrollUkApi->update_timesheet_line: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **timesheet_id** | [**String**](.md)| Identifier for the timesheet | + **timesheet_line_id** | [**String**](.md)| Identifier for the timesheet line | + **timesheet_line** | [**TimesheetLine**](TimesheetLine.md)| | + +### Return type + +[**TimesheetLineObject**](TimesheetLineObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/payroll_uk/Payslip.md b/docs/payroll_uk/Payslip.md new file mode 100644 index 00000000..143c4c47 --- /dev/null +++ b/docs/payroll_uk/Payslip.md @@ -0,0 +1,69 @@ +# XeroRuby::PayrollUk::Payslip + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_slip_id** | **String** | The Xero identifier for a Payslip | [optional] +**employee_id** | **String** | The Xero identifier for payroll employee | [optional] +**pay_run_id** | **String** | The Xero identifier for the associated payrun | [optional] +**last_edited** | **Date** | The date payslip was last updated | [optional] +**first_name** | **String** | Employee first name | [optional] +**last_name** | **String** | Employee last name | [optional] +**total_earnings** | **Float** | Total earnings before any deductions. Same as gross earnings for UK. | [optional] +**gross_earnings** | **Float** | Total earnings before any deductions. Same as total earnings for UK. | [optional] +**total_pay** | **Float** | The employee net pay | [optional] +**total_employer_taxes** | **Float** | The employer's tax obligation | [optional] +**total_employee_taxes** | **Float** | The part of an employee's earnings that is deducted for tax purposes | [optional] +**total_deductions** | **Float** | Total amount subtracted from an employee's earnings to reach total pay | [optional] +**total_reimbursements** | **Float** | Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment | [optional] +**total_court_orders** | **Float** | Total amounts required by law to subtract from the employee's earnings | [optional] +**total_benefits** | **Float** | Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries | [optional] +**bacs_hash** | **String** | BACS Service User Number | [optional] +**payment_method** | **String** | The payment method code | [optional] +**earnings_lines** | [**Array<EarningsLine>**](EarningsLine.md) | | [optional] +**leave_earnings_lines** | [**Array<LeaveEarningsLine>**](LeaveEarningsLine.md) | | [optional] +**timesheet_earnings_lines** | [**Array<TimesheetEarningsLine>**](TimesheetEarningsLine.md) | | [optional] +**deduction_lines** | [**Array<DeductionLine>**](DeductionLine.md) | | [optional] +**reimbursement_lines** | [**Array<ReimbursementLine>**](ReimbursementLine.md) | | [optional] +**leave_accrual_lines** | [**Array<LeaveAccrualLine>**](LeaveAccrualLine.md) | | [optional] +**benefit_lines** | [**Array<BenefitLine>**](BenefitLine.md) | | [optional] +**payment_lines** | [**Array<PaymentLine>**](PaymentLine.md) | | [optional] +**employee_tax_lines** | [**Array<TaxLine>**](TaxLine.md) | | [optional] +**court_order_lines** | [**Array<CourtOrderLine>**](CourtOrderLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Payslip.new(pay_slip_id: null, + employee_id: null, + pay_run_id: null, + last_edited: null, + first_name: null, + last_name: null, + total_earnings: null, + gross_earnings: null, + total_pay: null, + total_employer_taxes: null, + total_employee_taxes: null, + total_deductions: null, + total_reimbursements: null, + total_court_orders: null, + total_benefits: null, + bacs_hash: null, + payment_method: null, + earnings_lines: null, + leave_earnings_lines: null, + timesheet_earnings_lines: null, + deduction_lines: null, + reimbursement_lines: null, + leave_accrual_lines: null, + benefit_lines: null, + payment_lines: null, + employee_tax_lines: null, + court_order_lines: null) +``` + + diff --git a/docs/payroll_uk/PayslipObject.md b/docs/payroll_uk/PayslipObject.md new file mode 100644 index 00000000..e413b522 --- /dev/null +++ b/docs/payroll_uk/PayslipObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::PayslipObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_slip** | [**Payslip**](Payslip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::PayslipObject.new(pagination: null, + problem: null, + pay_slip: null) +``` + + diff --git a/docs/payroll_uk/Payslips.md b/docs/payroll_uk/Payslips.md new file mode 100644 index 00000000..5c762e87 --- /dev/null +++ b/docs/payroll_uk/Payslips.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Payslips + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**pay_slips** | [**Array<Payslip>**](Payslip.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Payslips.new(pagination: null, + problem: null, + pay_slips: null) +``` + + diff --git a/docs/payroll_uk/Problem.md b/docs/payroll_uk/Problem.md new file mode 100644 index 00000000..66843f9b --- /dev/null +++ b/docs/payroll_uk/Problem.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::Problem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The type of error format | [optional] +**title** | **String** | The type of the error | [optional] +**status** | **String** | The error status code | [optional] +**detail** | **String** | A description of the error | [optional] +**instance** | **String** | | [optional] +**invalid_fields** | [**Array<InvalidField>**](InvalidField.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Problem.new(type: application/problem+json, + title: BadRequest, + status: 400, + detail: Validation error occurred., + instance: null, + invalid_fields: null) +``` + + diff --git a/docs/payroll_uk/Reimbursement.md b/docs/payroll_uk/Reimbursement.md new file mode 100644 index 00000000..6ad49fa4 --- /dev/null +++ b/docs/payroll_uk/Reimbursement.md @@ -0,0 +1,23 @@ +# XeroRuby::PayrollUk::Reimbursement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_id** | **String** | Xero unique identifier for a reimbursement | [optional] +**name** | **String** | Name of the reimbursement | +**account_id** | **String** | Xero unique identifier for the account used for the reimbursement | +**current_record** | **Boolean** | Indicates that whether the reimbursement is active | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Reimbursement.new(reimbursement_id: null, + name: null, + account_id: null, + current_record: null) +``` + + diff --git a/docs/payroll_uk/ReimbursementLine.md b/docs/payroll_uk/ReimbursementLine.md new file mode 100644 index 00000000..a8d29977 --- /dev/null +++ b/docs/payroll_uk/ReimbursementLine.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::ReimbursementLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reimbursement_type_id** | **String** | Xero identifier for payroll reimbursement | [optional] +**description** | **String** | Reimbursement line description | [optional] +**amount** | **BigDecimal** | Reimbursement amount | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::ReimbursementLine.new(reimbursement_type_id: null, + description: null, + amount: null) +``` + + diff --git a/docs/payroll_uk/ReimbursementObject.md b/docs/payroll_uk/ReimbursementObject.md new file mode 100644 index 00000000..1f78b9f6 --- /dev/null +++ b/docs/payroll_uk/ReimbursementObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::ReimbursementObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**reimbursement** | [**Reimbursement**](Reimbursement.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::ReimbursementObject.new(pagination: null, + problem: null, + reimbursement: null) +``` + + diff --git a/docs/payroll_uk/Reimbursements.md b/docs/payroll_uk/Reimbursements.md new file mode 100644 index 00000000..66220b78 --- /dev/null +++ b/docs/payroll_uk/Reimbursements.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Reimbursements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**reimbursements** | [**Array<Reimbursement>**](Reimbursement.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Reimbursements.new(pagination: null, + problem: null, + reimbursements: null) +``` + + diff --git a/docs/payroll_uk/SalaryAndWage.md b/docs/payroll_uk/SalaryAndWage.md new file mode 100644 index 00000000..199d2057 --- /dev/null +++ b/docs/payroll_uk/SalaryAndWage.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollUk::SalaryAndWage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**salary_and_wages_id** | **String** | Xero unique identifier for a salary and wages record | [optional] +**earnings_rate_id** | **String** | Xero unique identifier for an earnings rate | +**number_of_units_per_week** | **Float** | The Number of Units per week for the corresponding salary and wages | +**rate_per_unit** | **Float** | The rate of each unit for the corresponding salary and wages | [optional] +**number_of_units_per_day** | **Float** | The Number of Units per day for the corresponding salary and wages | [optional] +**effective_from** | **Date** | The effective date of the corresponding salary and wages | +**annual_salary** | **Float** | The annual salary | +**status** | **String** | The current status of the corresponding salary and wages | +**payment_type** | **String** | The type of the payment of the corresponding salary and wages | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::SalaryAndWage.new(salary_and_wages_id: null, + earnings_rate_id: null, + number_of_units_per_week: null, + rate_per_unit: null, + number_of_units_per_day: null, + effective_from: null, + annual_salary: null, + status: null, + payment_type: null) +``` + + diff --git a/docs/payroll_uk/SalaryAndWageObject.md b/docs/payroll_uk/SalaryAndWageObject.md new file mode 100644 index 00000000..38726cfb --- /dev/null +++ b/docs/payroll_uk/SalaryAndWageObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::SalaryAndWageObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**salary_and_wages** | [**SalaryAndWage**](SalaryAndWage.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::SalaryAndWageObject.new(pagination: null, + problem: null, + salary_and_wages: null) +``` + + diff --git a/docs/payroll_uk/SalaryAndWages.md b/docs/payroll_uk/SalaryAndWages.md new file mode 100644 index 00000000..45c47c65 --- /dev/null +++ b/docs/payroll_uk/SalaryAndWages.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::SalaryAndWages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**salary_and_wages** | [**Array<SalaryAndWage>**](SalaryAndWage.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::SalaryAndWages.new(pagination: null, + problem: null, + salary_and_wages: null) +``` + + diff --git a/docs/payroll_uk/Settings.md b/docs/payroll_uk/Settings.md new file mode 100644 index 00000000..92399a58 --- /dev/null +++ b/docs/payroll_uk/Settings.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**settings** | [**Accounts**](Accounts.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Settings.new(pagination: null, + problem: null, + settings: null) +``` + + diff --git a/docs/payroll_uk/StatutoryDeduction.md b/docs/payroll_uk/StatutoryDeduction.md new file mode 100644 index 00000000..3a8371fb --- /dev/null +++ b/docs/payroll_uk/StatutoryDeduction.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::StatutoryDeduction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The Xero identifier for earnings order | [optional] +**name** | **String** | Name of the earnings order | [optional] +**statutory_deduction_category** | [**StatutoryDeductionCategory**](StatutoryDeductionCategory.md) | | [optional] +**liability_account_id** | **String** | Xero identifier for Liability Account | [optional] +**current_record** | **Boolean** | Identifier of a record is active or not. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::StatutoryDeduction.new(id: null, + name: null, + statutory_deduction_category: null, + liability_account_id: null, + current_record: null) +``` + + diff --git a/docs/payroll_uk/StatutoryDeductionCategory.md b/docs/payroll_uk/StatutoryDeductionCategory.md new file mode 100644 index 00000000..449ce9a8 --- /dev/null +++ b/docs/payroll_uk/StatutoryDeductionCategory.md @@ -0,0 +1,16 @@ +# XeroRuby::PayrollUk::StatutoryDeductionCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::StatutoryDeductionCategory.new() +``` + + diff --git a/docs/payroll_uk/TaxLine.md b/docs/payroll_uk/TaxLine.md new file mode 100644 index 00000000..04edffe9 --- /dev/null +++ b/docs/payroll_uk/TaxLine.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::TaxLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tax_line_id** | **String** | Xero identifier for payroll tax line | [optional] +**description** | **String** | Tax line description | [optional] +**is_employer_tax** | **Boolean** | Identifies if the amount is paid for by the employee or employer. True if employer pays the tax | [optional] +**amount** | **Float** | The amount of the tax line | [optional] +**global_tax_type_id** | **String** | Tax type ID | [optional] +**manual_adjustment** | **Boolean** | Identifies if the tax line is a manual adjustment | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TaxLine.new(tax_line_id: null, + description: null, + is_employer_tax: null, + amount: null, + global_tax_type_id: null, + manual_adjustment: null) +``` + + diff --git a/docs/payroll_uk/Timesheet.md b/docs/payroll_uk/Timesheet.md new file mode 100644 index 00000000..4d0fc15d --- /dev/null +++ b/docs/payroll_uk/Timesheet.md @@ -0,0 +1,33 @@ +# XeroRuby::PayrollUk::Timesheet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheet_id** | **String** | The Xero identifier for a Timesheet | [optional] +**payroll_calendar_id** | **String** | The Xero identifier for the Payroll Calandar that the Timesheet applies to | +**employee_id** | **String** | The Xero identifier for the Employee that the Timesheet is for | +**start_date** | **Date** | The Start Date of the Timesheet period (YYYY-MM-DD) | +**end_date** | **Date** | The End Date of the Timesheet period (YYYY-MM-DD) | +**status** | **String** | Status of the timesheet | [optional] +**total_hours** | **Float** | The Total Hours of the Timesheet | [optional] +**updated_date_utc** | **DateTime** | The UTC date time that the Timesheet was last updated | [optional] +**timesheet_lines** | [**Array<TimesheetLine>**](TimesheetLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Timesheet.new(timesheet_id: null, + payroll_calendar_id: null, + employee_id: null, + start_date: null, + end_date: null, + status: null, + total_hours: null, + updated_date_utc: null, + timesheet_lines: null) +``` + + diff --git a/docs/payroll_uk/TimesheetEarningsLine.md b/docs/payroll_uk/TimesheetEarningsLine.md new file mode 100644 index 00000000..e2d26f05 --- /dev/null +++ b/docs/payroll_uk/TimesheetEarningsLine.md @@ -0,0 +1,27 @@ +# XeroRuby::PayrollUk::TimesheetEarningsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earnings_rate_id** | **String** | Xero identifier for payroll timesheet earnings rate | [optional] +**rate_per_unit** | **Float** | Rate per unit for timesheet earnings line | [optional] +**number_of_units** | **Float** | Timesheet earnings number of units | [optional] +**fixed_amount** | **Float** | Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed | [optional] +**amount** | **Float** | The amount of the timesheet earnings line. | [optional] +**is_linked_to_timesheet** | **Boolean** | Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TimesheetEarningsLine.new(earnings_rate_id: null, + rate_per_unit: null, + number_of_units: null, + fixed_amount: null, + amount: null, + is_linked_to_timesheet: null) +``` + + diff --git a/docs/payroll_uk/TimesheetLine.md b/docs/payroll_uk/TimesheetLine.md new file mode 100644 index 00000000..c003b148 --- /dev/null +++ b/docs/payroll_uk/TimesheetLine.md @@ -0,0 +1,25 @@ +# XeroRuby::PayrollUk::TimesheetLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timesheet_line_id** | **String** | The Xero identifier for a Timesheet Line | [optional] +**date** | **Date** | The Date that this Timesheet Line is for (YYYY-MM-DD) | +**earnings_rate_id** | **String** | The Xero identifier for the Earnings Rate that the Timesheet is for | +**tracking_item_id** | **String** | The Xero identifier for the Tracking Item that the Timesheet is for | [optional] +**number_of_units** | **Float** | The Number of Units of the Timesheet Line | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TimesheetLine.new(timesheet_line_id: null, + date: null, + earnings_rate_id: null, + tracking_item_id: null, + number_of_units: null) +``` + + diff --git a/docs/payroll_uk/TimesheetLineObject.md b/docs/payroll_uk/TimesheetLineObject.md new file mode 100644 index 00000000..1bb49555 --- /dev/null +++ b/docs/payroll_uk/TimesheetLineObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::TimesheetLineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheet_line** | [**TimesheetLine**](TimesheetLine.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TimesheetLineObject.new(pagination: null, + problem: null, + timesheet_line: null) +``` + + diff --git a/docs/payroll_uk/TimesheetObject.md b/docs/payroll_uk/TimesheetObject.md new file mode 100644 index 00000000..14aa082e --- /dev/null +++ b/docs/payroll_uk/TimesheetObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::TimesheetObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheet** | [**Timesheet**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TimesheetObject.new(pagination: null, + problem: null, + timesheet: null) +``` + + diff --git a/docs/payroll_uk/Timesheets.md b/docs/payroll_uk/Timesheets.md new file mode 100644 index 00000000..b50915ff --- /dev/null +++ b/docs/payroll_uk/Timesheets.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::Timesheets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**timesheets** | [**Array<Timesheet>**](Timesheet.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::Timesheets.new(pagination: null, + problem: null, + timesheets: null) +``` + + diff --git a/docs/payroll_uk/TrackingCategories.md b/docs/payroll_uk/TrackingCategories.md new file mode 100644 index 00000000..50f67062 --- /dev/null +++ b/docs/payroll_uk/TrackingCategories.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollUk::TrackingCategories + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**tracking_categories** | [**TrackingCategory**](TrackingCategory.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TrackingCategories.new(pagination: null, + problem: null, + tracking_categories: null) +``` + + diff --git a/docs/payroll_uk/TrackingCategory.md b/docs/payroll_uk/TrackingCategory.md new file mode 100644 index 00000000..340114ac --- /dev/null +++ b/docs/payroll_uk/TrackingCategory.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollUk::TrackingCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_groups_tracking_category_id** | **String** | The Xero identifier for Employee groups tracking category. | [optional] +**timesheet_tracking_category_id** | **String** | The Xero identifier for Timesheet tracking category. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollUk' + +instance = XeroRuby::PayrollUk::TrackingCategory.new(employee_groups_tracking_category_id: null, + timesheet_tracking_category_id: null) +``` + + diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md index 94cbb7a2..72688935 100644 --- a/docs/projects/ProjectApi.md +++ b/docs/projects/ProjectApi.md @@ -44,13 +44,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -112,13 +110,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -182,13 +178,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -251,13 +245,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -319,13 +311,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -393,13 +383,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -476,13 +464,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -546,13 +532,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -625,13 +609,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -725,13 +707,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -795,13 +775,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -864,13 +842,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant @@ -933,13 +909,11 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# depending on the methods you need to use -# accounting_api -api_instance = xero_client.accounting_api -# :assets_api -api_instance = xero_client.asset_api -# :projects_api -api_instance = xero_client.projects_api +# You need to namespace your api method call to one of the following api sets +# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api] + +api_instance = xero_client. + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index 90613116..56e9f687 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,6 +17,282 @@ require 'xero-ruby/configuration' # Models +require 'xero-ruby/models/payroll_uk/account' +require 'xero-ruby/models/payroll_uk/accounts' +require 'xero-ruby/models/payroll_uk/address' +require 'xero-ruby/models/payroll_uk/bank_account' +require 'xero-ruby/models/payroll_uk/benefit' +require 'xero-ruby/models/payroll_uk/benefit_line' +require 'xero-ruby/models/payroll_uk/benefit_object' +require 'xero-ruby/models/payroll_uk/benefits' +require 'xero-ruby/models/payroll_uk/court_order_line' +require 'xero-ruby/models/payroll_uk/deduction' +require 'xero-ruby/models/payroll_uk/deduction_line' +require 'xero-ruby/models/payroll_uk/deduction_object' +require 'xero-ruby/models/payroll_uk/deductions' +require 'xero-ruby/models/payroll_uk/earnings_line' +require 'xero-ruby/models/payroll_uk/earnings_order' +require 'xero-ruby/models/payroll_uk/earnings_order_object' +require 'xero-ruby/models/payroll_uk/earnings_orders' +require 'xero-ruby/models/payroll_uk/earnings_rate' +require 'xero-ruby/models/payroll_uk/earnings_rate_object' +require 'xero-ruby/models/payroll_uk/earnings_rates' +require 'xero-ruby/models/payroll_uk/earnings_template' +require 'xero-ruby/models/payroll_uk/earnings_template_object' +require 'xero-ruby/models/payroll_uk/employee' +require 'xero-ruby/models/payroll_uk/employee_leave' +require 'xero-ruby/models/payroll_uk/employee_leave_balance' +require 'xero-ruby/models/payroll_uk/employee_leave_balances' +require 'xero-ruby/models/payroll_uk/employee_leave_object' +require 'xero-ruby/models/payroll_uk/employee_leave_type' +require 'xero-ruby/models/payroll_uk/employee_leave_type_object' +require 'xero-ruby/models/payroll_uk/employee_leave_types' +require 'xero-ruby/models/payroll_uk/employee_leaves' +require 'xero-ruby/models/payroll_uk/employee_object' +require 'xero-ruby/models/payroll_uk/employee_opening_balances' +require 'xero-ruby/models/payroll_uk/employee_opening_balances_object' +require 'xero-ruby/models/payroll_uk/employee_pay_template' +require 'xero-ruby/models/payroll_uk/employee_pay_template_object' +require 'xero-ruby/models/payroll_uk/employee_pay_templates' +require 'xero-ruby/models/payroll_uk/employee_statutory_leave_balance' +require 'xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object' +require 'xero-ruby/models/payroll_uk/employee_statutory_leave_summary' +require 'xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries' +require 'xero-ruby/models/payroll_uk/employee_statutory_sick_leave' +require 'xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object' +require 'xero-ruby/models/payroll_uk/employee_statutory_sick_leaves' +require 'xero-ruby/models/payroll_uk/employee_tax' +require 'xero-ruby/models/payroll_uk/employee_tax_object' +require 'xero-ruby/models/payroll_uk/employees' +require 'xero-ruby/models/payroll_uk/employment' +require 'xero-ruby/models/payroll_uk/employment_object' +require 'xero-ruby/models/payroll_uk/invalid_field' +require 'xero-ruby/models/payroll_uk/leave_accrual_line' +require 'xero-ruby/models/payroll_uk/leave_earnings_line' +require 'xero-ruby/models/payroll_uk/leave_period' +require 'xero-ruby/models/payroll_uk/leave_periods' +require 'xero-ruby/models/payroll_uk/leave_type' +require 'xero-ruby/models/payroll_uk/leave_type_object' +require 'xero-ruby/models/payroll_uk/leave_types' +require 'xero-ruby/models/payroll_uk/pagination' +require 'xero-ruby/models/payroll_uk/pay_run' +require 'xero-ruby/models/payroll_uk/pay_run_calendar' +require 'xero-ruby/models/payroll_uk/pay_run_calendar_object' +require 'xero-ruby/models/payroll_uk/pay_run_calendars' +require 'xero-ruby/models/payroll_uk/pay_run_object' +require 'xero-ruby/models/payroll_uk/pay_runs' +require 'xero-ruby/models/payroll_uk/payment_line' +require 'xero-ruby/models/payroll_uk/payment_method' +require 'xero-ruby/models/payroll_uk/payment_method_object' +require 'xero-ruby/models/payroll_uk/payslip' +require 'xero-ruby/models/payroll_uk/payslip_object' +require 'xero-ruby/models/payroll_uk/payslips' +require 'xero-ruby/models/payroll_uk/problem' +require 'xero-ruby/models/payroll_uk/reimbursement' +require 'xero-ruby/models/payroll_uk/reimbursement_line' +require 'xero-ruby/models/payroll_uk/reimbursement_object' +require 'xero-ruby/models/payroll_uk/reimbursements' +require 'xero-ruby/models/payroll_uk/salary_and_wage' +require 'xero-ruby/models/payroll_uk/salary_and_wage_object' +require 'xero-ruby/models/payroll_uk/salary_and_wages' +require 'xero-ruby/models/payroll_uk/settings' +require 'xero-ruby/models/payroll_uk/statutory_deduction' +require 'xero-ruby/models/payroll_uk/statutory_deduction_category' +require 'xero-ruby/models/payroll_uk/tax_line' +require 'xero-ruby/models/payroll_uk/timesheet' +require 'xero-ruby/models/payroll_uk/timesheet_earnings_line' +require 'xero-ruby/models/payroll_uk/timesheet_line' +require 'xero-ruby/models/payroll_uk/timesheet_line_object' +require 'xero-ruby/models/payroll_uk/timesheet_object' +require 'xero-ruby/models/payroll_uk/timesheets' +require 'xero-ruby/models/payroll_uk/tracking_categories' +require 'xero-ruby/models/payroll_uk/tracking_category' +require 'xero-ruby/models/payroll_nz/account' +require 'xero-ruby/models/payroll_nz/accounts' +require 'xero-ruby/models/payroll_nz/address' +require 'xero-ruby/models/payroll_nz/bank_account' +require 'xero-ruby/models/payroll_nz/benefit' +require 'xero-ruby/models/payroll_nz/deduction' +require 'xero-ruby/models/payroll_nz/deduction_line' +require 'xero-ruby/models/payroll_nz/deduction_object' +require 'xero-ruby/models/payroll_nz/deductions' +require 'xero-ruby/models/payroll_nz/earnings_line' +require 'xero-ruby/models/payroll_nz/earnings_order' +require 'xero-ruby/models/payroll_nz/earnings_order_object' +require 'xero-ruby/models/payroll_nz/earnings_orders' +require 'xero-ruby/models/payroll_nz/earnings_rate' +require 'xero-ruby/models/payroll_nz/earnings_rate_object' +require 'xero-ruby/models/payroll_nz/earnings_rates' +require 'xero-ruby/models/payroll_nz/earnings_template' +require 'xero-ruby/models/payroll_nz/earnings_template_object' +require 'xero-ruby/models/payroll_nz/employee' +require 'xero-ruby/models/payroll_nz/employee_earnings_templates' +require 'xero-ruby/models/payroll_nz/employee_leave' +require 'xero-ruby/models/payroll_nz/employee_leave_balance' +require 'xero-ruby/models/payroll_nz/employee_leave_balances' +require 'xero-ruby/models/payroll_nz/employee_leave_object' +require 'xero-ruby/models/payroll_nz/employee_leave_setup' +require 'xero-ruby/models/payroll_nz/employee_leave_setup_object' +require 'xero-ruby/models/payroll_nz/employee_leave_type' +require 'xero-ruby/models/payroll_nz/employee_leave_type_object' +require 'xero-ruby/models/payroll_nz/employee_leave_types' +require 'xero-ruby/models/payroll_nz/employee_leaves' +require 'xero-ruby/models/payroll_nz/employee_object' +require 'xero-ruby/models/payroll_nz/employee_opening_balance' +require 'xero-ruby/models/payroll_nz/employee_opening_balances_object' +require 'xero-ruby/models/payroll_nz/employee_pay_template' +require 'xero-ruby/models/payroll_nz/employee_pay_template_object' +require 'xero-ruby/models/payroll_nz/employee_pay_templates' +require 'xero-ruby/models/payroll_nz/employee_statutory_leave_balance' +require 'xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object' +require 'xero-ruby/models/payroll_nz/employee_statutory_leave_summary' +require 'xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries' +require 'xero-ruby/models/payroll_nz/employee_statutory_sick_leave' +require 'xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object' +require 'xero-ruby/models/payroll_nz/employee_statutory_sick_leaves' +require 'xero-ruby/models/payroll_nz/employee_tax' +require 'xero-ruby/models/payroll_nz/employee_tax_object' +require 'xero-ruby/models/payroll_nz/employees' +require 'xero-ruby/models/payroll_nz/employment' +require 'xero-ruby/models/payroll_nz/employment_object' +require 'xero-ruby/models/payroll_nz/gross_earnings_history' +require 'xero-ruby/models/payroll_nz/invalid_field' +require 'xero-ruby/models/payroll_nz/leave_accrual_line' +require 'xero-ruby/models/payroll_nz/leave_earnings_line' +require 'xero-ruby/models/payroll_nz/leave_period' +require 'xero-ruby/models/payroll_nz/leave_periods' +require 'xero-ruby/models/payroll_nz/leave_type' +require 'xero-ruby/models/payroll_nz/leave_type_object' +require 'xero-ruby/models/payroll_nz/leave_types' +require 'xero-ruby/models/payroll_nz/pagination' +require 'xero-ruby/models/payroll_nz/pay_run' +require 'xero-ruby/models/payroll_nz/pay_run_calendar' +require 'xero-ruby/models/payroll_nz/pay_run_calendar_object' +require 'xero-ruby/models/payroll_nz/pay_run_calendars' +require 'xero-ruby/models/payroll_nz/pay_run_object' +require 'xero-ruby/models/payroll_nz/pay_runs' +require 'xero-ruby/models/payroll_nz/pay_slip' +require 'xero-ruby/models/payroll_nz/pay_slip_object' +require 'xero-ruby/models/payroll_nz/pay_slips' +require 'xero-ruby/models/payroll_nz/payment_line' +require 'xero-ruby/models/payroll_nz/payment_method' +require 'xero-ruby/models/payroll_nz/payment_method_object' +require 'xero-ruby/models/payroll_nz/problem' +require 'xero-ruby/models/payroll_nz/reimbursement' +require 'xero-ruby/models/payroll_nz/reimbursement_line' +require 'xero-ruby/models/payroll_nz/reimbursement_object' +require 'xero-ruby/models/payroll_nz/reimbursements' +require 'xero-ruby/models/payroll_nz/salary_and_wage' +require 'xero-ruby/models/payroll_nz/salary_and_wage_object' +require 'xero-ruby/models/payroll_nz/salary_and_wages' +require 'xero-ruby/models/payroll_nz/settings' +require 'xero-ruby/models/payroll_nz/statutory_deduction' +require 'xero-ruby/models/payroll_nz/statutory_deduction_category' +require 'xero-ruby/models/payroll_nz/statutory_deduction_line' +require 'xero-ruby/models/payroll_nz/statutory_deduction_object' +require 'xero-ruby/models/payroll_nz/statutory_deductions' +require 'xero-ruby/models/payroll_nz/superannuation_line' +require 'xero-ruby/models/payroll_nz/superannuation_object' +require 'xero-ruby/models/payroll_nz/superannuations' +require 'xero-ruby/models/payroll_nz/tax_code' +require 'xero-ruby/models/payroll_nz/tax_line' +require 'xero-ruby/models/payroll_nz/tax_settings' +require 'xero-ruby/models/payroll_nz/timesheet' +require 'xero-ruby/models/payroll_nz/timesheet_earnings_line' +require 'xero-ruby/models/payroll_nz/timesheet_line' +require 'xero-ruby/models/payroll_nz/timesheet_line_object' +require 'xero-ruby/models/payroll_nz/timesheet_object' +require 'xero-ruby/models/payroll_nz/timesheets' +require 'xero-ruby/models/payroll_nz/tracking_categories' +require 'xero-ruby/models/payroll_nz/tracking_category' +require 'xero-ruby/models/payroll_au/api_exception' +require 'xero-ruby/models/payroll_au/account' +require 'xero-ruby/models/payroll_au/account_type' +require 'xero-ruby/models/payroll_au/allowance_type' +require 'xero-ruby/models/payroll_au/bank_account' +require 'xero-ruby/models/payroll_au/calendar_type' +require 'xero-ruby/models/payroll_au/deduction_line' +require 'xero-ruby/models/payroll_au/deduction_type' +require 'xero-ruby/models/payroll_au/deduction_type_calculation_type' +require 'xero-ruby/models/payroll_au/earnings_line' +require 'xero-ruby/models/payroll_au/earnings_rate' +require 'xero-ruby/models/payroll_au/earnings_rate_calculation_type' +require 'xero-ruby/models/payroll_au/earnings_type' +require 'xero-ruby/models/payroll_au/employee' +require 'xero-ruby/models/payroll_au/employee_status' +require 'xero-ruby/models/payroll_au/employees' +require 'xero-ruby/models/payroll_au/employment_basis' +require 'xero-ruby/models/payroll_au/employment_termination_payment_type' +require 'xero-ruby/models/payroll_au/entitlement_final_pay_payout_type' +require 'xero-ruby/models/payroll_au/home_address' +require 'xero-ruby/models/payroll_au/leave_accrual_line' +require 'xero-ruby/models/payroll_au/leave_application' +require 'xero-ruby/models/payroll_au/leave_applications' +require 'xero-ruby/models/payroll_au/leave_balance' +require 'xero-ruby/models/payroll_au/leave_earnings_line' +require 'xero-ruby/models/payroll_au/leave_line' +require 'xero-ruby/models/payroll_au/leave_line_calculation_type' +require 'xero-ruby/models/payroll_au/leave_lines' +require 'xero-ruby/models/payroll_au/leave_period' +require 'xero-ruby/models/payroll_au/leave_period_status' +require 'xero-ruby/models/payroll_au/leave_type' +require 'xero-ruby/models/payroll_au/leave_type_contribution_type' +require 'xero-ruby/models/payroll_au/manual_tax_type' +require 'xero-ruby/models/payroll_au/opening_balances' +require 'xero-ruby/models/payroll_au/pay_item' +require 'xero-ruby/models/payroll_au/pay_items' +require 'xero-ruby/models/payroll_au/pay_run' +require 'xero-ruby/models/payroll_au/pay_run_status' +require 'xero-ruby/models/payroll_au/pay_runs' +require 'xero-ruby/models/payroll_au/pay_template' +require 'xero-ruby/models/payroll_au/payment_frequency_type' +require 'xero-ruby/models/payroll_au/payroll_calendar' +require 'xero-ruby/models/payroll_au/payroll_calendars' +require 'xero-ruby/models/payroll_au/payslip' +require 'xero-ruby/models/payroll_au/payslip_lines' +require 'xero-ruby/models/payroll_au/payslip_object' +require 'xero-ruby/models/payroll_au/payslip_summary' +require 'xero-ruby/models/payroll_au/payslips' +require 'xero-ruby/models/payroll_au/rate_type' +require 'xero-ruby/models/payroll_au/reimbursement_line' +require 'xero-ruby/models/payroll_au/reimbursement_lines' +require 'xero-ruby/models/payroll_au/reimbursement_type' +require 'xero-ruby/models/payroll_au/residency_status' +require 'xero-ruby/models/payroll_au/settings' +require 'xero-ruby/models/payroll_au/settings_object' +require 'xero-ruby/models/payroll_au/settings_tracking_categories' +require 'xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups' +require 'xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories' +require 'xero-ruby/models/payroll_au/state' +require 'xero-ruby/models/payroll_au/super_fund' +require 'xero-ruby/models/payroll_au/super_fund_product' +require 'xero-ruby/models/payroll_au/super_fund_products' +require 'xero-ruby/models/payroll_au/super_fund_type' +require 'xero-ruby/models/payroll_au/super_funds' +require 'xero-ruby/models/payroll_au/super_line' +require 'xero-ruby/models/payroll_au/super_membership' +require 'xero-ruby/models/payroll_au/superannuation_calculation_type' +require 'xero-ruby/models/payroll_au/superannuation_contribution_type' +require 'xero-ruby/models/payroll_au/superannuation_line' +require 'xero-ruby/models/payroll_au/tfn_exemption_type' +require 'xero-ruby/models/payroll_au/tax_declaration' +require 'xero-ruby/models/payroll_au/tax_line' +require 'xero-ruby/models/payroll_au/timesheet' +require 'xero-ruby/models/payroll_au/timesheet_line' +require 'xero-ruby/models/payroll_au/timesheet_object' +require 'xero-ruby/models/payroll_au/timesheet_status' +require 'xero-ruby/models/payroll_au/timesheets' +require 'xero-ruby/models/payroll_au/validation_error' +require 'xero-ruby/models/files/association' +require 'xero-ruby/models/files/file_object' +require 'xero-ruby/models/files/file_response204' +require 'xero-ruby/models/files/files' +require 'xero-ruby/models/files/folder' +require 'xero-ruby/models/files/folders' +require 'xero-ruby/models/files/inline_object' +require 'xero-ruby/models/files/object_group' +require 'xero-ruby/models/files/object_type' +require 'xero-ruby/models/files/user' require 'xero-ruby/models/projects/amount' require 'xero-ruby/models/projects/charge_type' require 'xero-ruby/models/projects/currency_code' @@ -52,6 +328,8 @@ require 'xero-ruby/models/accounting/accounts' require 'xero-ruby/models/accounting/accounts_payable' require 'xero-ruby/models/accounting/accounts_receivable' +require 'xero-ruby/models/accounting/action' +require 'xero-ruby/models/accounting/actions' require 'xero-ruby/models/accounting/address' require 'xero-ruby/models/accounting/allocation' require 'xero-ruby/models/accounting/allocations' @@ -163,6 +441,10 @@ require 'xero-ruby/models/accounting/validation_error' # APIs +require 'xero-ruby/api/payroll_uk_api' +require 'xero-ruby/api/payroll_nz_api' +require 'xero-ruby/api/payroll_au_api' +require 'xero-ruby/api/files_api' require 'xero-ruby/api/project_api' require 'xero-ruby/api/asset_api' require 'xero-ruby/api/accounting_api' diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 68339bb4..13a09553 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -2559,6 +2559,88 @@ def create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, return data, status_code, headers end + # Allows you to create history record for a manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Xero generated unique identifier for a manual journal + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_manual_journal_history_record(xero_tenant_id, manual_journal_id, history_records, opts = {}) + data, _status_code, _headers = create_manual_journal_history_record_with_http_info(xero_tenant_id, manual_journal_id, history_records, opts) + data + end + + # Allows you to create history record for a manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Xero generated unique identifier for a manual journal + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_manual_journal_history_record_with_http_info(xero_tenant_id, manual_journal_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journal_history_record ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journal_history_record" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.create_manual_journal_history_record" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_manual_journal_history_record" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/History'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_manual_journal_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Allows you to create one or more manual journals # @param xero_tenant_id [String] Xero identifier for Tenant # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request @@ -3285,6 +3367,94 @@ def create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, hist return data, status_code, headers end + # Allows you to create Attachment on Purchase Order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body, opts = {}) + data, _status_code, _headers = create_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, body, opts) + data + end + + # Allows you to create Attachment on Purchase Order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_order_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.create_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_purchase_order_attachment_by_file_name" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Allows you to create HistoryRecord for purchase orders # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_order_id [String] Unique identifier for a PurchaseOrder @@ -10131,35 +10301,35 @@ def get_manual_journals_with_http_info(xero_tenant_id, opts = {}) return data, status_code, headers end - # Allows you to retrieve a URL to an online invoice + # Allows you to retrieve history from a manual journal # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice + # @param manual_journal_id [String] Xero generated unique identifier for a manual journal # @param [Hash] opts the optional parameters - # @return [OnlineInvoices] - def get_online_invoice(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts) + # @return [HistoryRecords] + def get_manual_journals_history(xero_tenant_id, manual_journal_id, opts = {}) + data, _status_code, _headers = get_manual_journals_history_with_http_info(xero_tenant_id, manual_journal_id, opts) data end - # Allows you to retrieve a URL to an online invoice + # Allows you to retrieve history from a manual journal # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice + # @param manual_journal_id [String] Xero generated unique identifier for a manual journal # @param [Hash] opts the optional parameters - # @return [Array<(OnlineInvoices, Integer, Hash)>] OnlineInvoices data, response status code and response headers - def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_manual_journals_history_with_http_info(xero_tenant_id, manual_journal_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_online_invoice ...' + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journals_history ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_online_invoice" + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journals_history" end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_online_invoice" + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journals_history" end # resource path - local_var_path = '/Invoices/{InvoiceID}/OnlineInvoice'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + local_var_path = '/ManualJournals/{ManualJournalID}/History'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? @@ -10184,7 +10354,7 @@ def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) post_body = opts[:body] # return_type - return_type = opts[:return_type] || 'OnlineInvoices' + return_type = opts[:return_type] || 'HistoryRecords' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] @@ -10200,40 +10370,40 @@ def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_online_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journals_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + # Allows you to retrieve a URL to an online invoice # @param xero_tenant_id [String] Xero identifier for Tenant - # @param organisation_id [String] The unique Xero identifier for an organisation + # @param invoice_id [String] Unique identifier for an Invoice # @param [Hash] opts the optional parameters - # @return [CISOrgSetting] - def get_organisation_cis_settings(xero_tenant_id, organisation_id, opts = {}) - data, _status_code, _headers = get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts) + # @return [OnlineInvoices] + def get_online_invoice(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts) data end - # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + # Allows you to retrieve a URL to an online invoice # @param xero_tenant_id [String] Xero identifier for Tenant - # @param organisation_id [String] The unique Xero identifier for an organisation + # @param invoice_id [String] Unique identifier for an Invoice # @param [Hash] opts the optional parameters - # @return [Array<(CISOrgSetting, Integer, Hash)>] CISOrgSetting data, response status code and response headers - def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts = {}) + # @return [Array<(OnlineInvoices, Integer, Hash)>] OnlineInvoices data, response status code and response headers + def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_cis_settings ...' + @api_client.config.logger.debug 'Calling API: AccountingApi.get_online_invoice ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisation_cis_settings" + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_online_invoice" end - # verify the required parameter 'organisation_id' is set - if @api_client.config.client_side_validation && organisation_id.nil? - fail ArgumentError, "Missing the required parameter 'organisation_id' when calling AccountingApi.get_organisation_cis_settings" + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_online_invoice" end # resource path - local_var_path = '/Organisation/{OrganisationID}/CISSettings'.sub('{' + 'OrganisationID' + '}', organisation_id.to_s) + local_var_path = '/Invoices/{InvoiceID}/OnlineInvoice'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? @@ -10258,7 +10428,7 @@ def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id post_body = opts[:body] # return_type - return_type = opts[:return_type] || 'CISOrgSetting' + return_type = opts[:return_type] || 'OnlineInvoices' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] @@ -10274,34 +10444,34 @@ def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_organisation_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AccountingApi#get_online_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Allows you to retrieve Organisation details + # Retrieve a list of the key actions your app has permission to perform in the connected organisation. # @param xero_tenant_id [String] Xero identifier for Tenant # @param [Hash] opts the optional parameters - # @return [Organisations] - def get_organisations(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_organisations_with_http_info(xero_tenant_id, opts) + # @return [Actions] + def get_organisation_actions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_organisation_actions_with_http_info(xero_tenant_id, opts) data end - # Allows you to retrieve Organisation details + # Retrieve a list of the key actions your app has permission to perform in the connected organisation. # @param xero_tenant_id [String] Xero identifier for Tenant # @param [Hash] opts the optional parameters - # @return [Array<(Organisations, Integer, Hash)>] Organisations data, response status code and response headers - def get_organisations_with_http_info(xero_tenant_id, opts = {}) + # @return [Array<(Actions, Integer, Hash)>] Actions data, response status code and response headers + def get_organisation_actions_with_http_info(xero_tenant_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisations ...' + @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_actions ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisations" + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisation_actions" end # resource path - local_var_path = '/Organisation' + local_var_path = '/Organisation/Actions' # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? @@ -10326,7 +10496,7 @@ def get_organisations_with_http_info(xero_tenant_id, opts = {}) post_body = opts[:body] # return_type - return_type = opts[:return_type] || 'Organisations' + return_type = opts[:return_type] || 'Actions' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] @@ -10342,40 +10512,40 @@ def get_organisations_with_http_info(xero_tenant_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_organisations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AccountingApi#get_organisation_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Allows you to retrieve a specified overpayments + # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment + # @param organisation_id [String] The unique Xero identifier for an organisation # @param [Hash] opts the optional parameters - # @return [Overpayments] - def get_overpayment(xero_tenant_id, overpayment_id, opts = {}) - data, _status_code, _headers = get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts) + # @return [CISOrgSetting] + def get_organisation_cis_settings(xero_tenant_id, organisation_id, opts = {}) + data, _status_code, _headers = get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts) data end - # Allows you to retrieve a specified overpayments + # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment + # @param organisation_id [String] The unique Xero identifier for an organisation # @param [Hash] opts the optional parameters - # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers - def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) + # @return [Array<(CISOrgSetting, Integer, Hash)>] CISOrgSetting data, response status code and response headers + def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment ...' + @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_cis_settings ...' end # verify the required parameter 'xero_tenant_id' is set if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment" + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisation_cis_settings" end - # verify the required parameter 'overpayment_id' is set - if @api_client.config.client_side_validation && overpayment_id.nil? - fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment" + # verify the required parameter 'organisation_id' is set + if @api_client.config.client_side_validation && organisation_id.nil? + fail ArgumentError, "Missing the required parameter 'organisation_id' when calling AccountingApi.get_organisation_cis_settings" end # resource path - local_var_path = '/Overpayments/{OverpaymentID}'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + local_var_path = '/Organisation/{OrganisationID}/CISSettings'.sub('{' + 'OrganisationID' + '}', organisation_id.to_s) # camelize keys of incoming `where` opts opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? @@ -10400,7 +10570,7 @@ def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) post_body = opts[:body] # return_type - return_type = opts[:return_type] || 'Overpayments' + return_type = opts[:return_type] || 'CISOrgSetting' # auth_names auth_names = opts[:auth_names] || ['OAuth2'] @@ -10416,22 +10586,164 @@ def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_overpayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AccountingApi#get_organisation_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Allows you to retrieve a history records of an Overpayment + # Allows you to retrieve Organisation details # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_overpayment_history(xero_tenant_id, overpayment_id, opts = {}) - data, _status_code, _headers = get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts) + # @return [Organisations] + def get_organisations(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_organisations_with_http_info(xero_tenant_id, opts) data end - # Allows you to retrieve a history records of an Overpayment + # Allows you to retrieve Organisation details + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Organisations, Integer, Hash)>] Organisations data, response status code and response headers + def get_organisations_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisations" + end + # resource path + local_var_path = '/Organisation' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Organisations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_organisations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [Overpayments] + def get_overpayment(xero_tenant_id, overpayment_id, opts = {}) + data, _status_code, _headers = get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts) + data + end + + # Allows you to retrieve a specified overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers + def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment" + end + # verify the required parameter 'overpayment_id' is set + if @api_client.config.client_side_validation && overpayment_id.nil? + fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment" + end + # resource path + local_var_path = '/Overpayments/{OverpaymentID}'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Overpayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_overpayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_overpayment_history(xero_tenant_id, overpayment_id, opts = {}) + data, _status_code, _headers = get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts) + data + end + + # Allows you to retrieve a history records of an Overpayment # @param xero_tenant_id [String] Xero identifier for Tenant # @param overpayment_id [String] Unique identifier for a Overpayment # @param [Hash] opts the optional parameters @@ -11253,6 +11565,254 @@ def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, return data, status_code, headers end + # Allows you to retrieve Attachment on a Purchase Order by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachment on a Purchase Order by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_purchase_order_attachment_by_file_name" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specific Attachment on purchase order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_purchase_order_attachment_by_id(xero_tenant_id, purchase_order_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_purchase_order_attachment_by_id_with_http_info(xero_tenant_id, purchase_order_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve specific Attachment on purchase order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_purchase_order_attachment_by_id_with_http_info(xero_tenant_id, purchase_order_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_attachment_by_id" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_purchase_order_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_purchase_order_attachment_by_id" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve attachments for purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Orders object + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_purchase_order_attachments(xero_tenant_id, purchase_order_id, opts = {}) + data, _status_code, _headers = get_purchase_order_attachments_with_http_info(xero_tenant_id, purchase_order_id, opts) + data + end + + # Allows you to retrieve attachments for purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Orders object + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_purchase_order_attachments_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_attachments" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_attachments" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/Attachments'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Allows you to retrieve a specified purchase orders # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_order_number [String] Unique identifier for a PurchaseOrder @@ -16506,6 +17066,94 @@ def update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purc return data, status_code, headers end + # Allows you to update Attachment on Purchase Order by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body, opts = {}) + data, _status_code, _headers = update_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, body, opts) + data + end + + # Allows you to update Attachment on Purchase Order by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for Purchase Order object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, purchase_order_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_purchase_order_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.update_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_purchase_order_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_purchase_order_attachment_by_file_name" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Allows you to update a specified quote # @param xero_tenant_id [String] Xero identifier for Tenant # @param quote_id [String] Unique identifier for an Quote diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index 6498cf1c..f9c27636 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/files_api.rb b/lib/xero-ruby/api/files_api.rb new file mode 100644 index 00000000..fd53df2c --- /dev/null +++ b/lib/xero-ruby/api/files_api.rb @@ -0,0 +1,1273 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class FilesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.new) + @api_client = api_client + end + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @option opts [Association] :association + # @return [Association] + def create_file_association(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = create_file_association_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @option opts [Association] :association + # @return [Array<(Association, Integer, Hash)>] Association data, response status code and response headers + def create_file_association_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.create_file_association ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.create_file_association" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.create_file_association" + end + # resource path + local_var_path = '/Files/{FileId}/Associations'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'association']) + + # return_type + return_type = opts[:return_type] || 'Association' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#create_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new folder + # By passing in the appropriate properties, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Folder] :folder + # @return [Folder] + def create_folder(xero_tenant_id, opts = {}) + data, _status_code, _headers = create_folder_with_http_info(xero_tenant_id, opts) + data + end + + # create a new folder + # By passing in the appropriate properties, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Folder] :folder + # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers + def create_folder_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.create_folder ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.create_folder" + end + # resource path + local_var_path = '/Folders' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'folder']) + + # return_type + return_type = opts[:return_type] || 'Folder' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a file + # Delete a specific file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + def delete_file(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = delete_file_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # delete a file + # Delete a specific file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(FileResponse204, Integer, Hash)>] FileResponse204 data, response status code and response headers + def delete_file_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.delete_file ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_file" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.delete_file" + end + # resource path + local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'FileResponse204' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param object_id [String] Object id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + def delete_file_association(xero_tenant_id, file_id, object_id, opts = {}) + data, _status_code, _headers = delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, opts) + data + end + + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param object_id [String] Object id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(FileResponse204, Integer, Hash)>] FileResponse204 data, response status code and response headers + def delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.delete_file_association ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_file_association" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.delete_file_association" + end + # verify the required parameter 'object_id' is set + if @api_client.config.client_side_validation && object_id.nil? + fail ArgumentError, "Missing the required parameter 'object_id' when calling FilesApi.delete_file_association" + end + # resource path + local_var_path = '/Files/{FileId}/Associations/{ObjectId}'.sub('{' + 'FileId' + '}', file_id.to_s).sub('{' + 'ObjectId' + '}', object_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'FileResponse204' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#delete_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a folder + # By passing in the appropriate ID, you can delete a folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + def delete_folder(xero_tenant_id, folder_id, opts = {}) + data, _status_code, _headers = delete_folder_with_http_info(xero_tenant_id, folder_id, opts) + data + end + + # delete a folder + # By passing in the appropriate ID, you can delete a folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(FileResponse204, Integer, Hash)>] FileResponse204 data, response status code and response headers + def delete_folder_with_http_info(xero_tenant_id, folder_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.delete_folder ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_folder" + end + # verify the required parameter 'folder_id' is set + if @api_client.config.client_side_validation && folder_id.nil? + fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.delete_folder" + end + # resource path + local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'FileResponse204' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param object_id [String] Object id for single object + # @param [Hash] opts the optional parameters + # @return [Array] + def get_associations_by_object(xero_tenant_id, object_id, opts = {}) + data, _status_code, _headers = get_associations_by_object_with_http_info(xero_tenant_id, object_id, opts) + data + end + + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param object_id [String] Object id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_associations_by_object_with_http_info(xero_tenant_id, object_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_associations_by_object ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_associations_by_object" + end + # verify the required parameter 'object_id' is set + if @api_client.config.client_side_validation && object_id.nil? + fail ArgumentError, "Missing the required parameter 'object_id' when calling FilesApi.get_associations_by_object" + end + # resource path + local_var_path = '/Associations/{ObjectId}'.sub('{' + 'ObjectId' + '}', object_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_associations_by_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for file by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [FileObject] + def get_file(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = get_file_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # searches for file by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers + def get_file_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_file ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file" + end + # resource path + local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'FileObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [Array] + def get_file_associations(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = get_file_associations_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_file_associations_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_file_associations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file_associations" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file_associations" + end + # resource path + local_var_path = '/Files/{FileId}/Associations'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_file_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches files to retrieve the data + # By passing in the appropriate options, retrieve data for specific file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [File] + def get_file_content(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = get_file_content_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # searches files to retrieve the data + # By passing in the appropriate options, retrieve data for specific file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_file_content_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_file_content ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file_content" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file_content" + end + # resource path + local_var_path = '/Files/{FileId}/Content'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_file_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :pagesize pass an optional page size value + # @option opts [Integer] :page number of records to skip for pagination + # @option opts [String] :sort values to sort by + # @return [Files] + def get_files(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_files_with_http_info(xero_tenant_id, opts) + data + end + + # searches files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :pagesize pass an optional page size value + # @option opts [Integer] :page number of records to skip for pagination + # @option opts [String] :sort values to sort by + # @return [Array<(Files, Integer, Hash)>] Files data, response status code and response headers + def get_files_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_files ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_files" + end + if @api_client.config.client_side_validation && !opts[:'pagesize'].nil? && opts[:'pagesize'] > 100 + fail ArgumentError, 'invalid value for "opts[:"pagesize"]" when calling FilesApi.get_files, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FilesApi.get_files, must be greater than or equal to 1.' + end + + allowable_values = ["Name", "Size", "CreatedDateUTC"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/Files' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Files' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches specific folder by id + # By passing in the appropriate ID, you can search for specific folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param [Hash] opts the optional parameters + # @return [Folder] + def get_folder(xero_tenant_id, folder_id, opts = {}) + data, _status_code, _headers = get_folder_with_http_info(xero_tenant_id, folder_id, opts) + data + end + + # searches specific folder by id + # By passing in the appropriate ID, you can search for specific folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers + def get_folder_with_http_info(xero_tenant_id, folder_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_folder ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_folder" + end + # verify the required parameter 'folder_id' is set + if @api_client.config.client_side_validation && folder_id.nil? + fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.get_folder" + end + # resource path + local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Folder' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches folder + # By passing in the appropriate options, you can search for available folders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :sort values to sort by + # @return [Array] + def get_folders(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_folders_with_http_info(xero_tenant_id, opts) + data + end + + # searches folder + # By passing in the appropriate options, you can search for available folders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :sort values to sort by + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_folders_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_folders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_folders" + end + allowable_values = ["Name", "Size", "CreatedDateUTC"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/Folders' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches inbox folder + # Search for the user inbox + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Folder] + def get_inbox(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_inbox_with_http_info(xero_tenant_id, opts) + data + end + + # searches inbox folder + # Search for the user inbox + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers + def get_inbox_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.get_inbox ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_inbox" + end + # resource path + local_var_path = '/Inbox' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Folder' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#get_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a file + # Update properties on a single file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @option opts [FileObject] :file_object + # @return [FileObject] + def update_file(xero_tenant_id, file_id, opts = {}) + data, _status_code, _headers = update_file_with_http_info(xero_tenant_id, file_id, opts) + data + end + + # Update a file + # Update properties on a single file + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param file_id [String] File id for single object + # @param [Hash] opts the optional parameters + # @option opts [FileObject] :file_object + # @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers + def update_file_with_http_info(xero_tenant_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.update_file ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.update_file" + end + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.update_file" + end + # resource path + local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'file_object']) + + # return_type + return_type = opts[:return_type] || 'FileObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#update_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update folder + # By passing in the appropriate ID and properties, you can update a folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param folder [Folder] + # @param [Hash] opts the optional parameters + # @return [Folder] + def update_folder(xero_tenant_id, folder_id, folder, opts = {}) + data, _status_code, _headers = update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts) + data + end + + # update folder + # By passing in the appropriate ID and properties, you can update a folder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param folder_id [String] Folder id for single object + # @param folder [Folder] + # @param [Hash] opts the optional parameters + # @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers + def update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.update_folder ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.update_folder" + end + # verify the required parameter 'folder_id' is set + if @api_client.config.client_side_validation && folder_id.nil? + fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.update_folder" + end + # verify the required parameter 'folder' is set + if @api_client.config.client_side_validation && folder.nil? + fail ArgumentError, "Missing the required parameter 'folder' when calling FilesApi.update_folder" + end + # resource path + local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(folder) + + # return_type + return_type = opts[:return_type] || 'Folder' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # upload an File + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :folder_id pass an optional folder id to save file to specific folder + # @option opts [String] :body + # @option opts [String] :name exact name of the file you are uploading + # @option opts [String] :filename + # @option opts [String] :mime_type + # @return [FileObject] + def upload_file(xero_tenant_id, opts = {}) + data, _status_code, _headers = upload_file_with_http_info(xero_tenant_id, opts) + data + end + + # upload an File + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :folder_id pass an optional folder id to save file to specific folder + # @option opts [String] :body + # @option opts [String] :name exact name of the file you are uploading + # @option opts [String] :filename + # @option opts [String] :mime_type + # @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers + def upload_file_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FilesApi.upload_file ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.upload_file" + end + # resource path + local_var_path = '/Files' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'folderId'] = opts[:'folder_id'] if !opts[:'folder_id'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + form_params['body'] = opts[:'body'] if !opts[:'body'].nil? + form_params['name'] = opts[:'name'] if !opts[:'name'].nil? + form_params['filename'] = opts[:'filename'] if !opts[:'filename'].nil? + form_params['mimeType'] = opts[:'mime_type'] if !opts[:'mime_type'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'FileObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FilesApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api/payroll_au_api.rb b/lib/xero-ruby/api/payroll_au_api.rb new file mode 100644 index 00000000..8a9badc8 --- /dev/null +++ b/lib/xero-ruby/api/payroll_au_api.rb @@ -0,0 +1,2256 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class PayrollAuApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.new) + @api_client = api_client + end + # Use this method to create a payroll employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Array] + # @param [Hash] opts the optional parameters + # @return [Employees] + def create_employee(xero_tenant_id, employee, opts = {}) + data, _status_code, _headers = create_employee_with_http_info(xero_tenant_id, employee, opts) + data + end + + # Use this method to create a payroll employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_employee" + end + # verify the required parameter 'employee' is set + if @api_client.config.client_side_validation && employee.nil? + fail ArgumentError, "Missing the required parameter 'employee' when calling PayrollAuApi.create_employee" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee) + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a Leave Application + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application [Array] + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + def create_leave_application(xero_tenant_id, leave_application, opts = {}) + data, _status_code, _headers = create_leave_application_with_http_info(xero_tenant_id, leave_application, opts) + data + end + + # Use this method to create a Leave Application + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveApplications, Integer, Hash)>] LeaveApplications data, response status code and response headers + def create_leave_application_with_http_info(xero_tenant_id, leave_application, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_leave_application ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_leave_application" + end + # verify the required parameter 'leave_application' is set + if @api_client.config.client_side_validation && leave_application.nil? + fail ArgumentError, "Missing the required parameter 'leave_application' when calling PayrollAuApi.create_leave_application" + end + # resource path + local_var_path = '/LeaveApplications' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(leave_application) + + # return_type + return_type = opts[:return_type] || 'LeaveApplications' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a Pay Item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_item [PayItem] + # @param [Hash] opts the optional parameters + # @return [PayItems] + def create_pay_item(xero_tenant_id, pay_item, opts = {}) + data, _status_code, _headers = create_pay_item_with_http_info(xero_tenant_id, pay_item, opts) + data + end + + # Use this method to create a Pay Item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_item [PayItem] + # @param [Hash] opts the optional parameters + # @return [Array<(PayItems, Integer, Hash)>] PayItems data, response status code and response headers + def create_pay_item_with_http_info(xero_tenant_id, pay_item, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_pay_item ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_pay_item" + end + # verify the required parameter 'pay_item' is set + if @api_client.config.client_side_validation && pay_item.nil? + fail ArgumentError, "Missing the required parameter 'pay_item' when calling PayrollAuApi.create_pay_item" + end + # resource path + local_var_path = '/PayItems' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_item) + + # return_type + return_type = opts[:return_type] || 'PayItems' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_pay_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a PayRun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run [Array] + # @param [Hash] opts the optional parameters + # @return [PayRuns] + def create_pay_run(xero_tenant_id, pay_run, opts = {}) + data, _status_code, _headers = create_pay_run_with_http_info(xero_tenant_id, pay_run, opts) + data + end + + # Use this method to create a PayRun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def create_pay_run_with_http_info(xero_tenant_id, pay_run, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_pay_run" + end + # verify the required parameter 'pay_run' is set + if @api_client.config.client_side_validation && pay_run.nil? + fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollAuApi.create_pay_run" + end + # resource path + local_var_path = '/PayRuns' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run) + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar [Array] + # @param [Hash] opts the optional parameters + # @return [PayrollCalendars] + def create_payroll_calendar(xero_tenant_id, payroll_calendar, opts = {}) + data, _status_code, _headers = create_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar, opts) + data + end + + # Use this method to create a Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(PayrollCalendars, Integer, Hash)>] PayrollCalendars data, response status code and response headers + def create_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_payroll_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_payroll_calendar" + end + # verify the required parameter 'payroll_calendar' is set + if @api_client.config.client_side_validation && payroll_calendar.nil? + fail ArgumentError, "Missing the required parameter 'payroll_calendar' when calling PayrollAuApi.create_payroll_calendar" + end + # resource path + local_var_path = '/PayrollCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payroll_calendar) + + # return_type + return_type = opts[:return_type] || 'PayrollCalendars' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_payroll_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a super fund + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund [Array] + # @param [Hash] opts the optional parameters + # @return [SuperFunds] + def create_superfund(xero_tenant_id, super_fund, opts = {}) + data, _status_code, _headers = create_superfund_with_http_info(xero_tenant_id, super_fund, opts) + data + end + + # Use this method to create a super fund + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(SuperFunds, Integer, Hash)>] SuperFunds data, response status code and response headers + def create_superfund_with_http_info(xero_tenant_id, super_fund, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_superfund ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_superfund" + end + # verify the required parameter 'super_fund' is set + if @api_client.config.client_side_validation && super_fund.nil? + fail ArgumentError, "Missing the required parameter 'super_fund' when calling PayrollAuApi.create_superfund" + end + # resource path + local_var_path = '/Superfunds' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(super_fund) + + # return_type + return_type = opts[:return_type] || 'SuperFunds' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to create a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Array] + # @param [Hash] opts the optional parameters + # @return [Timesheets] + def create_timesheet(xero_tenant_id, timesheet, opts = {}) + data, _status_code, _headers = create_timesheet_with_http_info(xero_tenant_id, timesheet, opts) + data + end + + # Use this method to create a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers + def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.create_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.create_timesheet" + end + # verify the required parameter 'timesheet' is set + if @api_client.config.client_side_validation && timesheet.nil? + fail ArgumentError, "Missing the required parameter 'timesheet' when calling PayrollAuApi.create_timesheet" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet) + + # return_type + return_type = opts[:return_type] || 'Timesheets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an employee by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Employees] + def get_employee(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches for an employee by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollAuApi.get_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 employees will be returned in a single API call + # @return [Employees] + def get_employees(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts) + data + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 employees will be returned in a single API call + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employees_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_employees" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an Leave Application by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application_id [String] Leave Application id for single object + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + def get_leave_application(xero_tenant_id, leave_application_id, opts = {}) + data, _status_code, _headers = get_leave_application_with_http_info(xero_tenant_id, leave_application_id, opts) + data + end + + # searches for an Leave Application by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application_id [String] Leave Application id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveApplications, Integer, Hash)>] LeaveApplications data, response status code and response headers + def get_leave_application_with_http_info(xero_tenant_id, leave_application_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_leave_application ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_leave_application" + end + # verify the required parameter 'leave_application_id' is set + if @api_client.config.client_side_validation && leave_application_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_application_id' when calling PayrollAuApi.get_leave_application" + end + # resource path + local_var_path = '/LeaveApplications/{LeaveApplicationId}'.sub('{' + 'LeaveApplicationId' + '}', leave_application_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveApplications' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches Leave Applications + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [LeaveApplications] + def get_leave_applications(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_leave_applications_with_http_info(xero_tenant_id, opts) + data + end + + # searches Leave Applications + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [Array<(LeaveApplications, Integer, Hash)>] LeaveApplications data, response status code and response headers + def get_leave_applications_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_leave_applications ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_leave_applications" + end + # resource path + local_var_path = '/LeaveApplications' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveApplications' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_leave_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches Pay Items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [PayItems] + def get_pay_items(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_items_with_http_info(xero_tenant_id, opts) + data + end + + # searches Pay Items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [Array<(PayItems, Integer, Hash)>] PayItems data, response status code and response headers + def get_pay_items_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_pay_items ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_pay_items" + end + # resource path + local_var_path = '/PayItems' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayItems' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an payrun by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayRun id for single object + # @param [Hash] opts the optional parameters + # @return [PayRuns] + def get_pay_run(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # searches for an payrun by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayRun id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollAuApi.get_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches PayRuns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + # @return [PayRuns] + def get_pay_runs(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_runs_with_http_info(xero_tenant_id, opts) + data + end + + # searches PayRuns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_pay_runs ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_pay_runs" + end + # resource path + local_var_path = '/PayRuns' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar_id [String] Payroll Calendar id for single object + # @param [Hash] opts the optional parameters + # @return [PayrollCalendars] + def get_payroll_calendar(xero_tenant_id, payroll_calendar_id, opts = {}) + data, _status_code, _headers = get_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opts) + data + end + + # searches Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar_id [String] Payroll Calendar id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(PayrollCalendars, Integer, Hash)>] PayrollCalendars data, response status code and response headers + def get_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_payroll_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_payroll_calendar" + end + # verify the required parameter 'payroll_calendar_id' is set + if @api_client.config.client_side_validation && payroll_calendar_id.nil? + fail ArgumentError, "Missing the required parameter 'payroll_calendar_id' when calling PayrollAuApi.get_payroll_calendar" + end + # resource path + local_var_path = '/PayrollCalendars/{PayrollCalendarID}'.sub('{' + 'PayrollCalendarID' + '}', payroll_calendar_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayrollCalendars' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_payroll_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [PayrollCalendars] + def get_payroll_calendars(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_payroll_calendars_with_http_info(xero_tenant_id, opts) + data + end + + # searches Payroll Calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [Array<(PayrollCalendars, Integer, Hash)>] PayrollCalendars data, response status code and response headers + def get_payroll_calendars_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_payroll_calendars ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_payroll_calendars" + end + # resource path + local_var_path = '/PayrollCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayrollCalendars' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_payroll_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an payslip by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Payslip id for single object + # @param [Hash] opts the optional parameters + # @return [PayslipObject] + def get_payslip(xero_tenant_id, payslip_id, opts = {}) + data, _status_code, _headers = get_payslip_with_http_info(xero_tenant_id, payslip_id, opts) + data + end + + # searches for an payslip by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Payslip id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(PayslipObject, Integer, Hash)>] PayslipObject data, response status code and response headers + def get_payslip_with_http_info(xero_tenant_id, payslip_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_payslip ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_payslip" + end + # verify the required parameter 'payslip_id' is set + if @api_client.config.client_side_validation && payslip_id.nil? + fail ArgumentError, "Missing the required parameter 'payslip_id' when calling PayrollAuApi.get_payslip" + end + # resource path + local_var_path = '/Payslip/{PayslipID}'.sub('{' + 'PayslipID' + '}', payslip_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayslipObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_payslip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [SettingsObject] + def get_settings(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_settings_with_http_info(xero_tenant_id, opts) + data + end + + # retrieve settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(SettingsObject, Integer, Hash)>] SettingsObject data, response status code and response headers + def get_settings_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_settings" + end + # resource path + local_var_path = '/Settings' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SettingsObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an Superfund by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund_id [String] Superfund id for single object + # @param [Hash] opts the optional parameters + # @return [SuperFunds] + def get_superfund(xero_tenant_id, super_fund_id, opts = {}) + data, _status_code, _headers = get_superfund_with_http_info(xero_tenant_id, super_fund_id, opts) + data + end + + # searches for an Superfund by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund_id [String] Superfund id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(SuperFunds, Integer, Hash)>] SuperFunds data, response status code and response headers + def get_superfund_with_http_info(xero_tenant_id, super_fund_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_superfund ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_superfund" + end + # verify the required parameter 'super_fund_id' is set + if @api_client.config.client_side_validation && super_fund_id.nil? + fail ArgumentError, "Missing the required parameter 'super_fund_id' when calling PayrollAuApi.get_superfund" + end + # resource path + local_var_path = '/Superfunds/{SuperFundID}'.sub('{' + 'SuperFundID' + '}', super_fund_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SuperFunds' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches SuperfundProducts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :abn The ABN of the Regulated SuperFund + # @option opts [String] :usi The USI of the Regulated SuperFund + # @return [SuperFundProducts] + def get_superfund_products(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_superfund_products_with_http_info(xero_tenant_id, opts) + data + end + + # searches SuperfundProducts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :abn The ABN of the Regulated SuperFund + # @option opts [String] :usi The USI of the Regulated SuperFund + # @return [Array<(SuperFundProducts, Integer, Hash)>] SuperFundProducts data, response status code and response headers + def get_superfund_products_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_superfund_products ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_superfund_products" + end + # resource path + local_var_path = '/SuperfundProducts' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'ABN'] = opts[:'abn'] if !opts[:'abn'].nil? + query_params[:'USI'] = opts[:'usi'] if !opts[:'usi'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SuperFundProducts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_superfund_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches SuperFunds + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + # @return [SuperFunds] + def get_superfunds(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_superfunds_with_http_info(xero_tenant_id, opts) + data + end + + # searches SuperFunds + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + # @return [Array<(SuperFunds, Integer, Hash)>] SuperFunds data, response status code and response headers + def get_superfunds_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_superfunds ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_superfunds" + end + # resource path + local_var_path = '/Superfunds' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SuperFunds' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_superfunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for an timesheet by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Timesheet id for single object + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def get_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # searches for an timesheet by unique id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Timesheet id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollAuApi.get_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + # @return [Timesheets] + def get_timesheets(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts) + data + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + # @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers + def get_timesheets_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.get_timesheets ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.get_timesheets" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Timesheets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an Employee + # Update properties on a single employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :employee + # @return [Employees] + def update_employee(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = update_employee_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # Update an Employee + # Update properties on a single employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :employee + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def update_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollAuApi.update_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'employee']) + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Use this method to update a Leave Application + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application_id [String] Leave Application id for single object + # @param leave_application [Array] + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + def update_leave_application(xero_tenant_id, leave_application_id, leave_application, opts = {}) + data, _status_code, _headers = update_leave_application_with_http_info(xero_tenant_id, leave_application_id, leave_application, opts) + data + end + + # Use this method to update a Leave Application + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_application_id [String] Leave Application id for single object + # @param leave_application [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveApplications, Integer, Hash)>] LeaveApplications data, response status code and response headers + def update_leave_application_with_http_info(xero_tenant_id, leave_application_id, leave_application, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_leave_application ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_leave_application" + end + # verify the required parameter 'leave_application_id' is set + if @api_client.config.client_side_validation && leave_application_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_application_id' when calling PayrollAuApi.update_leave_application" + end + # verify the required parameter 'leave_application' is set + if @api_client.config.client_side_validation && leave_application.nil? + fail ArgumentError, "Missing the required parameter 'leave_application' when calling PayrollAuApi.update_leave_application" + end + # resource path + local_var_path = '/LeaveApplications/{LeaveApplicationId}'.sub('{' + 'LeaveApplicationId' + '}', leave_application_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(leave_application) + + # return_type + return_type = opts[:return_type] || 'LeaveApplications' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a PayRun + # Update properties on a single PayRun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayRun id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :pay_run + # @return [PayRuns] + def update_pay_run(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = update_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # Update a PayRun + # Update properties on a single PayRun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayRun id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :pay_run + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollAuApi.update_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'pay_run']) + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Payslip + # Update lines on a single payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Payslip id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :payslip_lines + # @return [Payslips] + def update_payslip(xero_tenant_id, payslip_id, opts = {}) + data, _status_code, _headers = update_payslip_with_http_info(xero_tenant_id, payslip_id, opts) + data + end + + # Update a Payslip + # Update lines on a single payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Payslip id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :payslip_lines + # @return [Array<(Payslips, Integer, Hash)>] Payslips data, response status code and response headers + def update_payslip_with_http_info(xero_tenant_id, payslip_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_payslip ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_payslip" + end + # verify the required parameter 'payslip_id' is set + if @api_client.config.client_side_validation && payslip_id.nil? + fail ArgumentError, "Missing the required parameter 'payslip_id' when calling PayrollAuApi.update_payslip" + end + # resource path + local_var_path = '/Payslip/{PayslipID}'.sub('{' + 'PayslipID' + '}', payslip_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'payslip_lines']) + + # return_type + return_type = opts[:return_type] || 'Payslips' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_payslip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Superfund + # Update properties on a single Superfund + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund_id [String] Superfund id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :super_fund + # @return [SuperFunds] + def update_superfund(xero_tenant_id, super_fund_id, opts = {}) + data, _status_code, _headers = update_superfund_with_http_info(xero_tenant_id, super_fund_id, opts) + data + end + + # Update a Superfund + # Update properties on a single Superfund + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param super_fund_id [String] Superfund id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :super_fund + # @return [Array<(SuperFunds, Integer, Hash)>] SuperFunds data, response status code and response headers + def update_superfund_with_http_info(xero_tenant_id, super_fund_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_superfund ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_superfund" + end + # verify the required parameter 'super_fund_id' is set + if @api_client.config.client_side_validation && super_fund_id.nil? + fail ArgumentError, "Missing the required parameter 'super_fund_id' when calling PayrollAuApi.update_superfund" + end + # resource path + local_var_path = '/Superfunds/{SuperFundID}'.sub('{' + 'SuperFundID' + '}', super_fund_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'super_fund']) + + # return_type + return_type = opts[:return_type] || 'SuperFunds' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Timesheet + # Update properties on a single timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Timesheet id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :timesheet + # @return [Timesheets] + def update_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = update_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # Update a Timesheet + # Update properties on a single timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Timesheet id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :timesheet + # @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers + def update_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollAuApi.update_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollAuApi.update_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollAuApi.update_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'timesheet']) + + # return_type + return_type = opts[:return_type] || 'Timesheets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollAuApi#update_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api/payroll_nz_api.rb b/lib/xero-ruby/api/payroll_nz_api.rb new file mode 100644 index 00000000..8407bf78 --- /dev/null +++ b/lib/xero-ruby/api/payroll_nz_api.rb @@ -0,0 +1,5263 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class PayrollNzApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.new) + @api_client = api_client + end + # approve a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def approve_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # approve a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.approve_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.approve_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.approve_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Approve'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#approve_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new deduction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction [Deduction] + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + def create_deduction(xero_tenant_id, deduction, opts = {}) + data, _status_code, _headers = create_deduction_with_http_info(xero_tenant_id, deduction, opts) + data + end + + # create a new deduction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction [Deduction] + # @param [Hash] opts the optional parameters + # @return [Array<(DeductionObject, Integer, Hash)>] DeductionObject data, response status code and response headers + def create_deduction_with_http_info(xero_tenant_id, deduction, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_deduction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_deduction" + end + # verify the required parameter 'deduction' is set + if @api_client.config.client_side_validation && deduction.nil? + fail ArgumentError, "Missing the required parameter 'deduction' when calling PayrollNzApi.create_deduction" + end + # resource path + local_var_path = '/Deductions' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(deduction) + + # return_type + return_type = opts[:return_type] || 'DeductionObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new earnings rate + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate [EarningsRate] + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + def create_earnings_rate(xero_tenant_id, earnings_rate, opts = {}) + data, _status_code, _headers = create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts) + data + end + + # create a new earnings rate + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate [EarningsRate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsRateObject, Integer, Hash)>] EarningsRateObject data, response status code and response headers + def create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_earnings_rate ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_earnings_rate" + end + # verify the required parameter 'earnings_rate' is set + if @api_client.config.client_side_validation && earnings_rate.nil? + fail ArgumentError, "Missing the required parameter 'earnings_rate' when calling PayrollNzApi.create_earnings_rate" + end + # resource path + local_var_path = '/EarningsRates' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_rate) + + # return_type + return_type = opts[:return_type] || 'EarningsRateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def create_employee(xero_tenant_id, employee, opts = {}) + data, _status_code, _headers = create_employee_with_http_info(xero_tenant_id, employee, opts) + data + end + + # creates employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee" + end + # verify the required parameter 'employee' is set + if @api_client.config.client_side_validation && employee.nil? + fail ArgumentError, "Missing the required parameter 'employee' when calling PayrollNzApi.create_employee" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee) + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + def create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template, opts = {}) + data, _status_code, _headers = create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts) + data + end + + # creates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsTemplateObject, Integer, Hash)>] EarningsTemplateObject data, response status code and response headers + def create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollNzApi.create_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EarningsTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def create_employee_leave(xero_tenant_id, employee_id, employee_leave, opts = {}) + data, _status_code, _headers = create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_leave, opts) + data + end + + # creates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_leave, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_leave" + end + # verify the required parameter 'employee_leave' is set + if @api_client.config.client_side_validation && employee_leave.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave' when calling PayrollNzApi.create_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_setup [EmployeeLeaveSetup] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveSetupObject] + def create_employee_leave_setup(xero_tenant_id, employee_id, employee_leave_setup, opts = {}) + data, _status_code, _headers = create_employee_leave_setup_with_http_info(xero_tenant_id, employee_id, employee_leave_setup, opts) + data + end + + # Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_setup [EmployeeLeaveSetup] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveSetupObject, Integer, Hash)>] EmployeeLeaveSetupObject data, response status code and response headers + def create_employee_leave_setup_with_http_info(xero_tenant_id, employee_id, employee_leave_setup, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_leave_setup ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_leave_setup" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_leave_setup" + end + # verify the required parameter 'employee_leave_setup' is set + if @api_client.config.client_side_validation && employee_leave_setup.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave_setup' when calling PayrollNzApi.create_employee_leave_setup" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/leaveSetup'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave_setup) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveSetupObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave_setup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee leave type records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_type [EmployeeLeaveType] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypeObject] + def create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type, opts = {}) + data, _status_code, _headers = create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, employee_leave_type, opts) + data + end + + # creates employee leave type records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_type [EmployeeLeaveType] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveTypeObject, Integer, Hash)>] EmployeeLeaveTypeObject data, response status code and response headers + def create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, employee_leave_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_leave_type" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_leave_type" + end + # verify the required parameter 'employee_leave_type' is set + if @api_client.config.client_side_validation && employee_leave_type.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave_type' when calling PayrollNzApi.create_employee_leave_type" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveTypes'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave_type) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balance [Array] + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + def create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balance, opts = {}) + data, _status_code, _headers = create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balance, opts) + data + end + + # creates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balance [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeOpeningBalancesObject, Integer, Hash)>] EmployeeOpeningBalancesObject data, response status code and response headers + def create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balance, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_opening_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_opening_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_opening_balances" + end + # verify the required parameter 'employee_opening_balance' is set + if @api_client.config.client_side_validation && employee_opening_balance.nil? + fail ArgumentError, "Missing the required parameter 'employee_opening_balance' when calling PayrollNzApi.create_employee_opening_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/openingBalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_opening_balance) + + # return_type + return_type = opts[:return_type] || 'EmployeeOpeningBalancesObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param payment_method [PaymentMethod] + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + def create_employee_payment_method(xero_tenant_id, employee_id, payment_method, opts = {}) + data, _status_code, _headers = create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, payment_method, opts) + data + end + + # creates employee payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param payment_method [PaymentMethod] + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentMethodObject, Integer, Hash)>] PaymentMethodObject data, response status code and response headers + def create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, payment_method, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_payment_method ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_payment_method" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_payment_method" + end + # verify the required parameter 'payment_method' is set + if @api_client.config.client_side_validation && payment_method.nil? + fail ArgumentError, "Missing the required parameter 'payment_method' when calling PayrollNzApi.create_employee_payment_method" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PaymentMethods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment_method) + + # return_type + return_type = opts[:return_type] || 'PaymentMethodObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee salary and wage record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + def create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage, opts = {}) + data, _status_code, _headers = create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wage, opts) + data + end + + # creates employee salary and wage record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWageObject, Integer, Hash)>] SalaryAndWageObject data, response status code and response headers + def create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wage, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wage' is set + if @api_client.config.client_side_validation && salary_and_wage.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wage' when calling PayrollNzApi.create_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(salary_and_wage) + + # return_type + return_type = opts[:return_type] || 'SalaryAndWageObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employment [Employment] + # @param [Hash] opts the optional parameters + # @return [EmploymentObject] + def create_employment(xero_tenant_id, employee_id, employment, opts = {}) + data, _status_code, _headers = create_employment_with_http_info(xero_tenant_id, employee_id, employment, opts) + data + end + + # creates employment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employment [Employment] + # @param [Hash] opts the optional parameters + # @return [Array<(EmploymentObject, Integer, Hash)>] EmploymentObject data, response status code and response headers + def create_employment_with_http_info(xero_tenant_id, employee_id, employment, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_employment" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_employment" + end + # verify the required parameter 'employment' is set + if @api_client.config.client_side_validation && employment.nil? + fail ArgumentError, "Missing the required parameter 'employment' when calling PayrollNzApi.create_employment" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Employment'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employment) + + # return_type + return_type = opts[:return_type] || 'EmploymentObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new leave type + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type [LeaveType] + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + def create_leave_type(xero_tenant_id, leave_type, opts = {}) + data, _status_code, _headers = create_leave_type_with_http_info(xero_tenant_id, leave_type, opts) + data + end + + # create a new leave type + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type [LeaveType] + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveTypeObject, Integer, Hash)>] LeaveTypeObject data, response status code and response headers + def create_leave_type_with_http_info(xero_tenant_id, leave_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_leave_type" + end + # verify the required parameter 'leave_type' is set + if @api_client.config.client_side_validation && leave_type.nil? + fail ArgumentError, "Missing the required parameter 'leave_type' when calling PayrollNzApi.create_leave_type" + end + # resource path + local_var_path = '/LeaveTypes' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(leave_type) + + # return_type + return_type = opts[:return_type] || 'LeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates multiple employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [Array] + # @param [Hash] opts the optional parameters + # @return [EmployeeEarningsTemplates] + def create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template, opts = {}) + data, _status_code, _headers = create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts) + data + end + + # creates multiple employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeEarningsTemplates, Integer, Hash)>] EmployeeEarningsTemplates data, response status code and response headers + def create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_multiple_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_multiple_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.create_multiple_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollNzApi.create_multiple_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/paytemplateearnings'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EmployeeEarningsTemplates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_multiple_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + def create_pay_run(xero_tenant_id, pay_run, opts = {}) + data, _status_code, _headers = create_pay_run_with_http_info(xero_tenant_id, pay_run, opts) + data + end + + # create a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers + def create_pay_run_with_http_info(xero_tenant_id, pay_run, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_pay_run" + end + # verify the required parameter 'pay_run' is set + if @api_client.config.client_side_validation && pay_run.nil? + fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollNzApi.create_pay_run" + end + # resource path + local_var_path = '/PayRuns' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run) + + # return_type + return_type = opts[:return_type] || 'PayRunObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new payrun calendar + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar [PayRunCalendar] + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + def create_pay_run_calendar(xero_tenant_id, pay_run_calendar, opts = {}) + data, _status_code, _headers = create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opts) + data + end + + # create a new payrun calendar + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar [PayRunCalendar] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunCalendarObject, Integer, Hash)>] PayRunCalendarObject data, response status code and response headers + def create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_pay_run_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_pay_run_calendar" + end + # verify the required parameter 'pay_run_calendar' is set + if @api_client.config.client_side_validation && pay_run_calendar.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_calendar' when calling PayrollNzApi.create_pay_run_calendar" + end + # resource path + local_var_path = '/PayRunCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run_calendar) + + # return_type + return_type = opts[:return_type] || 'PayRunCalendarObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new reimbursement + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement [Reimbursement] + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + def create_reimbursement(xero_tenant_id, reimbursement, opts = {}) + data, _status_code, _headers = create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts) + data + end + + # create a new reimbursement + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement [Reimbursement] + # @param [Hash] opts the optional parameters + # @return [Array<(ReimbursementObject, Integer, Hash)>] ReimbursementObject data, response status code and response headers + def create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_reimbursement ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_reimbursement" + end + # verify the required parameter 'reimbursement' is set + if @api_client.config.client_side_validation && reimbursement.nil? + fail ArgumentError, "Missing the required parameter 'reimbursement' when calling PayrollNzApi.create_reimbursement" + end + # resource path + local_var_path = '/Reimbursements' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(reimbursement) + + # return_type + return_type = opts[:return_type] || 'ReimbursementObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new superannuation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param benefit [Benefit] + # @param [Hash] opts the optional parameters + # @return [SuperannuationObject] + def create_superannuation(xero_tenant_id, benefit, opts = {}) + data, _status_code, _headers = create_superannuation_with_http_info(xero_tenant_id, benefit, opts) + data + end + + # create a new superannuation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param benefit [Benefit] + # @param [Hash] opts the optional parameters + # @return [Array<(SuperannuationObject, Integer, Hash)>] SuperannuationObject data, response status code and response headers + def create_superannuation_with_http_info(xero_tenant_id, benefit, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_superannuation ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_superannuation" + end + # verify the required parameter 'benefit' is set + if @api_client.config.client_side_validation && benefit.nil? + fail ArgumentError, "Missing the required parameter 'benefit' when calling PayrollNzApi.create_superannuation" + end + # resource path + local_var_path = '/superannuations' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(benefit) + + # return_type + return_type = opts[:return_type] || 'SuperannuationObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_superannuation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Timesheet] + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def create_timesheet(xero_tenant_id, timesheet, opts = {}) + data, _status_code, _headers = create_timesheet_with_http_info(xero_tenant_id, timesheet, opts) + data + end + + # create a new timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Timesheet] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_timesheet" + end + # verify the required parameter 'timesheet' is set + if @api_client.config.client_side_validation && timesheet.nil? + fail ArgumentError, "Missing the required parameter 'timesheet' when calling PayrollNzApi.create_timesheet" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet) + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + def create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line, opts = {}) + data, _status_code, _headers = create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line, opts) + data + end + + # create a new timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLineObject, Integer, Hash)>] TimesheetLineObject data, response status code and response headers + def create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.create_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.create_timesheet_line" + end + # verify the required parameter 'timesheet_line' is set + if @api_client.config.client_side_validation && timesheet_line.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line' when calling PayrollNzApi.create_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet_line) + + # return_type + return_type = opts[:return_type] || 'TimesheetLineObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee earnings template record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + def delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, opts = {}) + data, _status_code, _headers = delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, opts) + data + end + + # deletes an employee earnings template record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsTemplateObject, Integer, Hash)>] EarningsTemplateObject data, response status code and response headers + def delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.delete_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.delete_employee_earnings_template" + end + # verify the required parameter 'pay_template_earning_id' is set + if @api_client.config.client_side_validation && pay_template_earning_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_template_earning_id' when calling PayrollNzApi.delete_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'PayTemplateEarningID' + '}', pay_template_earning_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def delete_employee_leave(xero_tenant_id, employee_id, leave_id, opts = {}) + data, _status_code, _headers = delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts) + data + end + + # deletes an employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.delete_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.delete_employee_leave" + end + # verify the required parameter 'leave_id' is set + if @api_client.config.client_side_validation && leave_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_id' when calling PayrollNzApi.delete_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave/{LeaveID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + def delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + data, _status_code, _headers = delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts) + data + end + + # deletes an employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWageObject, Integer, Hash)>] SalaryAndWageObject data, response status code and response headers + def delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.delete_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.delete_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollNzApi.delete_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SalaryAndWageObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + def delete_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # delete a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLine, Integer, Hash)>] TimesheetLine data, response status code and response headers + def delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.delete_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.delete_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetLine' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + def delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, opts = {}) + data, _status_code, _headers = delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, opts) + data + end + + # delete a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLine, Integer, Hash)>] TimesheetLine data, response status code and response headers + def delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.delete_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.delete_timesheet_line" + end + # verify the required parameter 'timesheet_line_id' is set + if @api_client.config.client_side_validation && timesheet_line_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line_id' when calling PayrollNzApi.delete_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s).sub('{' + 'TimesheetLineID' + '}', timesheet_line_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetLine' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction_id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + def get_deduction(xero_tenant_id, deduction_id, opts = {}) + data, _status_code, _headers = get_deduction_with_http_info(xero_tenant_id, deduction_id, opts) + data + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction_id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [Array<(DeductionObject, Integer, Hash)>] DeductionObject data, response status code and response headers + def get_deduction_with_http_info(xero_tenant_id, deduction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_deduction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_deduction" + end + # verify the required parameter 'deduction_id' is set + if @api_client.config.client_side_validation && deduction_id.nil? + fail ArgumentError, "Missing the required parameter 'deduction_id' when calling PayrollNzApi.get_deduction" + end + # resource path + local_var_path = '/Deductions/{deductionId}'.sub('{' + 'deductionId' + '}', deduction_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'DeductionObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Deductions] + def get_deductions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_deductions_with_http_info(xero_tenant_id, opts) + data + end + + # searches deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Deductions, Integer, Hash)>] Deductions data, response status code and response headers + def get_deductions_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_deductions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_deductions" + end + # resource path + local_var_path = '/Deductions' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Deductions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single earnings rates by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate_id [String] Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + def get_earnings_rate(xero_tenant_id, earnings_rate_id, opts = {}) + data, _status_code, _headers = get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts) + data + end + + # retrieve a single earnings rates by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate_id [String] Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsRateObject, Integer, Hash)>] EarningsRateObject data, response status code and response headers + def get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_earnings_rate ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_earnings_rate" + end + # verify the required parameter 'earnings_rate_id' is set + if @api_client.config.client_side_validation && earnings_rate_id.nil? + fail ArgumentError, "Missing the required parameter 'earnings_rate_id' when calling PayrollNzApi.get_earnings_rate" + end + # resource path + local_var_path = '/EarningsRates/{EarningsRateID}'.sub('{' + 'EarningsRateID' + '}', earnings_rate_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsRateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches earnings rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsRates] + def get_earnings_rates(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_earnings_rates_with_http_info(xero_tenant_id, opts) + data + end + + # searches earnings rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(EarningsRates, Integer, Hash)>] EarningsRates data, response status code and response headers + def get_earnings_rates_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_earnings_rates ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_earnings_rates" + end + # resource path + local_var_path = '/EarningsRates' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsRates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_earnings_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def get_employee(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveBalances] + def get_employee_leave_balances(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveBalances, Integer, Hash)>] EmployeeLeaveBalances data, response status code and response headers + def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leave_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leave_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leave_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveBalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveBalances' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee leave periods + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [LeavePeriods] + def get_employee_leave_periods(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee leave periods + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [Array<(LeavePeriods, Integer, Hash)>] LeavePeriods data, response status code and response headers + def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leave_periods ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leave_periods" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leave_periods" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeavePeriods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? + query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeavePeriods' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypes] + def get_employee_leave_types(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveTypes, Integer, Hash)>] EmployeeLeaveTypes data, response status code and response headers + def get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leave_types ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leave_types" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leave_types" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveTypes'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveTypes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # search employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaves] + def get_employee_leaves(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # search employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaves, Integer, Hash)>] EmployeeLeaves data, response status code and response headers + def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_leaves ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_leaves" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_leaves" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaves' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leaves\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve employee openingbalances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + def get_employee_opening_balances(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieve employee openingbalances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeOpeningBalancesObject, Integer, Hash)>] EmployeeOpeningBalancesObject data, response status code and response headers + def get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_opening_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_opening_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_opening_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/openingBalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeOpeningBalancesObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee pay templates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplates] + def get_employee_pay_templates(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_pay_templates_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee pay templates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeePayTemplates, Integer, Hash)>] EmployeePayTemplates data, response status code and response headers + def get_employee_pay_templates_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_pay_templates ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_pay_templates" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_pay_templates" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeePayTemplates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_pay_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieves an employee's payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + def get_employee_payment_method(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieves an employee's payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentMethodObject, Integer, Hash)>] PaymentMethodObject data, response status code and response headers + def get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_payment_method ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_payment_method" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_payment_method" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PaymentMethods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaymentMethodObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # get employee salary and wages record by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWages] + def get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + data, _status_code, _headers = get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts) + data + end + + # get employee salary and wages record by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWages, Integer, Hash)>] SalaryAndWages data, response status code and response headers + def get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollNzApi.get_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SalaryAndWages' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieves an employee's salary and wages + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [SalaryAndWages] + def get_employee_salary_and_wages(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieves an employee's salary and wages + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(SalaryAndWages, Integer, Hash)>] SalaryAndWages data, response status code and response headers + def get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_salary_and_wages ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_salary_and_wages" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_salary_and_wages" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SalaryAndWages' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_salary_and_wages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + def get_employee_tax(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeTaxObject, Integer, Hash)>] EmployeeTaxObject data, response status code and response headers + def get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_tax ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employee_tax" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.get_employee_tax" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Tax'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeTaxObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Employees] + def get_employees(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts) + data + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employees_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_employees" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'firstName'] = opts[:'first_name'] if !opts[:'first_name'].nil? + query_params[:'lastName'] = opts[:'last_name'] if !opts[:'last_name'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single leave type by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type_id [String] Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + def get_leave_type(xero_tenant_id, leave_type_id, opts = {}) + data, _status_code, _headers = get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts) + data + end + + # retrieve a single leave type by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type_id [String] Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveTypeObject, Integer, Hash)>] LeaveTypeObject data, response status code and response headers + def get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_leave_type" + end + # verify the required parameter 'leave_type_id' is set + if @api_client.config.client_side_validation && leave_type_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_type_id' when calling PayrollNzApi.get_leave_type" + end + # resource path + local_var_path = '/LeaveTypes/{LeaveTypeID}'.sub('{' + 'LeaveTypeID' + '}', leave_type_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [LeaveTypes] + def get_leave_types(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_leave_types_with_http_info(xero_tenant_id, opts) + data + end + + # searches leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [Array<(LeaveTypes, Integer, Hash)>] LeaveTypes data, response status code and response headers + def get_leave_types_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_leave_types ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_leave_types" + end + # resource path + local_var_path = '/LeaveTypes' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'ActiveOnly'] = opts[:'active_only'] if !opts[:'active_only'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveTypes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single pay run by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + def get_pay_run(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # retrieve a single pay run by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers + def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollNzApi.get_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single payrun calendar by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar_id [String] Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + def get_pay_run_calendar(xero_tenant_id, payroll_calendar_id, opts = {}) + data, _status_code, _headers = get_pay_run_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opts) + data + end + + # retrieve a single payrun calendar by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payroll_calendar_id [String] Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunCalendarObject, Integer, Hash)>] PayRunCalendarObject data, response status code and response headers + def get_pay_run_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_run_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_run_calendar" + end + # verify the required parameter 'payroll_calendar_id' is set + if @api_client.config.client_side_validation && payroll_calendar_id.nil? + fail ArgumentError, "Missing the required parameter 'payroll_calendar_id' when calling PayrollNzApi.get_pay_run_calendar" + end + # resource path + local_var_path = '/PayRunCalendars/{PayrollCalendarID}'.sub('{' + 'PayrollCalendarID' + '}', payroll_calendar_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunCalendarObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches payrun calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PayRunCalendars] + def get_pay_run_calendars(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_run_calendars_with_http_info(xero_tenant_id, opts) + data + end + + # searches payrun calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(PayRunCalendars, Integer, Hash)>] PayRunCalendars data, response status code and response headers + def get_pay_run_calendars_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_run_calendars ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_run_calendars" + end + # resource path + local_var_path = '/PayRunCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunCalendars' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches pay runs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [PayRuns] + def get_pay_runs(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_runs_with_http_info(xero_tenant_id, opts) + data + end + + # searches pay runs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_runs ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_runs" + end + allowable_values = ["Draft", "Posted"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/PayRuns' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single payslip by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_slip_id [String] Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [PaySlipObject] + def get_pay_slip(xero_tenant_id, pay_slip_id, opts = {}) + data, _status_code, _headers = get_pay_slip_with_http_info(xero_tenant_id, pay_slip_id, opts) + data + end + + # retrieve a single payslip by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_slip_id [String] Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [Array<(PaySlipObject, Integer, Hash)>] PaySlipObject data, response status code and response headers + def get_pay_slip_with_http_info(xero_tenant_id, pay_slip_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_slip ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_slip" + end + # verify the required parameter 'pay_slip_id' is set + if @api_client.config.client_side_validation && pay_slip_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_slip_id' when calling PayrollNzApi.get_pay_slip" + end + # resource path + local_var_path = '/PaySlips/{PaySlipID}'.sub('{' + 'PaySlipID' + '}', pay_slip_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaySlipObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_slip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PaySlips] + def get_pay_slips(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # searches payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(PaySlips, Integer, Hash)>] PaySlips data, response status code and response headers + def get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_pay_slips ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_pay_slips" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollNzApi.get_pay_slips" + end + # resource path + local_var_path = '/PaySlips' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'PayRunID'] = pay_run_id + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaySlips' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_slips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single reimbursement by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement_id [String] Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + def get_reimbursement(xero_tenant_id, reimbursement_id, opts = {}) + data, _status_code, _headers = get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts) + data + end + + # retrieve a single reimbursement by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement_id [String] Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [Array<(ReimbursementObject, Integer, Hash)>] ReimbursementObject data, response status code and response headers + def get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_reimbursement ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_reimbursement" + end + # verify the required parameter 'reimbursement_id' is set + if @api_client.config.client_side_validation && reimbursement_id.nil? + fail ArgumentError, "Missing the required parameter 'reimbursement_id' when calling PayrollNzApi.get_reimbursement" + end + # resource path + local_var_path = '/Reimbursements/{ReimbursementID}'.sub('{' + 'ReimbursementID' + '}', reimbursement_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReimbursementObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches reimbursements + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Reimbursements] + def get_reimbursements(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_reimbursements_with_http_info(xero_tenant_id, opts) + data + end + + # searches reimbursements + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Reimbursements, Integer, Hash)>] Reimbursements data, response status code and response headers + def get_reimbursements_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_reimbursements ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_reimbursements" + end + # resource path + local_var_path = '/Reimbursements' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Reimbursements' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_reimbursements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Settings] + def get_settings(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_settings_with_http_info(xero_tenant_id, opts) + data + end + + # searches settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Settings, Integer, Hash)>] Settings data, response status code and response headers + def get_settings_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_settings" + end + # resource path + local_var_path = '/Settings' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Settings' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single statutory deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the statutory deduction + # @param [Hash] opts the optional parameters + # @return [StatutoryDeductionObject] + def get_statutory_deduction(xero_tenant_id, id, opts = {}) + data, _status_code, _headers = get_statutory_deduction_with_http_info(xero_tenant_id, id, opts) + data + end + + # retrieve a single statutory deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the statutory deduction + # @param [Hash] opts the optional parameters + # @return [Array<(StatutoryDeductionObject, Integer, Hash)>] StatutoryDeductionObject data, response status code and response headers + def get_statutory_deduction_with_http_info(xero_tenant_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_statutory_deduction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_statutory_deduction" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling PayrollNzApi.get_statutory_deduction" + end + # resource path + local_var_path = '/StatutoryDeductions/{Id}'.sub('{' + 'Id' + '}', id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'StatutoryDeductionObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_statutory_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches statutory deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [StatutoryDeductions] + def get_statutory_deductions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_statutory_deductions_with_http_info(xero_tenant_id, opts) + data + end + + # searches statutory deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(StatutoryDeductions, Integer, Hash)>] StatutoryDeductions data, response status code and response headers + def get_statutory_deductions_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_statutory_deductions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_statutory_deductions" + end + # resource path + local_var_path = '/StatutoryDeductions' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'StatutoryDeductions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_statutory_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches for a unique superannuation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param superannuation_id [String] Identifier for the superannuation + # @param [Hash] opts the optional parameters + # @return [SuperannuationObject] + def get_superannuation(xero_tenant_id, superannuation_id, opts = {}) + data, _status_code, _headers = get_superannuation_with_http_info(xero_tenant_id, superannuation_id, opts) + data + end + + # searches for a unique superannuation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param superannuation_id [String] Identifier for the superannuation + # @param [Hash] opts the optional parameters + # @return [Array<(SuperannuationObject, Integer, Hash)>] SuperannuationObject data, response status code and response headers + def get_superannuation_with_http_info(xero_tenant_id, superannuation_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_superannuation ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_superannuation" + end + # verify the required parameter 'superannuation_id' is set + if @api_client.config.client_side_validation && superannuation_id.nil? + fail ArgumentError, "Missing the required parameter 'superannuation_id' when calling PayrollNzApi.get_superannuation" + end + # resource path + local_var_path = '/superannuations/{SuperannuationID}'.sub('{' + 'SuperannuationID' + '}', superannuation_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SuperannuationObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_superannuation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches statutory deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Superannuations] + def get_superannuations(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_superannuations_with_http_info(xero_tenant_id, opts) + data + end + + # searches statutory deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Superannuations, Integer, Hash)>] Superannuations data, response status code and response headers + def get_superannuations_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_superannuations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_superannuations" + end + # resource path + local_var_path = '/superannuations' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Superannuations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_superannuations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single timesheet by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def get_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # retrieve a single timesheet by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.get_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Timesheets] + def get_timesheets(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts) + data + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers + def get_timesheets_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_timesheets ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_timesheets" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil? + query_params[:'payrollCalendarId'] = opts[:'payroll_calendar_id'] if !opts[:'payroll_calendar_id'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Timesheets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def get_tracking_categories(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_tracking_categories_with_http_info(xero_tenant_id, opts) + data + end + + # searches tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_tracking_categories ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.get_tracking_categories" + end + # resource path + local_var_path = '/settings/trackingCategories' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # revert a timesheet to draft + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def revert_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # revert a timesheet to draft + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.revert_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.revert_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.revert_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/RevertToDraft'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#revert_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def update_employee(xero_tenant_id, employee_id, employee, opts = {}) + data, _status_code, _headers = update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts) + data + end + + # updates employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.update_employee" + end + # verify the required parameter 'employee' is set + if @api_client.config.client_side_validation && employee.nil? + fail ArgumentError, "Missing the required parameter 'employee' when calling PayrollNzApi.update_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee) + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + def update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts = {}) + data, _status_code, _headers = update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts) + data + end + + # updates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsTemplateObject, Integer, Hash)>] EarningsTemplateObject data, response status code and response headers + def update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.update_employee_earnings_template" + end + # verify the required parameter 'pay_template_earning_id' is set + if @api_client.config.client_side_validation && pay_template_earning_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_template_earning_id' when calling PayrollNzApi.update_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollNzApi.update_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'PayTemplateEarningID' + '}', pay_template_earning_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EarningsTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave, opts = {}) + data, _status_code, _headers = update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, employee_leave, opts) + data + end + + # updates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, employee_leave, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.update_employee_leave" + end + # verify the required parameter 'leave_id' is set + if @api_client.config.client_side_validation && leave_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_id' when calling PayrollNzApi.update_employee_leave" + end + # verify the required parameter 'employee_leave' is set + if @api_client.config.client_side_validation && employee_leave.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave' when calling PayrollNzApi.update_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave/{LeaveID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + def update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts = {}) + data, _status_code, _headers = update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts) + data + end + + # updates employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWageObject, Integer, Hash)>] SalaryAndWageObject data, response status code and response headers + def update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.update_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollNzApi.update_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wage' is set + if @api_client.config.client_side_validation && salary_and_wage.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wage' when calling PayrollNzApi.update_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(salary_and_wage) + + # return_type + return_type = opts[:return_type] || 'SalaryAndWageObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates the tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_tax [EmployeeTax] + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + def update_employee_tax(xero_tenant_id, employee_id, employee_tax, opts = {}) + data, _status_code, _headers = update_employee_tax_with_http_info(xero_tenant_id, employee_id, employee_tax, opts) + data + end + + # updates the tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_tax [EmployeeTax] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeTaxObject, Integer, Hash)>] EmployeeTaxObject data, response status code and response headers + def update_employee_tax_with_http_info(xero_tenant_id, employee_id, employee_tax, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_employee_tax ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_employee_tax" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollNzApi.update_employee_tax" + end + # verify the required parameter 'employee_tax' is set + if @api_client.config.client_side_validation && employee_tax.nil? + fail ArgumentError, "Missing the required parameter 'employee_tax' when calling PayrollNzApi.update_employee_tax" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Tax'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_tax) + + # return_type + return_type = opts[:return_type] || 'EmployeeTaxObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + def update_pay_run(xero_tenant_id, pay_run_id, pay_run, opts = {}) + data, _status_code, _headers = update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts) + data + end + + # update a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers + def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollNzApi.update_pay_run" + end + # verify the required parameter 'pay_run' is set + if @api_client.config.client_side_validation && pay_run.nil? + fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollNzApi.update_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run) + + # return_type + return_type = opts[:return_type] || 'PayRunObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee pay slip + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_slip_id [String] Identifier for the payslip + # @param pay_slip [PaySlip] + # @param [Hash] opts the optional parameters + # @return [PaySlipObject] + def update_pay_slip_line_items(xero_tenant_id, pay_slip_id, pay_slip, opts = {}) + data, _status_code, _headers = update_pay_slip_line_items_with_http_info(xero_tenant_id, pay_slip_id, pay_slip, opts) + data + end + + # creates employee pay slip + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_slip_id [String] Identifier for the payslip + # @param pay_slip [PaySlip] + # @param [Hash] opts the optional parameters + # @return [Array<(PaySlipObject, Integer, Hash)>] PaySlipObject data, response status code and response headers + def update_pay_slip_line_items_with_http_info(xero_tenant_id, pay_slip_id, pay_slip, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_pay_slip_line_items ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_pay_slip_line_items" + end + # verify the required parameter 'pay_slip_id' is set + if @api_client.config.client_side_validation && pay_slip_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_slip_id' when calling PayrollNzApi.update_pay_slip_line_items" + end + # verify the required parameter 'pay_slip' is set + if @api_client.config.client_side_validation && pay_slip.nil? + fail ArgumentError, "Missing the required parameter 'pay_slip' when calling PayrollNzApi.update_pay_slip_line_items" + end + # resource path + local_var_path = '/PaySlips/{PaySlipID}'.sub('{' + 'PaySlipID' + '}', pay_slip_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_slip) + + # return_type + return_type = opts[:return_type] || 'PaySlipObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_pay_slip_line_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + def update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts = {}) + data, _status_code, _headers = update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts) + data + end + + # update a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLineObject, Integer, Hash)>] TimesheetLineObject data, response status code and response headers + def update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollNzApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_line_id' is set + if @api_client.config.client_side_validation && timesheet_line_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line_id' when calling PayrollNzApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_line' is set + if @api_client.config.client_side_validation && timesheet_line.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line' when calling PayrollNzApi.update_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s).sub('{' + 'TimesheetLineID' + '}', timesheet_line_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet_line) + + # return_type + return_type = opts[:return_type] || 'TimesheetLineObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#update_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api/payroll_uk_api.rb b/lib/xero-ruby/api/payroll_uk_api.rb new file mode 100644 index 00000000..1d92d461 --- /dev/null +++ b/lib/xero-ruby/api/payroll_uk_api.rb @@ -0,0 +1,5406 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class PayrollUkApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.new) + @api_client = api_client + end + # approve a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def approve_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # approve a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.approve_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.approve_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.approve_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Approve'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#approve_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new benefit + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param benefit [Benefit] + # @param [Hash] opts the optional parameters + # @return [BenefitObject] + def create_benefit(xero_tenant_id, benefit, opts = {}) + data, _status_code, _headers = create_benefit_with_http_info(xero_tenant_id, benefit, opts) + data + end + + # create a new benefit + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param benefit [Benefit] + # @param [Hash] opts the optional parameters + # @return [Array<(BenefitObject, Integer, Hash)>] BenefitObject data, response status code and response headers + def create_benefit_with_http_info(xero_tenant_id, benefit, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_benefit ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_benefit" + end + # verify the required parameter 'benefit' is set + if @api_client.config.client_side_validation && benefit.nil? + fail ArgumentError, "Missing the required parameter 'benefit' when calling PayrollUkApi.create_benefit" + end + # resource path + local_var_path = '/Benefits' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(benefit) + + # return_type + return_type = opts[:return_type] || 'BenefitObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_benefit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new deduction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction [Deduction] + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + def create_deduction(xero_tenant_id, deduction, opts = {}) + data, _status_code, _headers = create_deduction_with_http_info(xero_tenant_id, deduction, opts) + data + end + + # create a new deduction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction [Deduction] + # @param [Hash] opts the optional parameters + # @return [Array<(DeductionObject, Integer, Hash)>] DeductionObject data, response status code and response headers + def create_deduction_with_http_info(xero_tenant_id, deduction, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_deduction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_deduction" + end + # verify the required parameter 'deduction' is set + if @api_client.config.client_side_validation && deduction.nil? + fail ArgumentError, "Missing the required parameter 'deduction' when calling PayrollUkApi.create_deduction" + end + # resource path + local_var_path = '/Deductions' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(deduction) + + # return_type + return_type = opts[:return_type] || 'DeductionObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new earnings rate + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate [EarningsRate] + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + def create_earnings_rate(xero_tenant_id, earnings_rate, opts = {}) + data, _status_code, _headers = create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts) + data + end + + # create a new earnings rate + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate [EarningsRate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsRateObject, Integer, Hash)>] EarningsRateObject data, response status code and response headers + def create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_earnings_rate ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_earnings_rate" + end + # verify the required parameter 'earnings_rate' is set + if @api_client.config.client_side_validation && earnings_rate.nil? + fail ArgumentError, "Missing the required parameter 'earnings_rate' when calling PayrollUkApi.create_earnings_rate" + end + # resource path + local_var_path = '/EarningsRates' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_rate) + + # return_type + return_type = opts[:return_type] || 'EarningsRateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def create_employee(xero_tenant_id, employee, opts = {}) + data, _status_code, _headers = create_employee_with_http_info(xero_tenant_id, employee, opts) + data + end + + # creates employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee" + end + # verify the required parameter 'employee' is set + if @api_client.config.client_side_validation && employee.nil? + fail ArgumentError, "Missing the required parameter 'employee' when calling PayrollUkApi.create_employee" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee) + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + def create_employee_earnings_template(xero_tenant_id, employee_id, earnings_template, opts = {}) + data, _status_code, _headers = create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts) + data + end + + # creates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsTemplateObject, Integer, Hash)>] EarningsTemplateObject data, response status code and response headers + def create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollUkApi.create_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EarningsTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def create_employee_leave(xero_tenant_id, employee_id, employee_leave, opts = {}) + data, _status_code, _headers = create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_leave, opts) + data + end + + # creates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_leave, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_leave" + end + # verify the required parameter 'employee_leave' is set + if @api_client.config.client_side_validation && employee_leave.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave' when calling PayrollUkApi.create_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee leave type records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_type [EmployeeLeaveType] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypeObject] + def create_employee_leave_type(xero_tenant_id, employee_id, employee_leave_type, opts = {}) + data, _status_code, _headers = create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, employee_leave_type, opts) + data + end + + # creates employee leave type records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_leave_type [EmployeeLeaveType] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveTypeObject, Integer, Hash)>] EmployeeLeaveTypeObject data, response status code and response headers + def create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, employee_leave_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_leave_type" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_leave_type" + end + # verify the required parameter 'employee_leave_type' is set + if @api_client.config.client_side_validation && employee_leave_type.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave_type' when calling PayrollUkApi.create_employee_leave_type" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveTypes'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave_type) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balances [EmployeeOpeningBalances] + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + def create_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances, opts = {}) + data, _status_code, _headers = create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balances, opts) + data + end + + # creates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balances [EmployeeOpeningBalances] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeOpeningBalancesObject, Integer, Hash)>] EmployeeOpeningBalancesObject data, response status code and response headers + def create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balances, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_opening_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_opening_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_opening_balances" + end + # verify the required parameter 'employee_opening_balances' is set + if @api_client.config.client_side_validation && employee_opening_balances.nil? + fail ArgumentError, "Missing the required parameter 'employee_opening_balances' when calling PayrollUkApi.create_employee_opening_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/ukopeningbalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_opening_balances) + + # return_type + return_type = opts[:return_type] || 'EmployeeOpeningBalancesObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param payment_method [PaymentMethod] + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + def create_employee_payment_method(xero_tenant_id, employee_id, payment_method, opts = {}) + data, _status_code, _headers = create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, payment_method, opts) + data + end + + # creates employee payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param payment_method [PaymentMethod] + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentMethodObject, Integer, Hash)>] PaymentMethodObject data, response status code and response headers + def create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, payment_method, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_payment_method ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_payment_method" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_payment_method" + end + # verify the required parameter 'payment_method' is set + if @api_client.config.client_side_validation && payment_method.nil? + fail ArgumentError, "Missing the required parameter 'payment_method' when calling PayrollUkApi.create_employee_payment_method" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PaymentMethods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment_method) + + # return_type + return_type = opts[:return_type] || 'PaymentMethodObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee salary and wage record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + def create_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wage, opts = {}) + data, _status_code, _headers = create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wage, opts) + data + end + + # creates employee salary and wage record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWageObject, Integer, Hash)>] SalaryAndWageObject data, response status code and response headers + def create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wage, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wage' is set + if @api_client.config.client_side_validation && salary_and_wage.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wage' when calling PayrollUkApi.create_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(salary_and_wage) + + # return_type + return_type = opts[:return_type] || 'SalaryAndWageObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employee statutory sick leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_statutory_sick_leave [EmployeeStatutorySickLeave] + # @param [Hash] opts the optional parameters + # @return [EmployeeStatutorySickLeaveObject] + def create_employee_statutory_sick_leave(xero_tenant_id, employee_statutory_sick_leave, opts = {}) + data, _status_code, _headers = create_employee_statutory_sick_leave_with_http_info(xero_tenant_id, employee_statutory_sick_leave, opts) + data + end + + # creates employee statutory sick leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_statutory_sick_leave [EmployeeStatutorySickLeave] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeStatutorySickLeaveObject, Integer, Hash)>] EmployeeStatutorySickLeaveObject data, response status code and response headers + def create_employee_statutory_sick_leave_with_http_info(xero_tenant_id, employee_statutory_sick_leave, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employee_statutory_sick_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employee_statutory_sick_leave" + end + # verify the required parameter 'employee_statutory_sick_leave' is set + if @api_client.config.client_side_validation && employee_statutory_sick_leave.nil? + fail ArgumentError, "Missing the required parameter 'employee_statutory_sick_leave' when calling PayrollUkApi.create_employee_statutory_sick_leave" + end + # resource path + local_var_path = '/StatutoryLeaves/Sick' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_statutory_sick_leave) + + # return_type + return_type = opts[:return_type] || 'EmployeeStatutorySickLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_statutory_sick_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates employment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employment [Employment] + # @param [Hash] opts the optional parameters + # @return [EmploymentObject] + def create_employment(xero_tenant_id, employee_id, employment, opts = {}) + data, _status_code, _headers = create_employment_with_http_info(xero_tenant_id, employee_id, employment, opts) + data + end + + # creates employment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employment [Employment] + # @param [Hash] opts the optional parameters + # @return [Array<(EmploymentObject, Integer, Hash)>] EmploymentObject data, response status code and response headers + def create_employment_with_http_info(xero_tenant_id, employee_id, employment, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_employment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_employment" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_employment" + end + # verify the required parameter 'employment' is set + if @api_client.config.client_side_validation && employment.nil? + fail ArgumentError, "Missing the required parameter 'employment' when calling PayrollUkApi.create_employment" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Employment'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employment) + + # return_type + return_type = opts[:return_type] || 'EmploymentObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_employment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new leave type + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type [LeaveType] + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + def create_leave_type(xero_tenant_id, leave_type, opts = {}) + data, _status_code, _headers = create_leave_type_with_http_info(xero_tenant_id, leave_type, opts) + data + end + + # create a new leave type + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type [LeaveType] + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveTypeObject, Integer, Hash)>] LeaveTypeObject data, response status code and response headers + def create_leave_type_with_http_info(xero_tenant_id, leave_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_leave_type" + end + # verify the required parameter 'leave_type' is set + if @api_client.config.client_side_validation && leave_type.nil? + fail ArgumentError, "Missing the required parameter 'leave_type' when calling PayrollUkApi.create_leave_type" + end + # resource path + local_var_path = '/LeaveTypes' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(leave_type) + + # return_type + return_type = opts[:return_type] || 'LeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates multiple employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [Array] + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplates] + def create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earnings_template, opts = {}) + data, _status_code, _headers = create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts) + data + end + + # creates multiple employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param earnings_template [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeePayTemplates, Integer, Hash)>] EmployeePayTemplates data, response status code and response headers + def create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_multiple_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_multiple_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.create_multiple_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollUkApi.create_multiple_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/paytemplateearnings'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EmployeePayTemplates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_multiple_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new payrun calendar + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar [PayRunCalendar] + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + def create_pay_run_calendar(xero_tenant_id, pay_run_calendar, opts = {}) + data, _status_code, _headers = create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opts) + data + end + + # create a new payrun calendar + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar [PayRunCalendar] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunCalendarObject, Integer, Hash)>] PayRunCalendarObject data, response status code and response headers + def create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_pay_run_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_pay_run_calendar" + end + # verify the required parameter 'pay_run_calendar' is set + if @api_client.config.client_side_validation && pay_run_calendar.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_calendar' when calling PayrollUkApi.create_pay_run_calendar" + end + # resource path + local_var_path = '/PayRunCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run_calendar) + + # return_type + return_type = opts[:return_type] || 'PayRunCalendarObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new reimbursement + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement [Reimbursement] + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + def create_reimbursement(xero_tenant_id, reimbursement, opts = {}) + data, _status_code, _headers = create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts) + data + end + + # create a new reimbursement + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement [Reimbursement] + # @param [Hash] opts the optional parameters + # @return [Array<(ReimbursementObject, Integer, Hash)>] ReimbursementObject data, response status code and response headers + def create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_reimbursement ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_reimbursement" + end + # verify the required parameter 'reimbursement' is set + if @api_client.config.client_side_validation && reimbursement.nil? + fail ArgumentError, "Missing the required parameter 'reimbursement' when calling PayrollUkApi.create_reimbursement" + end + # resource path + local_var_path = '/Reimbursements' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(reimbursement) + + # return_type + return_type = opts[:return_type] || 'ReimbursementObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Timesheet] + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def create_timesheet(xero_tenant_id, timesheet, opts = {}) + data, _status_code, _headers = create_timesheet_with_http_info(xero_tenant_id, timesheet, opts) + data + end + + # create a new timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet [Timesheet] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_timesheet" + end + # verify the required parameter 'timesheet' is set + if @api_client.config.client_side_validation && timesheet.nil? + fail ArgumentError, "Missing the required parameter 'timesheet' when calling PayrollUkApi.create_timesheet" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet) + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # create a new timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + def create_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line, opts = {}) + data, _status_code, _headers = create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line, opts) + data + end + + # create a new timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLineObject, Integer, Hash)>] TimesheetLineObject data, response status code and response headers + def create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.create_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.create_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.create_timesheet_line" + end + # verify the required parameter 'timesheet_line' is set + if @api_client.config.client_side_validation && timesheet_line.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line' when calling PayrollUkApi.create_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet_line) + + # return_type + return_type = opts[:return_type] || 'TimesheetLineObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#create_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee earnings template record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, opts = {}) + delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, opts) + nil + end + + # deletes an employee earnings template record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.delete_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.delete_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.delete_employee_earnings_template" + end + # verify the required parameter 'pay_template_earning_id' is set + if @api_client.config.client_side_validation && pay_template_earning_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_template_earning_id' when calling PayrollUkApi.delete_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'PayTemplateEarningID' + '}', pay_template_earning_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def delete_employee_leave(xero_tenant_id, employee_id, leave_id, opts = {}) + data, _status_code, _headers = delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts) + data + end + + # deletes an employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.delete_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.delete_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.delete_employee_leave" + end + # verify the required parameter 'leave_id' is set + if @api_client.config.client_side_validation && leave_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_id' when calling PayrollUkApi.delete_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave/{LeaveID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # deletes an employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts) + nil + end + + # deletes an employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.delete_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.delete_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.delete_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollUkApi.delete_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + def delete_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # delete a timesheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLine, Integer, Hash)>] TimesheetLine data, response status code and response headers + def delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.delete_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.delete_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.delete_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetLine' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#delete_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # delete a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + def delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, opts = {}) + data, _status_code, _headers = delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, opts) + data + end + + # delete a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLine, Integer, Hash)>] TimesheetLine data, response status code and response headers + def delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.delete_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.delete_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.delete_timesheet_line" + end + # verify the required parameter 'timesheet_line_id' is set + if @api_client.config.client_side_validation && timesheet_line_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line_id' when calling PayrollUkApi.delete_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s).sub('{' + 'TimesheetLineID' + '}', timesheet_line_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetLine' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#delete_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single benefit by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the benefit + # @param [Hash] opts the optional parameters + # @return [BenefitObject] + def get_benefit(xero_tenant_id, id, opts = {}) + data, _status_code, _headers = get_benefit_with_http_info(xero_tenant_id, id, opts) + data + end + + # retrieve a single benefit by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the benefit + # @param [Hash] opts the optional parameters + # @return [Array<(BenefitObject, Integer, Hash)>] BenefitObject data, response status code and response headers + def get_benefit_with_http_info(xero_tenant_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_benefit ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_benefit" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling PayrollUkApi.get_benefit" + end + # resource path + local_var_path = '/Benefits/{id}'.sub('{' + 'id' + '}', id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BenefitObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_benefit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches benefits + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Benefits] + def get_benefits(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_benefits_with_http_info(xero_tenant_id, opts) + data + end + + # searches benefits + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Benefits, Integer, Hash)>] Benefits data, response status code and response headers + def get_benefits_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_benefits ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_benefits" + end + # resource path + local_var_path = '/Benefits' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Benefits' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_benefits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction_id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + def get_deduction(xero_tenant_id, deduction_id, opts = {}) + data, _status_code, _headers = get_deduction_with_http_info(xero_tenant_id, deduction_id, opts) + data + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param deduction_id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [Array<(DeductionObject, Integer, Hash)>] DeductionObject data, response status code and response headers + def get_deduction_with_http_info(xero_tenant_id, deduction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_deduction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_deduction" + end + # verify the required parameter 'deduction_id' is set + if @api_client.config.client_side_validation && deduction_id.nil? + fail ArgumentError, "Missing the required parameter 'deduction_id' when calling PayrollUkApi.get_deduction" + end + # resource path + local_var_path = '/Deductions/{deductionId}'.sub('{' + 'deductionId' + '}', deduction_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'DeductionObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Deductions] + def get_deductions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_deductions_with_http_info(xero_tenant_id, opts) + data + end + + # searches deductions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Deductions, Integer, Hash)>] Deductions data, response status code and response headers + def get_deductions_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_deductions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_deductions" + end + # resource path + local_var_path = '/Deductions' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Deductions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [EarningsOrderObject] + def get_earnings_order(xero_tenant_id, id, opts = {}) + data, _status_code, _headers = get_earnings_order_with_http_info(xero_tenant_id, id, opts) + data + end + + # retrieve a single deduction by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsOrderObject, Integer, Hash)>] EarningsOrderObject data, response status code and response headers + def get_earnings_order_with_http_info(xero_tenant_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_earnings_order ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_earnings_order" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling PayrollUkApi.get_earnings_order" + end + # resource path + local_var_path = '/EarningsOrders/{id}'.sub('{' + 'id' + '}', id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsOrderObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches earnings orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsOrders] + def get_earnings_orders(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_earnings_orders_with_http_info(xero_tenant_id, opts) + data + end + + # searches earnings orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(EarningsOrders, Integer, Hash)>] EarningsOrders data, response status code and response headers + def get_earnings_orders_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_earnings_orders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_earnings_orders" + end + # resource path + local_var_path = '/EarningsOrders' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single earnings rates by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate_id [String] Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + def get_earnings_rate(xero_tenant_id, earnings_rate_id, opts = {}) + data, _status_code, _headers = get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts) + data + end + + # retrieve a single earnings rates by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param earnings_rate_id [String] Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsRateObject, Integer, Hash)>] EarningsRateObject data, response status code and response headers + def get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_earnings_rate ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_earnings_rate" + end + # verify the required parameter 'earnings_rate_id' is set + if @api_client.config.client_side_validation && earnings_rate_id.nil? + fail ArgumentError, "Missing the required parameter 'earnings_rate_id' when calling PayrollUkApi.get_earnings_rate" + end + # resource path + local_var_path = '/EarningsRates/{EarningsRateID}'.sub('{' + 'EarningsRateID' + '}', earnings_rate_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsRateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches earnings rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsRates] + def get_earnings_rates(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_earnings_rates_with_http_info(xero_tenant_id, opts) + data + end + + # searches earnings rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(EarningsRates, Integer, Hash)>] EarningsRates data, response status code and response headers + def get_earnings_rates_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_earnings_rates ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_earnings_rates" + end + # resource path + local_var_path = '/EarningsRates' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EarningsRates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def get_employee(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def get_employee_leave(xero_tenant_id, employee_id, leave_id, opts = {}) + data, _status_code, _headers = get_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts) + data + end + + # retrieve a single employee leave record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def get_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave" + end + # verify the required parameter 'leave_id' is set + if @api_client.config.client_side_validation && leave_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_id' when calling PayrollUkApi.get_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave/{LeaveID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveBalances] + def get_employee_leave_balances(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveBalances, Integer, Hash)>] EmployeeLeaveBalances data, response status code and response headers + def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveBalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveBalances' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee leave periods + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [LeavePeriods] + def get_employee_leave_periods(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee leave periods + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [Array<(LeavePeriods, Integer, Hash)>] LeavePeriods data, response status code and response headers + def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave_periods ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave_periods" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave_periods" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeavePeriods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? + query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeavePeriods' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypes] + def get_employee_leave_types(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveTypes, Integer, Hash)>] EmployeeLeaveTypes data, response status code and response headers + def get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leave_types ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leave_types" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leave_types" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/LeaveTypes'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveTypes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # search employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaves] + def get_employee_leaves(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # search employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaves, Integer, Hash)>] EmployeeLeaves data, response status code and response headers + def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_leaves ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_leaves" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_leaves" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaves' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leaves\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve employee openingbalances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + def get_employee_opening_balances(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieve employee openingbalances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeOpeningBalancesObject, Integer, Hash)>] EmployeeOpeningBalancesObject data, response status code and response headers + def get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_opening_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_opening_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_opening_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/ukopeningbalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeOpeningBalancesObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employee pay templates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplateObject] + def get_employee_pay_template(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_pay_template_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches employee pay templates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeePayTemplateObject, Integer, Hash)>] EmployeePayTemplateObject data, response status code and response headers + def get_employee_pay_template_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_pay_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_pay_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_pay_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeePayTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_pay_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieves an employee's payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + def get_employee_payment_method(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieves an employee's payment method + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentMethodObject, Integer, Hash)>] PaymentMethodObject data, response status code and response headers + def get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_payment_method ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_payment_method" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_payment_method" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PaymentMethods'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaymentMethodObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # get employee salary and wages record by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWages] + def get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + data, _status_code, _headers = get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts) + data + end + + # get employee salary and wages record by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWages, Integer, Hash)>] SalaryAndWages data, response status code and response headers + def get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollUkApi.get_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SalaryAndWages' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieves an employee's salary and wages + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [SalaryAndWages] + def get_employee_salary_and_wages(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieves an employee's salary and wages + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(SalaryAndWages, Integer, Hash)>] SalaryAndWages data, response status code and response headers + def get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_salary_and_wages ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_salary_and_wages" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_salary_and_wages" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'SalaryAndWages' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_salary_and_wages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [String] :leave_type Filter by the type of statutory leave + # @option opts [Date] :as_of_date The date from which to calculate balance remaining. If not specified, current date UTC is used. + # @return [EmployeeStatutoryLeaveBalanceObject] + def get_employee_statutory_leave_balances(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_statutory_leave_balances_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # search employee leave balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [String] :leave_type Filter by the type of statutory leave + # @option opts [Date] :as_of_date The date from which to calculate balance remaining. If not specified, current date UTC is used. + # @return [Array<(EmployeeStatutoryLeaveBalanceObject, Integer, Hash)>] EmployeeStatutoryLeaveBalanceObject data, response status code and response headers + def get_employee_statutory_leave_balances_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_statutory_leave_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_statutory_leave_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_statutory_leave_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/StatutoryLeaveBalance'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'LeaveType'] = opts[:'leave_type'] if !opts[:'leave_type'].nil? + query_params[:'AsOfDate'] = opts[:'as_of_date'] if !opts[:'as_of_date'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeStatutoryLeaveBalanceObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_statutory_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a statutory sick leave for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param statutory_sick_leave_id [String] Statutory sick leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeStatutorySickLeaveObject] + def get_employee_statutory_sick_leave(xero_tenant_id, statutory_sick_leave_id, opts = {}) + data, _status_code, _headers = get_employee_statutory_sick_leave_with_http_info(xero_tenant_id, statutory_sick_leave_id, opts) + data + end + + # retrieve a statutory sick leave for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param statutory_sick_leave_id [String] Statutory sick leave id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeStatutorySickLeaveObject, Integer, Hash)>] EmployeeStatutorySickLeaveObject data, response status code and response headers + def get_employee_statutory_sick_leave_with_http_info(xero_tenant_id, statutory_sick_leave_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_statutory_sick_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_statutory_sick_leave" + end + # verify the required parameter 'statutory_sick_leave_id' is set + if @api_client.config.client_side_validation && statutory_sick_leave_id.nil? + fail ArgumentError, "Missing the required parameter 'statutory_sick_leave_id' when calling PayrollUkApi.get_employee_statutory_sick_leave" + end + # resource path + local_var_path = '/StatutoryLeaves/Sick/{StatutorySickLeaveID}'.sub('{' + 'StatutorySickLeaveID' + '}', statutory_sick_leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeStatutorySickLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_statutory_sick_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + def get_employee_tax(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # searches tax records for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeTaxObject, Integer, Hash)>] EmployeeTaxObject data, response status code and response headers + def get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employee_tax ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employee_tax" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_employee_tax" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Tax'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeTaxObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Employees] + def get_employees(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts) + data + end + + # searches employees + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employees_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_employees" + end + # resource path + local_var_path = '/Employees' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'firstName'] = opts[:'first_name'] if !opts[:'first_name'].nil? + query_params[:'lastName'] = opts[:'last_name'] if !opts[:'last_name'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single leave type by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type_id [String] Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + def get_leave_type(xero_tenant_id, leave_type_id, opts = {}) + data, _status_code, _headers = get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts) + data + end + + # retrieve a single leave type by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param leave_type_id [String] Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [Array<(LeaveTypeObject, Integer, Hash)>] LeaveTypeObject data, response status code and response headers + def get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_leave_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_leave_type" + end + # verify the required parameter 'leave_type_id' is set + if @api_client.config.client_side_validation && leave_type_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_type_id' when calling PayrollUkApi.get_leave_type" + end + # resource path + local_var_path = '/LeaveTypes/{LeaveTypeID}'.sub('{' + 'LeaveTypeID' + '}', leave_type_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveTypeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [LeaveTypes] + def get_leave_types(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_leave_types_with_http_info(xero_tenant_id, opts) + data + end + + # searches leave types + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [Array<(LeaveTypes, Integer, Hash)>] LeaveTypes data, response status code and response headers + def get_leave_types_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_leave_types ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_leave_types" + end + # resource path + local_var_path = '/LeaveTypes' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'ActiveOnly'] = opts[:'active_only'] if !opts[:'active_only'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LeaveTypes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single pay run by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + def get_pay_run(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # retrieve a single pay run by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers + def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollUkApi.get_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single payrun calendar by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar_id [String] Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + def get_pay_run_calendar(xero_tenant_id, pay_run_calendar_id, opts = {}) + data, _status_code, _headers = get_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar_id, opts) + data + end + + # retrieve a single payrun calendar by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_calendar_id [String] Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunCalendarObject, Integer, Hash)>] PayRunCalendarObject data, response status code and response headers + def get_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_run_calendar ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_run_calendar" + end + # verify the required parameter 'pay_run_calendar_id' is set + if @api_client.config.client_side_validation && pay_run_calendar_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_calendar_id' when calling PayrollUkApi.get_pay_run_calendar" + end + # resource path + local_var_path = '/PayRunCalendars/{PayRunCalendarID}'.sub('{' + 'PayRunCalendarID' + '}', pay_run_calendar_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunCalendarObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches payrun calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PayRunCalendars] + def get_pay_run_calendars(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_run_calendars_with_http_info(xero_tenant_id, opts) + data + end + + # searches payrun calendars + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(PayRunCalendars, Integer, Hash)>] PayRunCalendars data, response status code and response headers + def get_pay_run_calendars_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_run_calendars ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_run_calendars" + end + # resource path + local_var_path = '/PayRunCalendars' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRunCalendars' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches pay runs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [PayRuns] + def get_pay_runs(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_pay_runs_with_http_info(xero_tenant_id, opts) + data + end + + # searches pay runs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [Array<(PayRuns, Integer, Hash)>] PayRuns data, response status code and response headers + def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_runs ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_runs" + end + allowable_values = ["Draft", "Posted"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/PayRuns' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayRuns' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single payslip by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [PayslipObject] + def get_pay_slip(xero_tenant_id, payslip_id, opts = {}) + data, _status_code, _headers = get_pay_slip_with_http_info(xero_tenant_id, payslip_id, opts) + data + end + + # retrieve a single payslip by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payslip_id [String] Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [Array<(PayslipObject, Integer, Hash)>] PayslipObject data, response status code and response headers + def get_pay_slip_with_http_info(xero_tenant_id, payslip_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_slip ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_slip" + end + # verify the required parameter 'payslip_id' is set + if @api_client.config.client_side_validation && payslip_id.nil? + fail ArgumentError, "Missing the required parameter 'payslip_id' when calling PayrollUkApi.get_pay_slip" + end + # resource path + local_var_path = '/Payslips/{PayslipID}'.sub('{' + 'PayslipID' + '}', payslip_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PayslipObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_slip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Payslips] + def get_pay_slips(xero_tenant_id, pay_run_id, opts = {}) + data, _status_code, _headers = get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts) + data + end + + # searches payslips + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Payslips, Integer, Hash)>] Payslips data, response status code and response headers + def get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_pay_slips ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_pay_slips" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollUkApi.get_pay_slips" + end + # resource path + local_var_path = '/Payslips' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'PayRunID'] = pay_run_id + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Payslips' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_slips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single reimbursement by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement_id [String] Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + def get_reimbursement(xero_tenant_id, reimbursement_id, opts = {}) + data, _status_code, _headers = get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts) + data + end + + # retrieve a single reimbursement by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param reimbursement_id [String] Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [Array<(ReimbursementObject, Integer, Hash)>] ReimbursementObject data, response status code and response headers + def get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_reimbursement ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_reimbursement" + end + # verify the required parameter 'reimbursement_id' is set + if @api_client.config.client_side_validation && reimbursement_id.nil? + fail ArgumentError, "Missing the required parameter 'reimbursement_id' when calling PayrollUkApi.get_reimbursement" + end + # resource path + local_var_path = '/Reimbursements/{ReimbursementID}'.sub('{' + 'ReimbursementID' + '}', reimbursement_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReimbursementObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches reimbursements + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Reimbursements] + def get_reimbursements(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_reimbursements_with_http_info(xero_tenant_id, opts) + data + end + + # searches reimbursements + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Array<(Reimbursements, Integer, Hash)>] Reimbursements data, response status code and response headers + def get_reimbursements_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_reimbursements ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_reimbursements" + end + # resource path + local_var_path = '/Reimbursements' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Reimbursements' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_reimbursements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Settings] + def get_settings(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_settings_with_http_info(xero_tenant_id, opts) + data + end + + # searches settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Settings, Integer, Hash)>] Settings data, response status code and response headers + def get_settings_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_settings" + end + # resource path + local_var_path = '/Settings' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Settings' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a summary of statutory leaves for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :active_only Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + # @return [EmployeeStatutoryLeavesSummaries] + def get_statutory_leave_summary(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_statutory_leave_summary_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # retrieve a summary of statutory leaves for an employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :active_only Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + # @return [Array<(EmployeeStatutoryLeavesSummaries, Integer, Hash)>] EmployeeStatutoryLeavesSummaries data, response status code and response headers + def get_statutory_leave_summary_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_statutory_leave_summary ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_statutory_leave_summary" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.get_statutory_leave_summary" + end + # resource path + local_var_path = '/statutoryleaves/summary/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'activeOnly'] = opts[:'active_only'] if !opts[:'active_only'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'EmployeeStatutoryLeavesSummaries' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_statutory_leave_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieve a single timesheet by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def get_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # retrieve a single timesheet by id + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.get_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Timesheets] + def get_timesheets(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts) + data + end + + # searches timesheets + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Array<(Timesheets, Integer, Hash)>] Timesheets data, response status code and response headers + def get_timesheets_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_timesheets ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_timesheets" + end + # resource path + local_var_path = '/Timesheets' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil? + query_params[:'payrollCalendarId'] = opts[:'payroll_calendar_id'] if !opts[:'payroll_calendar_id'].nil? + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Timesheets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def get_tracking_categories(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_tracking_categories_with_http_info(xero_tenant_id, opts) + data + end + + # searches tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.get_tracking_categories ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.get_tracking_categories" + end + # resource path + local_var_path = '/settings/trackingCategories' + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # revert a timesheet to draft + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + def revert_timesheet(xero_tenant_id, timesheet_id, opts = {}) + data, _status_code, _headers = revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts) + data + end + + # revert a timesheet to draft + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetObject, Integer, Hash)>] TimesheetObject data, response status code and response headers + def revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.revert_timesheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.revert_timesheet" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.revert_timesheet" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/RevertToDraft'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimesheetObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#revert_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + def update_employee(xero_tenant_id, employee_id, employee, opts = {}) + data, _status_code, _headers = update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts) + data + end + + # updates employee + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee [Employee] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeObject, Integer, Hash)>] EmployeeObject data, response status code and response headers + def update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.update_employee" + end + # verify the required parameter 'employee' is set + if @api_client.config.client_side_validation && employee.nil? + fail ArgumentError, "Missing the required parameter 'employee' when calling PayrollUkApi.update_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeId}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee) + + # return_type + return_type = opts[:return_type] || 'EmployeeObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + def update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts = {}) + data, _status_code, _headers = update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts) + data + end + + # updates employee earnings template records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param pay_template_earning_id [String] Id for single pay template earnings object + # @param earnings_template [EarningsTemplate] + # @param [Hash] opts the optional parameters + # @return [Array<(EarningsTemplateObject, Integer, Hash)>] EarningsTemplateObject data, response status code and response headers + def update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id, pay_template_earning_id, earnings_template, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_employee_earnings_template ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_employee_earnings_template" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.update_employee_earnings_template" + end + # verify the required parameter 'pay_template_earning_id' is set + if @api_client.config.client_side_validation && pay_template_earning_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_template_earning_id' when calling PayrollUkApi.update_employee_earnings_template" + end + # verify the required parameter 'earnings_template' is set + if @api_client.config.client_side_validation && earnings_template.nil? + fail ArgumentError, "Missing the required parameter 'earnings_template' when calling PayrollUkApi.update_employee_earnings_template" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'PayTemplateEarningID' + '}', pay_template_earning_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(earnings_template) + + # return_type + return_type = opts[:return_type] || 'EarningsTemplateObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def update_employee_leave(xero_tenant_id, employee_id, leave_id, employee_leave, opts = {}) + data, _status_code, _headers = update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, employee_leave, opts) + data + end + + # updates employee leave records + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param leave_id [String] Leave id for single object + # @param employee_leave [EmployeeLeave] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeLeaveObject, Integer, Hash)>] EmployeeLeaveObject data, response status code and response headers + def update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, employee_leave, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_employee_leave ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_employee_leave" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.update_employee_leave" + end + # verify the required parameter 'leave_id' is set + if @api_client.config.client_side_validation && leave_id.nil? + fail ArgumentError, "Missing the required parameter 'leave_id' when calling PayrollUkApi.update_employee_leave" + end + # verify the required parameter 'employee_leave' is set + if @api_client.config.client_side_validation && employee_leave.nil? + fail ArgumentError, "Missing the required parameter 'employee_leave' when calling PayrollUkApi.update_employee_leave" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/Leave/{LeaveID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'LeaveID' + '}', leave_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_leave) + + # return_type + return_type = opts[:return_type] || 'EmployeeLeaveObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balances [EmployeeOpeningBalances] + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + def update_employee_opening_balances(xero_tenant_id, employee_id, employee_opening_balances, opts = {}) + data, _status_code, _headers = update_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balances, opts) + data + end + + # updates employee opening balances + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_opening_balances [EmployeeOpeningBalances] + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeOpeningBalancesObject, Integer, Hash)>] EmployeeOpeningBalancesObject data, response status code and response headers + def update_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, employee_opening_balances, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_employee_opening_balances ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_employee_opening_balances" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.update_employee_opening_balances" + end + # verify the required parameter 'employee_opening_balances' is set + if @api_client.config.client_side_validation && employee_opening_balances.nil? + fail ArgumentError, "Missing the required parameter 'employee_opening_balances' when calling PayrollUkApi.update_employee_opening_balances" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/ukopeningbalances'.sub('{' + 'EmployeeId' + '}', employee_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_opening_balances) + + # return_type + return_type = opts[:return_type] || 'EmployeeOpeningBalancesObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # updates employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + def update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts = {}) + data, _status_code, _headers = update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts) + data + end + + # updates employee salary and wages record + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param salary_and_wages_id [String] Id for single pay template earnings object + # @param salary_and_wage [SalaryAndWage] + # @param [Hash] opts the optional parameters + # @return [Array<(SalaryAndWageObject, Integer, Hash)>] SalaryAndWageObject data, response status code and response headers + def update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, salary_and_wages_id, salary_and_wage, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_employee_salary_and_wage ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_employee_salary_and_wage" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling PayrollUkApi.update_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wages_id' is set + if @api_client.config.client_side_validation && salary_and_wages_id.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wages_id' when calling PayrollUkApi.update_employee_salary_and_wage" + end + # verify the required parameter 'salary_and_wage' is set + if @api_client.config.client_side_validation && salary_and_wage.nil? + fail ArgumentError, "Missing the required parameter 'salary_and_wage' when calling PayrollUkApi.update_employee_salary_and_wage" + end + # resource path + local_var_path = '/Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID}'.sub('{' + 'EmployeeId' + '}', employee_id.to_s).sub('{' + 'SalaryAndWagesID' + '}', salary_and_wages_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(salary_and_wage) + + # return_type + return_type = opts[:return_type] || 'SalaryAndWageObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + def update_pay_run(xero_tenant_id, pay_run_id, pay_run, opts = {}) + data, _status_code, _headers = update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts) + data + end + + # update a pay run + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param pay_run_id [String] Identifier for the pay run + # @param pay_run [PayRun] + # @param [Hash] opts the optional parameters + # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers + def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_pay_run ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_pay_run" + end + # verify the required parameter 'pay_run_id' is set + if @api_client.config.client_side_validation && pay_run_id.nil? + fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollUkApi.update_pay_run" + end + # verify the required parameter 'pay_run' is set + if @api_client.config.client_side_validation && pay_run.nil? + fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollUkApi.update_pay_run" + end + # resource path + local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pay_run) + + # return_type + return_type = opts[:return_type] || 'PayRunObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + def update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts = {}) + data, _status_code, _headers = update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts) + data + end + + # update a timesheet line + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param timesheet_id [String] Identifier for the timesheet + # @param timesheet_line_id [String] Identifier for the timesheet line + # @param timesheet_line [TimesheetLine] + # @param [Hash] opts the optional parameters + # @return [Array<(TimesheetLineObject, Integer, Hash)>] TimesheetLineObject data, response status code and response headers + def update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet_line_id, timesheet_line, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_timesheet_line ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_id' is set + if @api_client.config.client_side_validation && timesheet_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_id' when calling PayrollUkApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_line_id' is set + if @api_client.config.client_side_validation && timesheet_line_id.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line_id' when calling PayrollUkApi.update_timesheet_line" + end + # verify the required parameter 'timesheet_line' is set + if @api_client.config.client_side_validation && timesheet_line.nil? + fail ArgumentError, "Missing the required parameter 'timesheet_line' when calling PayrollUkApi.update_timesheet_line" + end + # resource path + local_var_path = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'.sub('{' + 'TimesheetID' + '}', timesheet_id.to_s).sub('{' + 'TimesheetLineID' + '}', timesheet_line_id.to_s) + + # camelize keys of incoming `where` opts + opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil? + + # query parameters + query_params = opts[:query_params] || {} + + # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations: + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(timesheet_line) + + # return_type + return_type = opts[:return_type] || 'TimesheetLineObject' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollUkApi#update_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index a10a6132..51f8e107 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index 39c96248..c01d3cc2 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -62,6 +62,21 @@ def project_api XeroRuby::ProjectApi.new(self) end + def payroll_au_api + @config.base_url = @config.payroll_au_url + XeroRuby::PayrollAu.new(self) + end + + def payroll_nz_api + @config.base_url = @config.payroll_nz_url + XeroRuby::PayrollNz.new(self) + end + + def payroll_uk_api + @config.base_url = @config.payroll_uk_url + XeroRuby::PayrollUk.new(self) + end + # Token Helpers def token_set XeroRuby.configure.token_set @@ -347,8 +362,14 @@ def convert_to_type(data, return_type) XeroRuby::Assets.const_get(return_type).build_from_hash(data) when 'projects' XeroRuby::Projects.const_get(return_type).build_from_hash(data) - # when 'newapiset' # add new namespace - # XeroRuby::.const_get(return_type).build_from_hash(data) + when 'files' + XeroRuby::Files.const_get(return_type).build_from_hash(data) + when 'payroll_au' + XeroRuby::PayrollAu.const_get(return_type).build_from_hash(data) + when 'payroll_nz' + XeroRuby::PayrollNz.const_get(return_type).build_from_hash(data) + when 'payroll_uk' + XeroRuby::PayrollUk.const_get(return_type).build_from_hash(data) else XeroRuby::Accounting.const_get(return_type).build_from_hash(data) end diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb index fa8666a9..9055ef65 100644 --- a/lib/xero-ruby/api_error.rb +++ b/lib/xero-ruby/api_error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb index 38a93464..640c82df 100644 --- a/lib/xero-ruby/configuration.rb +++ b/lib/xero-ruby/configuration.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -30,6 +30,9 @@ class Configuration attr_accessor :accounting_url attr_accessor :asset_url attr_accessor :project_url + attr_accessor :payroll_au_url + attr_accessor :payroll_nz_url + attr_accessor :payroll_uk_url # Defines API keys used with API Key authentications. # @@ -139,6 +142,9 @@ def initialize @accounting_url = 'https://api.xero.com/api.xro/2.0' @asset_url = 'https://api.xero.com/assets.xro/1.0' @project_url = 'https://api.xero.com/projects.xro/2.0/' + @payroll_au_url = 'https://api.xero.com/payroll.xro/1.0/' + @payroll_nz_url = 'https://api.xero.com/payroll.xro/2.0/' + @payroll_uk_url = 'https://api.xero.com/payroll.xro/2.0/' @api_key = {} @api_key_prefix = {} @timeout = 0 diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index dd8ddad0..745c2d25 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -91,7 +91,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - # EMPTY = "".freeze + EMPTY = "".freeze # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb index 46907350..749c97a1 100644 --- a/lib/xero-ruby/models/accounting/account_type.rb +++ b/lib/xero-ruby/models/accounting/account_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb index 1d99d301..ef5ac715 100644 --- a/lib/xero-ruby/models/accounting/accounts.rb +++ b/lib/xero-ruby/models/accounting/accounts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb index 8959d3f6..0220c85b 100644 --- a/lib/xero-ruby/models/accounting/accounts_payable.rb +++ b/lib/xero-ruby/models/accounting/accounts_payable.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb index 98519270..d9692a35 100644 --- a/lib/xero-ruby/models/accounting/accounts_receivable.rb +++ b/lib/xero-ruby/models/accounting/accounts_receivable.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/action.rb b/lib/xero-ruby/models/accounting/action.rb new file mode 100644 index 00000000..f71dd035 --- /dev/null +++ b/lib/xero-ruby/models/accounting/action.rb @@ -0,0 +1,254 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + require 'bigdecimal' + + class Action + # Name of the actions for this organisation + attr_accessor :name + + # Status of the action for this organisation + attr_accessor :status + ALLOWED = "ALLOWED".freeze + NOT_ALLOWED = "NOT-ALLOWED".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'status' => :'Status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Action` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Action`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ALLOWED", "NOT-ALLOWED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ALLOWED", "NOT-ALLOWED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/actions.rb b/lib/xero-ruby/models/accounting/actions.rb new file mode 100644 index 00000000..6f9082ac --- /dev/null +++ b/lib/xero-ruby/models/accounting/actions.rb @@ -0,0 +1,210 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + require 'bigdecimal' + + class Actions + + attr_accessor :actions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'actions' => :'Actions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'actions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Actions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Actions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'actions') + if (value = attributes[:'actions']).is_a?(Array) + self.actions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + actions == o.actions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [actions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb index 3a9fe30e..9212ebb1 100644 --- a/lib/xero-ruby/models/accounting/address.rb +++ b/lib/xero-ruby/models/accounting/address.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb index 5ccdee18..09d3f598 100644 --- a/lib/xero-ruby/models/accounting/allocation.rb +++ b/lib/xero-ruby/models/accounting/allocation.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb index f109b35a..3fbfd9ff 100644 --- a/lib/xero-ruby/models/accounting/allocations.rb +++ b/lib/xero-ruby/models/accounting/allocations.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb index df2fb327..0b3239a3 100644 --- a/lib/xero-ruby/models/accounting/attachment.rb +++ b/lib/xero-ruby/models/accounting/attachment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb index 95c460d0..b9b14637 100644 --- a/lib/xero-ruby/models/accounting/attachments.rb +++ b/lib/xero-ruby/models/accounting/attachments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb index fa63f412..ccd5066d 100644 --- a/lib/xero-ruby/models/accounting/balances.rb +++ b/lib/xero-ruby/models/accounting/balances.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb index 93b6b220..fc838c51 100644 --- a/lib/xero-ruby/models/accounting/bank_transaction.rb +++ b/lib/xero-ruby/models/accounting/bank_transaction.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb index 72c4e76c..42e9a494 100644 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb index 3ffc0a9e..91497496 100644 --- a/lib/xero-ruby/models/accounting/bank_transfer.rb +++ b/lib/xero-ruby/models/accounting/bank_transfer.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb index 784b2251..b51570f3 100644 --- a/lib/xero-ruby/models/accounting/bank_transfers.rb +++ b/lib/xero-ruby/models/accounting/bank_transfers.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb index ac81ab88..e4114595 100644 --- a/lib/xero-ruby/models/accounting/batch_payment.rb +++ b/lib/xero-ruby/models/accounting/batch_payment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb index 5f338beb..1095bb68 100644 --- a/lib/xero-ruby/models/accounting/batch_payment_details.rb +++ b/lib/xero-ruby/models/accounting/batch_payment_details.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -95,10 +95,6 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if !@details.nil? && @details.to_s.length > 18 - invalid_properties.push('invalid value for "details", the character length must be smaller than or equal to 18.') - end - if !@code.nil? && @code.to_s.length > 12 invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 12.') end @@ -113,22 +109,11 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if !@details.nil? && @details.to_s.length > 18 return false if !@code.nil? && @code.to_s.length > 12 return false if !@reference.nil? && @reference.to_s.length > 12 true end - # Custom attribute writer method with validation - # @param [Object] details Value to be assigned - def details=(details) - if !details.nil? && details.to_s.length > 18 - fail ArgumentError, 'invalid value for "details", the character length must be smaller than or equal to 18.' - end - - @details = details - end - # Custom attribute writer method with validation # @param [Object] code Value to be assigned def code=(code) diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb index e923aa16..a1b4597d 100644 --- a/lib/xero-ruby/models/accounting/batch_payments.rb +++ b/lib/xero-ruby/models/accounting/batch_payments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb index 4708211e..aabe09d9 100644 --- a/lib/xero-ruby/models/accounting/bill.rb +++ b/lib/xero-ruby/models/accounting/bill.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb index f6c0e382..51e85fc3 100644 --- a/lib/xero-ruby/models/accounting/branding_theme.rb +++ b/lib/xero-ruby/models/accounting/branding_theme.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb index d1f49e6a..911807d4 100644 --- a/lib/xero-ruby/models/accounting/branding_themes.rb +++ b/lib/xero-ruby/models/accounting/branding_themes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb index 675b6ac8..9e3bd751 100644 --- a/lib/xero-ruby/models/accounting/cis_org_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_org_setting.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb index 83351d75..a89f924e 100644 --- a/lib/xero-ruby/models/accounting/cis_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_setting.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb index 035f5461..dafa67d5 100644 --- a/lib/xero-ruby/models/accounting/cis_settings.rb +++ b/lib/xero-ruby/models/accounting/cis_settings.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb index 83967fd4..8761b481 100644 --- a/lib/xero-ruby/models/accounting/contact.rb +++ b/lib/xero-ruby/models/accounting/contact.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb index 12585237..6a6e5901 100644 --- a/lib/xero-ruby/models/accounting/contact_group.rb +++ b/lib/xero-ruby/models/accounting/contact_group.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb index 90f15400..17a1fc91 100644 --- a/lib/xero-ruby/models/accounting/contact_groups.rb +++ b/lib/xero-ruby/models/accounting/contact_groups.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb index 8198f7b3..fd29faa5 100644 --- a/lib/xero-ruby/models/accounting/contact_person.rb +++ b/lib/xero-ruby/models/accounting/contact_person.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb index af22ab23..5aa1494b 100644 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb index 37b1ba26..4d6b244d 100644 --- a/lib/xero-ruby/models/accounting/country_code.rb +++ b/lib/xero-ruby/models/accounting/country_code.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb index e5d724bb..597c77f9 100644 --- a/lib/xero-ruby/models/accounting/credit_note.rb +++ b/lib/xero-ruby/models/accounting/credit_note.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb index 028da97d..c72c3f8c 100644 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb index 257ee058..7299e75d 100644 --- a/lib/xero-ruby/models/accounting/currencies.rb +++ b/lib/xero-ruby/models/accounting/currencies.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb index 10145836..3de06dd6 100644 --- a/lib/xero-ruby/models/accounting/currency.rb +++ b/lib/xero-ruby/models/accounting/currency.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb index ad985111..c80f8302 100644 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -156,7 +156,7 @@ class CurrencyCode TMT = "TMT".freeze TND = "TND".freeze TOP = "TOP".freeze - TRY = "TRY".freeze + _TRY = "TRY".freeze TTD = "TTD".freeze TVD = "TVD".freeze TWD = "TWD".freeze @@ -180,7 +180,7 @@ class CurrencyCode ZMW = "ZMW".freeze ZMK = "ZMK".freeze ZWD = "ZWD".freeze - EMPTY = "".freeze + _EMPTY = "".freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb index f3c76902..de63b8cc 100644 --- a/lib/xero-ruby/models/accounting/element.rb +++ b/lib/xero-ruby/models/accounting/element.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb index 375e2dab..e3681787 100644 --- a/lib/xero-ruby/models/accounting/employee.rb +++ b/lib/xero-ruby/models/accounting/employee.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb index b78cd521..f4fb4beb 100644 --- a/lib/xero-ruby/models/accounting/employees.rb +++ b/lib/xero-ruby/models/accounting/employees.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb index f5741813..f6e09112 100644 --- a/lib/xero-ruby/models/accounting/error.rb +++ b/lib/xero-ruby/models/accounting/error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb index b557d9bc..01d16285 100644 --- a/lib/xero-ruby/models/accounting/expense_claim.rb +++ b/lib/xero-ruby/models/accounting/expense_claim.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb index d8b63e13..ac1c8f3c 100644 --- a/lib/xero-ruby/models/accounting/expense_claims.rb +++ b/lib/xero-ruby/models/accounting/expense_claims.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb index 281ddffa..9175dc0e 100644 --- a/lib/xero-ruby/models/accounting/external_link.rb +++ b/lib/xero-ruby/models/accounting/external_link.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb index 727704c4..39326d0b 100644 --- a/lib/xero-ruby/models/accounting/history_record.rb +++ b/lib/xero-ruby/models/accounting/history_record.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb index 9ed25492..a64a3d87 100644 --- a/lib/xero-ruby/models/accounting/history_records.rb +++ b/lib/xero-ruby/models/accounting/history_records.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb index 3b90ff1d..268a5941 100644 --- a/lib/xero-ruby/models/accounting/invoice.rb +++ b/lib/xero-ruby/models/accounting/invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb index 1f71289f..827de7d6 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminder.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminder.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb index 64fc2694..827befbe 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminders.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminders.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb index 64261ed2..5d3b4cfb 100644 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb index 192912f0..08477b73 100644 --- a/lib/xero-ruby/models/accounting/item.rb +++ b/lib/xero-ruby/models/accounting/item.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb index f4d8b678..0a87592e 100644 --- a/lib/xero-ruby/models/accounting/items.rb +++ b/lib/xero-ruby/models/accounting/items.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb index ad07a999..6e8466ea 100644 --- a/lib/xero-ruby/models/accounting/journal.rb +++ b/lib/xero-ruby/models/accounting/journal.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb index ab2af422..edf1c19f 100644 --- a/lib/xero-ruby/models/accounting/journal_line.rb +++ b/lib/xero-ruby/models/accounting/journal_line.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb index 9b7419e2..a6df4bde 100644 --- a/lib/xero-ruby/models/accounting/journals.rb +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb index 093539e6..059eadb6 100644 --- a/lib/xero-ruby/models/accounting/line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/line_amount_types.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb index b8903e43..606dd56f 100644 --- a/lib/xero-ruby/models/accounting/line_item.rb +++ b/lib/xero-ruby/models/accounting/line_item.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb index bae12393..cb55fef2 100644 --- a/lib/xero-ruby/models/accounting/line_item_tracking.rb +++ b/lib/xero-ruby/models/accounting/line_item_tracking.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb index 09414f36..9c051f46 100644 --- a/lib/xero-ruby/models/accounting/linked_transaction.rb +++ b/lib/xero-ruby/models/accounting/linked_transaction.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb index 3ebb5c4c..e3bce7aa 100644 --- a/lib/xero-ruby/models/accounting/linked_transactions.rb +++ b/lib/xero-ruby/models/accounting/linked_transactions.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb index f403ca48..ee762e09 100644 --- a/lib/xero-ruby/models/accounting/manual_journal.rb +++ b/lib/xero-ruby/models/accounting/manual_journal.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb index e64356d7..f4546306 100644 --- a/lib/xero-ruby/models/accounting/manual_journal_line.rb +++ b/lib/xero-ruby/models/accounting/manual_journal_line.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb index ae8f823f..0e9ac4e3 100644 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb index b7547534..cc90daa9 100644 --- a/lib/xero-ruby/models/accounting/online_invoice.rb +++ b/lib/xero-ruby/models/accounting/online_invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb index b8dc853a..9e71e4cf 100644 --- a/lib/xero-ruby/models/accounting/online_invoices.rb +++ b/lib/xero-ruby/models/accounting/online_invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 703103d8..4079e329 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -114,7 +114,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - # NONE = "NONE".freeze + NONE = "NONE".freeze # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax @@ -136,18 +136,18 @@ class Organisation # Organisation Entity Type attr_accessor :organisation_entity_type - # ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze - # COMPANY = "COMPANY".freeze - # CHARITY = "CHARITY".freeze - # CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze - # LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze - # NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze - # PARTNERSHIP = "PARTNERSHIP".freeze - # S_CORPORATION = "S_CORPORATION".freeze - # SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze - # SOLE_TRADER = "SOLE_TRADER".freeze - # SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze - # TRUST = "TRUST".freeze + ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + COMPANY = "COMPANY".freeze + CHARITY = "CHARITY".freeze + CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + PARTNERSHIP = "PARTNERSHIP".freeze + S_CORPORATION = "S_CORPORATION".freeze + SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + SOLE_TRADER = "SOLE_TRADER".freeze + SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + TRUST = "TRUST".freeze # A unique identifier for the organisation. Potential uses. attr_accessor :short_code diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb index cd29b32a..8b8208b2 100644 --- a/lib/xero-ruby/models/accounting/organisations.rb +++ b/lib/xero-ruby/models/accounting/organisations.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb index 7983020e..7d1d6cc0 100644 --- a/lib/xero-ruby/models/accounting/overpayment.rb +++ b/lib/xero-ruby/models/accounting/overpayment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb index af0bb9ad..858b2adb 100644 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb index 6dbf078e..3941139d 100644 --- a/lib/xero-ruby/models/accounting/payment.rb +++ b/lib/xero-ruby/models/accounting/payment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb index cb607845..e4647059 100644 --- a/lib/xero-ruby/models/accounting/payment_delete.rb +++ b/lib/xero-ruby/models/accounting/payment_delete.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb index 4e330ac4..f610a686 100644 --- a/lib/xero-ruby/models/accounting/payment_service.rb +++ b/lib/xero-ruby/models/accounting/payment_service.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb index e25789fc..b6f24918 100644 --- a/lib/xero-ruby/models/accounting/payment_services.rb +++ b/lib/xero-ruby/models/accounting/payment_services.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb index 7f147f8d..64730935 100644 --- a/lib/xero-ruby/models/accounting/payment_term.rb +++ b/lib/xero-ruby/models/accounting/payment_term.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb index 67ceab61..81132e33 100644 --- a/lib/xero-ruby/models/accounting/payment_term_type.rb +++ b/lib/xero-ruby/models/accounting/payment_term_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb index 1a518b1e..de5fbfa2 100644 --- a/lib/xero-ruby/models/accounting/payments.rb +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb index a0ab5b6f..4d3bb3d3 100644 --- a/lib/xero-ruby/models/accounting/phone.rb +++ b/lib/xero-ruby/models/accounting/phone.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb index edd8a999..56cd222d 100644 --- a/lib/xero-ruby/models/accounting/prepayment.rb +++ b/lib/xero-ruby/models/accounting/prepayment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb index 3ebabad3..c38d1395 100644 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb index 18b56bca..1e0416d8 100644 --- a/lib/xero-ruby/models/accounting/purchase.rb +++ b/lib/xero-ruby/models/accounting/purchase.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb index 396560fc..1e4cc15e 100644 --- a/lib/xero-ruby/models/accounting/purchase_order.rb +++ b/lib/xero-ruby/models/accounting/purchase_order.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb index 9cd5af57..c0c6ef49 100644 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb index 4b928af7..ef218c02 100644 --- a/lib/xero-ruby/models/accounting/quote.rb +++ b/lib/xero-ruby/models/accounting/quote.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb index 31c9b7a1..bcd40372 100644 --- a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb index 1a66a627..229563be 100644 --- a/lib/xero-ruby/models/accounting/quote_status_codes.rb +++ b/lib/xero-ruby/models/accounting/quote_status_codes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb index d0ea6e5a..2e8e7a6b 100644 --- a/lib/xero-ruby/models/accounting/quotes.rb +++ b/lib/xero-ruby/models/accounting/quotes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb index 2e2657e2..2da935ce 100644 --- a/lib/xero-ruby/models/accounting/receipt.rb +++ b/lib/xero-ruby/models/accounting/receipt.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb index 38982d7d..53ee1838 100644 --- a/lib/xero-ruby/models/accounting/receipts.rb +++ b/lib/xero-ruby/models/accounting/receipts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb index e5ed6651..839b538c 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoice.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb index ee3c714a..bc6a37ff 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoices.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb index 49ea1a37..e174529a 100644 --- a/lib/xero-ruby/models/accounting/report.rb +++ b/lib/xero-ruby/models/accounting/report.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb index 2815c04c..a83accd2 100644 --- a/lib/xero-ruby/models/accounting/report_attribute.rb +++ b/lib/xero-ruby/models/accounting/report_attribute.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb index 176ef68b..1156e5e7 100644 --- a/lib/xero-ruby/models/accounting/report_cell.rb +++ b/lib/xero-ruby/models/accounting/report_cell.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb index 2ee60ccb..22dc3795 100644 --- a/lib/xero-ruby/models/accounting/report_fields.rb +++ b/lib/xero-ruby/models/accounting/report_fields.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb index 6614e212..65f5eb38 100644 --- a/lib/xero-ruby/models/accounting/report_row.rb +++ b/lib/xero-ruby/models/accounting/report_row.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb index 8610df44..33e72f69 100644 --- a/lib/xero-ruby/models/accounting/report_rows.rb +++ b/lib/xero-ruby/models/accounting/report_rows.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb index 5e2a1c7d..32cf6df6 100644 --- a/lib/xero-ruby/models/accounting/report_with_row.rb +++ b/lib/xero-ruby/models/accounting/report_with_row.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb index a7d108f0..2d966adc 100644 --- a/lib/xero-ruby/models/accounting/report_with_rows.rb +++ b/lib/xero-ruby/models/accounting/report_with_rows.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb index 285ee830..be80924d 100644 --- a/lib/xero-ruby/models/accounting/reports.rb +++ b/lib/xero-ruby/models/accounting/reports.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb index 98d39a99..e29029ef 100644 --- a/lib/xero-ruby/models/accounting/request_empty.rb +++ b/lib/xero-ruby/models/accounting/request_empty.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb index 75dca271..5e120bf2 100644 --- a/lib/xero-ruby/models/accounting/row_type.rb +++ b/lib/xero-ruby/models/accounting/row_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb index ab137612..34339e06 100644 --- a/lib/xero-ruby/models/accounting/sales_tracking_category.rb +++ b/lib/xero-ruby/models/accounting/sales_tracking_category.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb index 60287ef4..722103f8 100644 --- a/lib/xero-ruby/models/accounting/schedule.rb +++ b/lib/xero-ruby/models/accounting/schedule.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb index 1e9cc01a..b6e53a9b 100644 --- a/lib/xero-ruby/models/accounting/tax_component.rb +++ b/lib/xero-ruby/models/accounting/tax_component.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb index f06130f3..b20b439d 100644 --- a/lib/xero-ruby/models/accounting/tax_rate.rb +++ b/lib/xero-ruby/models/accounting/tax_rate.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb index ac8683bd..0349fb5a 100644 --- a/lib/xero-ruby/models/accounting/tax_rates.rb +++ b/lib/xero-ruby/models/accounting/tax_rates.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb index 124d65ee..718d93f3 100644 --- a/lib/xero-ruby/models/accounting/tax_type.rb +++ b/lib/xero-ruby/models/accounting/tax_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb index 605a694a..a6fbd608 100644 --- a/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +++ b/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb index 7391a08c..ed95e6ec 100644 --- a/lib/xero-ruby/models/accounting/time_zone.rb +++ b/lib/xero-ruby/models/accounting/time_zone.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb index 49590bbd..496174e1 100644 --- a/lib/xero-ruby/models/accounting/tracking_categories.rb +++ b/lib/xero-ruby/models/accounting/tracking_categories.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb index 10cf1d26..098aef36 100644 --- a/lib/xero-ruby/models/accounting/tracking_category.rb +++ b/lib/xero-ruby/models/accounting/tracking_category.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb index 53dfbc08..a7f1296d 100644 --- a/lib/xero-ruby/models/accounting/tracking_option.rb +++ b/lib/xero-ruby/models/accounting/tracking_option.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb index 1f398b5c..91ea7db1 100644 --- a/lib/xero-ruby/models/accounting/tracking_options.rb +++ b/lib/xero-ruby/models/accounting/tracking_options.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb index 47f4b768..b96c049c 100644 --- a/lib/xero-ruby/models/accounting/user.rb +++ b/lib/xero-ruby/models/accounting/user.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb index 576f3012..c90ca6f9 100644 --- a/lib/xero-ruby/models/accounting/users.rb +++ b/lib/xero-ruby/models/accounting/users.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb index f66f04a0..d2dad08e 100644 --- a/lib/xero-ruby/models/accounting/validation_error.rb +++ b/lib/xero-ruby/models/accounting/validation_error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb index 540e9b49..b269a950 100644 --- a/lib/xero-ruby/models/assets/asset.rb +++ b/lib/xero-ruby/models/assets/asset.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb index 8983d537..a264cb5a 100644 --- a/lib/xero-ruby/models/assets/asset_status.rb +++ b/lib/xero-ruby/models/assets/asset_status.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb index 3047e419..637244e6 100644 --- a/lib/xero-ruby/models/assets/asset_status_query_param.rb +++ b/lib/xero-ruby/models/assets/asset_status_query_param.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb index 19e5d140..fd61b98b 100644 --- a/lib/xero-ruby/models/assets/asset_type.rb +++ b/lib/xero-ruby/models/assets/asset_type.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb index 6638621d..896dc005 100644 --- a/lib/xero-ruby/models/assets/assets.rb +++ b/lib/xero-ruby/models/assets/assets.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb index 3f49fffb..2671cfb3 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_detail.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_detail.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb index cf4fc452..326d4e2d 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_setting.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb index 37ddb4a4..2b3c6525 100644 --- a/lib/xero-ruby/models/assets/error.rb +++ b/lib/xero-ruby/models/assets/error.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb index 292506db..e8114a61 100644 --- a/lib/xero-ruby/models/assets/field_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/field_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb index 2a4bb2d4..e7a1d12e 100644 --- a/lib/xero-ruby/models/assets/pagination.rb +++ b/lib/xero-ruby/models/assets/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb index 3efd6533..3dc625ba 100644 --- a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb index e6c5a45f..e62e5b03 100644 --- a/lib/xero-ruby/models/assets/setting.rb +++ b/lib/xero-ruby/models/assets/setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/association.rb b/lib/xero-ruby/models/files/association.rb new file mode 100644 index 00000000..32c248c6 --- /dev/null +++ b/lib/xero-ruby/models/files/association.rb @@ -0,0 +1,238 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class Association + # The unique identifier of the file + attr_accessor :file_id + + # The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) + attr_accessor :object_id + + + attr_accessor :object_group + + + attr_accessor :object_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file_id' => :'FileId', + :'object_id' => :'ObjectId', + :'object_group' => :'ObjectGroup', + :'object_type' => :'ObjectType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'file_id' => :'String', + :'object_id' => :'String', + :'object_group' => :'ObjectGroup', + :'object_type' => :'ObjectType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::Association` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::Association`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'file_id') + self.file_id = attributes[:'file_id'] + end + + if attributes.key?(:'object_id') + self.object_id = attributes[:'object_id'] + end + + if attributes.key?(:'object_group') + self.object_group = attributes[:'object_group'] + end + + if attributes.key?(:'object_type') + self.object_type = attributes[:'object_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file_id == o.file_id && + object_id == o.object_id && + object_group == o.object_group && + object_type == o.object_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [file_id, object_id, object_group, object_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/file_object.rb b/lib/xero-ruby/models/files/file_object.rb new file mode 100644 index 00000000..eb842a22 --- /dev/null +++ b/lib/xero-ruby/models/files/file_object.rb @@ -0,0 +1,278 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class FileObject + # TODO + attr_accessor :name + + # TODO + attr_accessor :mime_type + + # TODO + attr_accessor :size + + # TODO + attr_accessor :created_date_utc + + # TODO + attr_accessor :updated_date_utc + + + attr_accessor :user + + # TODO + attr_accessor :id + + # TODO + attr_accessor :folder_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'mime_type' => :'MimeType', + :'size' => :'Size', + :'created_date_utc' => :'CreatedDateUTC', + :'updated_date_utc' => :'UpdatedDateUTC', + :'user' => :'User', + :'id' => :'Id', + :'folder_id' => :'FolderId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'mime_type' => :'String', + :'size' => :'Integer', + :'created_date_utc' => :'DateTime', + :'updated_date_utc' => :'DateTime', + :'user' => :'User', + :'id' => :'String', + :'folder_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::FileObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::FileObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'mime_type') + self.mime_type = attributes[:'mime_type'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + mime_type == o.mime_type && + size == o.size && + created_date_utc == o.created_date_utc && + updated_date_utc == o.updated_date_utc && + user == o.user && + id == o.id && + folder_id == o.folder_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, mime_type, size, created_date_utc, updated_date_utc, user, id, folder_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/file_response204.rb b/lib/xero-ruby/models/files/file_response204.rb new file mode 100644 index 00000000..2fa07e21 --- /dev/null +++ b/lib/xero-ruby/models/files/file_response204.rb @@ -0,0 +1,208 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class FileResponse204 + # Status response for 204 no content + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'Status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::FileResponse204` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::FileResponse204`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/files.rb b/lib/xero-ruby/models/files/files.rb new file mode 100644 index 00000000..d46fd9e1 --- /dev/null +++ b/lib/xero-ruby/models/files/files.rb @@ -0,0 +1,240 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class Files + + attr_accessor :total_count + + + attr_accessor :page + + + attr_accessor :per_page + + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_count' => :'TotalCount', + :'page' => :'Page', + :'per_page' => :'PerPage', + :'items' => :'Items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'total_count' => :'Integer', + :'page' => :'Integer', + :'per_page' => :'Integer', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::Files` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::Files`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'per_page') + self.per_page = attributes[:'per_page'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + page == o.page && + per_page == o.per_page && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [total_count, page, per_page, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/folder.rb b/lib/xero-ruby/models/files/folder.rb new file mode 100644 index 00000000..2c1766dd --- /dev/null +++ b/lib/xero-ruby/models/files/folder.rb @@ -0,0 +1,248 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class Folder + # The name of the folder + attr_accessor :name + + # The number of files in the folder + attr_accessor :file_count + + # The email address used to email files to the inbox. Only the inbox will have this element. + attr_accessor :email + + # to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. + attr_accessor :is_inbox + + # Xero unique identifier for a folder Files + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'file_count' => :'FileCount', + :'email' => :'Email', + :'is_inbox' => :'IsInbox', + :'id' => :'Id' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'file_count' => :'Integer', + :'email' => :'String', + :'is_inbox' => :'Boolean', + :'id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::Folder` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::Folder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'file_count') + self.file_count = attributes[:'file_count'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'is_inbox') + self.is_inbox = attributes[:'is_inbox'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + file_count == o.file_count && + email == o.email && + is_inbox == o.is_inbox && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, file_count, email, is_inbox, id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/folders.rb b/lib/xero-ruby/models/files/folders.rb new file mode 100644 index 00000000..3505844d --- /dev/null +++ b/lib/xero-ruby/models/files/folders.rb @@ -0,0 +1,210 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class Folders + + attr_accessor :folders + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'folders' => :'Folders' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'folders' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::Folders` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::Folders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'folders') + if (value = attributes[:'folders']).is_a?(Array) + self.folders = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + folders == o.folders + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [folders].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/inline_object.rb b/lib/xero-ruby/models/files/inline_object.rb new file mode 100644 index 00000000..8a2c9258 --- /dev/null +++ b/lib/xero-ruby/models/files/inline_object.rb @@ -0,0 +1,238 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class InlineObject + + attr_accessor :body + + # exact name of the file you are uploading + attr_accessor :name + + + attr_accessor :filename + + + attr_accessor :mime_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'body' => :'body', + :'name' => :'name', + :'filename' => :'filename', + :'mime_type' => :'mimeType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'body' => :'String', + :'name' => :'String', + :'filename' => :'String', + :'mime_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::InlineObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'body') + self.body = attributes[:'body'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + + if attributes.key?(:'mime_type') + self.mime_type = attributes[:'mime_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + body == o.body && + name == o.name && + filename == o.filename && + mime_type == o.mime_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [body, name, filename, mime_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/files/object_group.rb b/lib/xero-ruby/models/files/object_group.rb new file mode 100644 index 00000000..46fe2119 --- /dev/null +++ b/lib/xero-ruby/models/files/object_group.rb @@ -0,0 +1,46 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + class ObjectGroup + ACCOUNT = "Account".freeze + BANK_TRANSACTION = "BankTransaction".freeze + CONTACT = "Contact".freeze + CREDIT_NOTE = "CreditNote".freeze + INVOICE = "Invoice".freeze + ITEM = "Item".freeze + MANUAL_JOURNAL = "ManualJournal".freeze + OVERPAYMENT = "Overpayment".freeze + PAYMENT = "Payment".freeze + PREPAYMENT = "Prepayment".freeze + RECEIPT = "Receipt".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ObjectGroup.constants.select { |c| ObjectGroup::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ObjectGroup" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/files/object_type.rb b/lib/xero-ruby/models/files/object_type.rb new file mode 100644 index 00000000..04546050 --- /dev/null +++ b/lib/xero-ruby/models/files/object_type.rb @@ -0,0 +1,68 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + class ObjectType + ACCOUNT = "ACCOUNT".freeze + ACCPAY = "ACCPAY".freeze + ACCPAYCREDIT = "ACCPAYCREDIT".freeze + ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze + ACCREC = "ACCREC".freeze + ACCRECCREDIT = "ACCRECCREDIT".freeze + ACCRECPAYMENT = "ACCRECPAYMENT".freeze + ADJUSTMENT = "ADJUSTMENT".freeze + APCREDITPAYMENT = "APCREDITPAYMENT".freeze + APOVERPAYMENT = "APOVERPAYMENT".freeze + APOVERPAYMENTPAYMENT = "APOVERPAYMENTPAYMENT".freeze + APOVERPAYMENTSOURCEPAYMENT = "APOVERPAYMENTSOURCEPAYMENT".freeze + APPREPAYMENT = "APPREPAYMENT".freeze + APPREPAYMENTPAYMENT = "APPREPAYMENTPAYMENT".freeze + APPREPAYMENTSOURCEPAYMENT = "APPREPAYMENTSOURCEPAYMENT".freeze + ARCREDITPAYMENT = "ARCREDITPAYMENT".freeze + AROVERPAYMENT = "AROVERPAYMENT".freeze + AROVERPAYMENTPAYMENT = "AROVERPAYMENTPAYMENT".freeze + AROVERPAYMENTSOURCEPAYMENT = "AROVERPAYMENTSOURCEPAYMENT".freeze + ARPREPAYMENT = "ARPREPAYMENT".freeze + ARPREPAYMENTPAYMENT = "ARPREPAYMENTPAYMENT".freeze + ARPREPAYMENTSOURCEPAYMENT = "ARPREPAYMENTSOURCEPAYMENT".freeze + CASHPAID = "CASHPAID".freeze + CASHREC = "CASHREC".freeze + CONTACT = "CONTACT".freeze + EXPPAYMENT = "EXPPAYMENT".freeze + FIXEDASSET = "FIXEDASSET".freeze + MANUALJOURNAL = "MANUALJOURNAL".freeze + PAYRUN = "PAYRUN".freeze + PRICELISTITEM = "PRICELISTITEM".freeze + PURCHASEORDER = "PURCHASEORDER".freeze + RECEIPT = "RECEIPT".freeze + TRANSFER = "TRANSFER".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ObjectType.constants.select { |c| ObjectType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ObjectType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/files/user.rb b/lib/xero-ruby/models/files/user.rb new file mode 100644 index 00000000..a74507f5 --- /dev/null +++ b/lib/xero-ruby/models/files/user.rb @@ -0,0 +1,318 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Files + require 'bigdecimal' + + class User + # Xero identifier + attr_accessor :user_id + + # Email address of user + attr_accessor :email_address + + # First name of user + attr_accessor :first_name + + # Last name of user + attr_accessor :last_name + + # Last name of user + attr_accessor :updated_date_utc + + # Boolean to indicate if user is the subscriber + attr_accessor :is_subscriber + + # Boolean to indicate if user is the subscriber + attr_accessor :organisation_role + READONLY = "READONLY".freeze + INVOICEONLY = "INVOICEONLY".freeze + STANDARD = "STANDARD".freeze + FINANCIALADVISER = "FINANCIALADVISER".freeze + MANAGEDCLIENT = "MANAGEDCLIENT".freeze + CASHBOOKCLIENT = "CASHBOOKCLIENT".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'UserID', + :'email_address' => :'EmailAddress', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'updated_date_utc' => :'UpdatedDateUTC', + :'is_subscriber' => :'IsSubscriber', + :'organisation_role' => :'OrganisationRole' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'email_address' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'updated_date_utc' => :'DateTime', + :'is_subscriber' => :'Boolean', + :'organisation_role' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Files::User` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Files::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_subscriber') + self.is_subscriber = attributes[:'is_subscriber'] + end + + if attributes.key?(:'organisation_role') + self.organisation_role = attributes[:'organisation_role'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @first_name.nil? + invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') + end + + if @last_name.nil? + invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @first_name.nil? + return false if @last_name.nil? + organisation_role_validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT"]) + return false unless organisation_role_validator.valid?(@organisation_role) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] organisation_role Object to be assigned + def organisation_role=(organisation_role) + validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT"]) + unless validator.valid?(organisation_role) + fail ArgumentError, "invalid value for \"organisation_role\", must be one of #{validator.allowable_values}." + end + @organisation_role = organisation_role + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + email_address == o.email_address && + first_name == o.first_name && + last_name == o.last_name && + updated_date_utc == o.updated_date_utc && + is_subscriber == o.is_subscriber && + organisation_role == o.organisation_role + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, email_address, first_name, last_name, updated_date_utc, is_subscriber, organisation_role].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Files.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/account.rb b/lib/xero-ruby/models/payroll_au/account.rb new file mode 100644 index 00000000..33ba1597 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/account.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Account + # Xero identifier for accounts + attr_accessor :account_id + + + attr_accessor :type + + # Customer defined account code + attr_accessor :code + + # Name of account + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_id' => :'AccountID', + :'type' => :'Type', + :'code' => :'Code', + :'name' => :'Name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_id' => :'String', + :'type' => :'AccountType', + :'code' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Account` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + type == o.type && + code == o.code && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_id, type, code, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/account_type.rb b/lib/xero-ruby/models/payroll_au/account_type.rb new file mode 100644 index 00000000..c9307ce5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/account_type.rb @@ -0,0 +1,58 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class AccountType + BANK = "BANK".freeze + CURRENT = "CURRENT".freeze + CURRLIAB = "CURRLIAB".freeze + DEPRECIATN = "DEPRECIATN".freeze + DIRECTCOSTS = "DIRECTCOSTS".freeze + EQUITY = "EQUITY".freeze + EXPENSE = "EXPENSE".freeze + FIXED = "FIXED".freeze + INVENTORY = "INVENTORY".freeze + LIABILITY = "LIABILITY".freeze + NONCURRENT = "NONCURRENT".freeze + OTHERINCOME = "OTHERINCOME".freeze + OVERHEADS = "OVERHEADS".freeze + PREPAYMENT = "PREPAYMENT".freeze + REVENUE = "REVENUE".freeze + SALES = "SALES".freeze + TERMLIAB = "TERMLIAB".freeze + PAYGLIABILITY = "PAYGLIABILITY".freeze + PAYG = "PAYG".freeze + SUPERANNUATIONEXPENSE = "SUPERANNUATIONEXPENSE".freeze + SUPERANNUATIONLIABILITY = "SUPERANNUATIONLIABILITY".freeze + WAGESEXPENSE = "WAGESEXPENSE".freeze + WAGESPAYABLELIABILITY = "WAGESPAYABLELIABILITY".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AccountType.constants.select { |c| AccountType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AccountType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/allowance_type.rb b/lib/xero-ruby/models/payroll_au/allowance_type.rb new file mode 100644 index 00000000..1c8ddb45 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/allowance_type.rb @@ -0,0 +1,42 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class AllowanceType + CAR = "CAR".freeze + TRANSPORT = "TRANSPORT".freeze + TRAVEL = "TRAVEL".freeze + LAUNDRY = "LAUNDRY".freeze + MEALS = "MEALS".freeze + JOBKEEPER = "JOBKEEPER".freeze + OTHER = "OTHER".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AllowanceType.constants.select { |c| AllowanceType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AllowanceType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/api_exception.rb b/lib/xero-ruby/models/payroll_au/api_exception.rb new file mode 100644 index 00000000..4d8fb8dc --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/api_exception.rb @@ -0,0 +1,229 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # The object returned for a bad request + require 'bigdecimal' + + class APIException + # The error number + attr_accessor :error_number + + # The type of error + attr_accessor :type + + # The message describing the error + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error_number' => :'ErrorNumber', + :'type' => :'Type', + :'message' => :'Message' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'error_number' => :'Float', + :'type' => :'String', + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::APIException` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::APIException`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error_number') + self.error_number = attributes[:'error_number'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_number == o.error_number && + type == o.type && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error_number, type, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/bank_account.rb b/lib/xero-ruby/models/payroll_au/bank_account.rb new file mode 100644 index 00000000..b099f00b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/bank_account.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class BankAccount + # The text that will appear on your employee's bank statement when they receive payment + attr_accessor :statement_text + + # The name of the account + attr_accessor :account_name + + # The BSB number of the account + attr_accessor :bsb + + # The account number + attr_accessor :account_number + + # If this account is the Remaining bank account + attr_accessor :remainder + + # Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + attr_accessor :amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statement_text' => :'StatementText', + :'account_name' => :'AccountName', + :'bsb' => :'BSB', + :'account_number' => :'AccountNumber', + :'remainder' => :'Remainder', + :'amount' => :'Amount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statement_text' => :'String', + :'account_name' => :'String', + :'bsb' => :'String', + :'account_number' => :'String', + :'remainder' => :'Boolean', + :'amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::BankAccount` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::BankAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statement_text') + self.statement_text = attributes[:'statement_text'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'bsb') + self.bsb = attributes[:'bsb'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'remainder') + self.remainder = attributes[:'remainder'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statement_text == o.statement_text && + account_name == o.account_name && + bsb == o.bsb && + account_number == o.account_number && + remainder == o.remainder && + amount == o.amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statement_text, account_name, bsb, account_number, remainder, amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/calendar_type.rb b/lib/xero-ruby/models/payroll_au/calendar_type.rb new file mode 100644 index 00000000..e3f6af72 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/calendar_type.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class CalendarType + WEEKLY = "WEEKLY".freeze + FORTNIGHTLY = "FORTNIGHTLY".freeze + FOURWEEKLY = "FOURWEEKLY".freeze + MONTHLY = "MONTHLY".freeze + TWICEMONTHLY = "TWICEMONTHLY".freeze + QUARTERLY = "QUARTERLY".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CalendarType.constants.select { |c| CalendarType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CalendarType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/deduction_line.rb b/lib/xero-ruby/models/payroll_au/deduction_line.rb new file mode 100644 index 00000000..0dace00f --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/deduction_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class DeductionLine + # Xero deduction type identifier + attr_accessor :deduction_type_id + + + attr_accessor :calculation_type + + # Deduction type amount + attr_accessor :amount + + # The Percentage of the Deduction + attr_accessor :percentage + + # Deduction number of units + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deduction_type_id' => :'DeductionTypeID', + :'calculation_type' => :'CalculationType', + :'amount' => :'Amount', + :'percentage' => :'Percentage', + :'number_of_units' => :'NumberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'deduction_type_id' => :'String', + :'calculation_type' => :'DeductionTypeCalculationType', + :'amount' => :'BigDecimal', + :'percentage' => :'BigDecimal', + :'number_of_units' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::DeductionLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::DeductionLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deduction_type_id') + self.deduction_type_id = attributes[:'deduction_type_id'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @deduction_type_id.nil? + invalid_properties.push('invalid value for "deduction_type_id", deduction_type_id cannot be nil.') + end + + if @calculation_type.nil? + invalid_properties.push('invalid value for "calculation_type", calculation_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @deduction_type_id.nil? + return false if @calculation_type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deduction_type_id == o.deduction_type_id && + calculation_type == o.calculation_type && + amount == o.amount && + percentage == o.percentage && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deduction_type_id, calculation_type, amount, percentage, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/deduction_type.rb b/lib/xero-ruby/models/payroll_au/deduction_type.rb new file mode 100644 index 00000000..f177a754 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/deduction_type.rb @@ -0,0 +1,340 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class DeductionType + # Name of the earnings rate (max length = 100) + attr_accessor :name + + # See Accounts + attr_accessor :account_code + + # Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. + attr_accessor :reduces_tax + + # Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. + attr_accessor :reduces_super + + # Boolean to determine if the deduction type is reportable or exempt from W1 + attr_accessor :is_exempt_from_w1 + + # Xero identifier + attr_accessor :deduction_type_id + + # Last modified timestamp + attr_accessor :updated_date_utc + + + attr_accessor :deduction_category + NONE = "NONE".freeze + UNIONFEES = "UNIONFEES".freeze + WORKPLACEGIVING = "WORKPLACEGIVING".freeze + + # Is the current record + attr_accessor :current_record + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'account_code' => :'AccountCode', + :'reduces_tax' => :'ReducesTax', + :'reduces_super' => :'ReducesSuper', + :'is_exempt_from_w1' => :'IsExemptFromW1', + :'deduction_type_id' => :'DeductionTypeID', + :'updated_date_utc' => :'UpdatedDateUTC', + :'deduction_category' => :'DeductionCategory', + :'current_record' => :'CurrentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'account_code' => :'String', + :'reduces_tax' => :'Boolean', + :'reduces_super' => :'Boolean', + :'is_exempt_from_w1' => :'Boolean', + :'deduction_type_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'deduction_category' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::DeductionType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::DeductionType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'reduces_tax') + self.reduces_tax = attributes[:'reduces_tax'] + end + + if attributes.key?(:'reduces_super') + self.reduces_super = attributes[:'reduces_super'] + end + + if attributes.key?(:'is_exempt_from_w1') + self.is_exempt_from_w1 = attributes[:'is_exempt_from_w1'] + end + + if attributes.key?(:'deduction_type_id') + self.deduction_type_id = attributes[:'deduction_type_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'deduction_category') + self.deduction_category = attributes[:'deduction_category'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + deduction_category_validator = EnumAttributeValidator.new('String', ["NONE", "UNIONFEES", "WORKPLACEGIVING"]) + return false unless deduction_category_validator.valid?(@deduction_category) + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deduction_category Object to be assigned + def deduction_category=(deduction_category) + validator = EnumAttributeValidator.new('String', ["NONE", "UNIONFEES", "WORKPLACEGIVING"]) + unless validator.valid?(deduction_category) + fail ArgumentError, "invalid value for \"deduction_category\", must be one of #{validator.allowable_values}." + end + @deduction_category = deduction_category + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + account_code == o.account_code && + reduces_tax == o.reduces_tax && + reduces_super == o.reduces_super && + is_exempt_from_w1 == o.is_exempt_from_w1 && + deduction_type_id == o.deduction_type_id && + updated_date_utc == o.updated_date_utc && + deduction_category == o.deduction_category && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, account_code, reduces_tax, reduces_super, is_exempt_from_w1, deduction_type_id, updated_date_utc, deduction_category, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb b/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb new file mode 100644 index 00000000..22cbd254 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb @@ -0,0 +1,38 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class DeductionTypeCalculationType + FIXEDAMOUNT = "FIXEDAMOUNT".freeze + PRETAX = "PRETAX".freeze + POSTTAX = "POSTTAX".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = DeductionTypeCalculationType.constants.select { |c| DeductionTypeCalculationType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #DeductionTypeCalculationType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/earnings_line.rb b/lib/xero-ruby/models/payroll_au/earnings_line.rb new file mode 100644 index 00000000..8286595b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/earnings_line.rb @@ -0,0 +1,293 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class EarningsLine + # Xero unique id for earnings rate + attr_accessor :earnings_rate_id + + + attr_accessor :calculation_type + + # Annual salary for earnings line + attr_accessor :annual_salary + + # number of units for earning line + attr_accessor :number_of_units_per_week + + # Rate per unit of the EarningsLine. + attr_accessor :rate_per_unit + + # Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" + attr_accessor :normal_number_of_units + + # Earnings rate amount + attr_accessor :amount + + # Earnings rate number of units. + attr_accessor :number_of_units + + # Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'EarningsRateID', + :'calculation_type' => :'CalculationType', + :'annual_salary' => :'AnnualSalary', + :'number_of_units_per_week' => :'NumberOfUnitsPerWeek', + :'rate_per_unit' => :'RatePerUnit', + :'normal_number_of_units' => :'NormalNumberOfUnits', + :'amount' => :'Amount', + :'number_of_units' => :'NumberOfUnits', + :'fixed_amount' => :'FixedAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'calculation_type' => :'EarningsRateCalculationType', + :'annual_salary' => :'BigDecimal', + :'number_of_units_per_week' => :'BigDecimal', + :'rate_per_unit' => :'BigDecimal', + :'normal_number_of_units' => :'BigDecimal', + :'amount' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::EarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::EarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'annual_salary') + self.annual_salary = attributes[:'annual_salary'] + end + + if attributes.key?(:'number_of_units_per_week') + self.number_of_units_per_week = attributes[:'number_of_units_per_week'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'normal_number_of_units') + self.normal_number_of_units = attributes[:'normal_number_of_units'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @earnings_rate_id.nil? + invalid_properties.push('invalid value for "earnings_rate_id", earnings_rate_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @earnings_rate_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + calculation_type == o.calculation_type && + annual_salary == o.annual_salary && + number_of_units_per_week == o.number_of_units_per_week && + rate_per_unit == o.rate_per_unit && + normal_number_of_units == o.normal_number_of_units && + amount == o.amount && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, calculation_type, annual_salary, number_of_units_per_week, rate_per_unit, normal_number_of_units, amount, number_of_units, fixed_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/earnings_rate.rb b/lib/xero-ruby/models/payroll_au/earnings_rate.rb new file mode 100644 index 00000000..8394a280 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/earnings_rate.rb @@ -0,0 +1,398 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class EarningsRate + # Name of the earnings rate (max length = 100) + attr_accessor :name + + # See Accounts + attr_accessor :account_code + + # Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + attr_accessor :type_of_units + + # Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding + attr_accessor :is_exempt_from_tax + + # See the ATO website for details of which payments are exempt from SGC + attr_accessor :is_exempt_from_super + + # Boolean to determine if the earnings rate is reportable or exempt from W1 + attr_accessor :is_reportable_as_w1 + + + attr_accessor :earnings_type + + # Xero identifier + attr_accessor :earnings_rate_id + + + attr_accessor :rate_type + + # Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. + attr_accessor :rate_per_unit + + # This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + attr_accessor :multiplier + + # Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE + attr_accessor :accrue_leave + + # Optional Amount for FIXEDAMOUNT RateType EarningsRate + attr_accessor :amount + + + attr_accessor :employment_termination_payment_type + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Is the current record + attr_accessor :current_record + + + attr_accessor :allowance_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'account_code' => :'AccountCode', + :'type_of_units' => :'TypeOfUnits', + :'is_exempt_from_tax' => :'IsExemptFromTax', + :'is_exempt_from_super' => :'IsExemptFromSuper', + :'is_reportable_as_w1' => :'IsReportableAsW1', + :'earnings_type' => :'EarningsType', + :'earnings_rate_id' => :'EarningsRateID', + :'rate_type' => :'RateType', + :'rate_per_unit' => :'RatePerUnit', + :'multiplier' => :'Multiplier', + :'accrue_leave' => :'AccrueLeave', + :'amount' => :'Amount', + :'employment_termination_payment_type' => :'EmploymentTerminationPaymentType', + :'updated_date_utc' => :'UpdatedDateUTC', + :'current_record' => :'CurrentRecord', + :'allowance_type' => :'AllowanceType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'account_code' => :'String', + :'type_of_units' => :'String', + :'is_exempt_from_tax' => :'Boolean', + :'is_exempt_from_super' => :'Boolean', + :'is_reportable_as_w1' => :'Boolean', + :'earnings_type' => :'EarningsType', + :'earnings_rate_id' => :'String', + :'rate_type' => :'RateType', + :'rate_per_unit' => :'String', + :'multiplier' => :'BigDecimal', + :'accrue_leave' => :'Boolean', + :'amount' => :'BigDecimal', + :'employment_termination_payment_type' => :'EmploymentTerminationPaymentType', + :'updated_date_utc' => :'DateTime', + :'current_record' => :'Boolean', + :'allowance_type' => :'AllowanceType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::EarningsRate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::EarningsRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + + if attributes.key?(:'is_exempt_from_tax') + self.is_exempt_from_tax = attributes[:'is_exempt_from_tax'] + end + + if attributes.key?(:'is_exempt_from_super') + self.is_exempt_from_super = attributes[:'is_exempt_from_super'] + end + + if attributes.key?(:'is_reportable_as_w1') + self.is_reportable_as_w1 = attributes[:'is_reportable_as_w1'] + end + + if attributes.key?(:'earnings_type') + self.earnings_type = attributes[:'earnings_type'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'rate_type') + self.rate_type = attributes[:'rate_type'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'multiplier') + self.multiplier = attributes[:'multiplier'] + end + + if attributes.key?(:'accrue_leave') + self.accrue_leave = attributes[:'accrue_leave'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'employment_termination_payment_type') + self.employment_termination_payment_type = attributes[:'employment_termination_payment_type'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'allowance_type') + self.allowance_type = attributes[:'allowance_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + if !@type_of_units.nil? && @type_of_units.to_s.length > 50 + invalid_properties.push('invalid value for "type_of_units", the character length must be smaller than or equal to 50.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + return false if !@type_of_units.nil? && @type_of_units.to_s.length > 50 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] type_of_units Value to be assigned + def type_of_units=(type_of_units) + if !type_of_units.nil? && type_of_units.to_s.length > 50 + fail ArgumentError, 'invalid value for "type_of_units", the character length must be smaller than or equal to 50.' + end + + @type_of_units = type_of_units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + account_code == o.account_code && + type_of_units == o.type_of_units && + is_exempt_from_tax == o.is_exempt_from_tax && + is_exempt_from_super == o.is_exempt_from_super && + is_reportable_as_w1 == o.is_reportable_as_w1 && + earnings_type == o.earnings_type && + earnings_rate_id == o.earnings_rate_id && + rate_type == o.rate_type && + rate_per_unit == o.rate_per_unit && + multiplier == o.multiplier && + accrue_leave == o.accrue_leave && + amount == o.amount && + employment_termination_payment_type == o.employment_termination_payment_type && + updated_date_utc == o.updated_date_utc && + current_record == o.current_record && + allowance_type == o.allowance_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, account_code, type_of_units, is_exempt_from_tax, is_exempt_from_super, is_reportable_as_w1, earnings_type, earnings_rate_id, rate_type, rate_per_unit, multiplier, accrue_leave, amount, employment_termination_payment_type, updated_date_utc, current_record, allowance_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb b/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb new file mode 100644 index 00000000..5274ba61 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb @@ -0,0 +1,38 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EarningsRateCalculationType + USEEARNINGSRATE = "USEEARNINGSRATE".freeze + ENTEREARNINGSRATE = "ENTEREARNINGSRATE".freeze + ANNUALSALARY = "ANNUALSALARY".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EarningsRateCalculationType.constants.select { |c| EarningsRateCalculationType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EarningsRateCalculationType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/earnings_type.rb b/lib/xero-ruby/models/payroll_au/earnings_type.rb new file mode 100644 index 00000000..1d24f301 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/earnings_type.rb @@ -0,0 +1,44 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EarningsType + FIXED = "FIXED".freeze + ORDINARYTIMEEARNINGS = "ORDINARYTIMEEARNINGS".freeze + OVERTIMEEARNINGS = "OVERTIMEEARNINGS".freeze + ALLOWANCE = "ALLOWANCE".freeze + LUMPSUMD = "LUMPSUMD".freeze + EMPLOYMENTTERMINATIONPAYMENT = "EMPLOYMENTTERMINATIONPAYMENT".freeze + LUMPSUMA = "LUMPSUMA".freeze + LUMPSUMB = "LUMPSUMB".freeze + BONUSESANDCOMMISSIONS = "BONUSESANDCOMMISSIONS".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EarningsType.constants.select { |c| EarningsType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EarningsType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/employee.rb b/lib/xero-ruby/models/payroll_au/employee.rb new file mode 100644 index 00000000..e7f7b064 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/employee.rb @@ -0,0 +1,571 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Employee + # First name of employee + attr_accessor :first_name + + # Last name of employee + attr_accessor :last_name + + # Date of birth of the employee (YYYY-MM-DD) + attr_accessor :date_of_birth + + + attr_accessor :home_address + + # Start date for an employee (YYYY-MM-DD) + attr_accessor :start_date + + # Title of the employee + attr_accessor :title + + # Middle name(s) of the employee + attr_accessor :middle_names + + # The email address for the employee + attr_accessor :email + + # The employee’s gender. See Employee Gender + attr_accessor :gender + N = "N".freeze + M = "M".freeze + F = "F".freeze + I = "I".freeze + + # Employee phone number + attr_accessor :phone + + # Employee mobile number + attr_accessor :mobile + + # Employee’s twitter name + attr_accessor :twitter_user_name + + # Authorised to approve other employees' leave requests + attr_accessor :is_authorised_to_approve_leave + + # Authorised to approve timesheets + attr_accessor :is_authorised_to_approve_timesheets + + # JobTitle of the employee + attr_accessor :job_title + + # Employees classification + attr_accessor :classification + + # Xero unique identifier for earnings rate + attr_accessor :ordinary_earnings_rate_id + + # Xero unique identifier for payroll calendar for the employee + attr_accessor :payroll_calendar_id + + # The Employee Group allows you to report on payroll expenses and liabilities for each group of employees + attr_accessor :employee_group_name + + # Xero unique identifier for an Employee + attr_accessor :employee_id + + # Employee Termination Date (YYYY-MM-DD) + attr_accessor :termination_date + + + attr_accessor :bank_accounts + + + attr_accessor :pay_template + + + attr_accessor :opening_balances + + + attr_accessor :tax_declaration + + + attr_accessor :leave_balances + + + attr_accessor :leave_lines + + + attr_accessor :super_memberships + + + attr_accessor :status + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'date_of_birth' => :'DateOfBirth', + :'home_address' => :'HomeAddress', + :'start_date' => :'StartDate', + :'title' => :'Title', + :'middle_names' => :'MiddleNames', + :'email' => :'Email', + :'gender' => :'Gender', + :'phone' => :'Phone', + :'mobile' => :'Mobile', + :'twitter_user_name' => :'TwitterUserName', + :'is_authorised_to_approve_leave' => :'IsAuthorisedToApproveLeave', + :'is_authorised_to_approve_timesheets' => :'IsAuthorisedToApproveTimesheets', + :'job_title' => :'JobTitle', + :'classification' => :'Classification', + :'ordinary_earnings_rate_id' => :'OrdinaryEarningsRateID', + :'payroll_calendar_id' => :'PayrollCalendarID', + :'employee_group_name' => :'EmployeeGroupName', + :'employee_id' => :'EmployeeID', + :'termination_date' => :'TerminationDate', + :'bank_accounts' => :'BankAccounts', + :'pay_template' => :'PayTemplate', + :'opening_balances' => :'OpeningBalances', + :'tax_declaration' => :'TaxDeclaration', + :'leave_balances' => :'LeaveBalances', + :'leave_lines' => :'LeaveLines', + :'super_memberships' => :'SuperMemberships', + :'status' => :'Status', + :'updated_date_utc' => :'UpdatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'first_name' => :'String', + :'last_name' => :'String', + :'date_of_birth' => :'Date', + :'home_address' => :'HomeAddress', + :'start_date' => :'Date', + :'title' => :'String', + :'middle_names' => :'String', + :'email' => :'String', + :'gender' => :'String', + :'phone' => :'String', + :'mobile' => :'String', + :'twitter_user_name' => :'String', + :'is_authorised_to_approve_leave' => :'Boolean', + :'is_authorised_to_approve_timesheets' => :'Boolean', + :'job_title' => :'String', + :'classification' => :'String', + :'ordinary_earnings_rate_id' => :'String', + :'payroll_calendar_id' => :'String', + :'employee_group_name' => :'String', + :'employee_id' => :'String', + :'termination_date' => :'Date', + :'bank_accounts' => :'Array', + :'pay_template' => :'PayTemplate', + :'opening_balances' => :'OpeningBalances', + :'tax_declaration' => :'TaxDeclaration', + :'leave_balances' => :'Array', + :'leave_lines' => :'Array', + :'super_memberships' => :'Array', + :'status' => :'EmployeeStatus', + :'updated_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Employee` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'date_of_birth') + self.date_of_birth = attributes[:'date_of_birth'] + end + + if attributes.key?(:'home_address') + self.home_address = attributes[:'home_address'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'middle_names') + self.middle_names = attributes[:'middle_names'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'gender') + self.gender = attributes[:'gender'] + end + + if attributes.key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.key?(:'mobile') + self.mobile = attributes[:'mobile'] + end + + if attributes.key?(:'twitter_user_name') + self.twitter_user_name = attributes[:'twitter_user_name'] + end + + if attributes.key?(:'is_authorised_to_approve_leave') + self.is_authorised_to_approve_leave = attributes[:'is_authorised_to_approve_leave'] + end + + if attributes.key?(:'is_authorised_to_approve_timesheets') + self.is_authorised_to_approve_timesheets = attributes[:'is_authorised_to_approve_timesheets'] + end + + if attributes.key?(:'job_title') + self.job_title = attributes[:'job_title'] + end + + if attributes.key?(:'classification') + self.classification = attributes[:'classification'] + end + + if attributes.key?(:'ordinary_earnings_rate_id') + self.ordinary_earnings_rate_id = attributes[:'ordinary_earnings_rate_id'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'employee_group_name') + self.employee_group_name = attributes[:'employee_group_name'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'termination_date') + self.termination_date = attributes[:'termination_date'] + end + + if attributes.key?(:'bank_accounts') + if (value = attributes[:'bank_accounts']).is_a?(Array) + self.bank_accounts = value + end + end + + if attributes.key?(:'pay_template') + self.pay_template = attributes[:'pay_template'] + end + + if attributes.key?(:'opening_balances') + self.opening_balances = attributes[:'opening_balances'] + end + + if attributes.key?(:'tax_declaration') + self.tax_declaration = attributes[:'tax_declaration'] + end + + if attributes.key?(:'leave_balances') + if (value = attributes[:'leave_balances']).is_a?(Array) + self.leave_balances = value + end + end + + if attributes.key?(:'leave_lines') + if (value = attributes[:'leave_lines']).is_a?(Array) + self.leave_lines = value + end + end + + if attributes.key?(:'super_memberships') + if (value = attributes[:'super_memberships']).is_a?(Array) + self.super_memberships = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @first_name.nil? + invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') + end + + if @last_name.nil? + invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') + end + + if @date_of_birth.nil? + invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @first_name.nil? + return false if @last_name.nil? + return false if @date_of_birth.nil? + gender_validator = EnumAttributeValidator.new('String', ["N", "M", "F", "I"]) + return false unless gender_validator.valid?(@gender) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] gender Object to be assigned + def gender=(gender) + validator = EnumAttributeValidator.new('String', ["N", "M", "F", "I"]) + unless validator.valid?(gender) + fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}." + end + @gender = gender + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first_name == o.first_name && + last_name == o.last_name && + date_of_birth == o.date_of_birth && + home_address == o.home_address && + start_date == o.start_date && + title == o.title && + middle_names == o.middle_names && + email == o.email && + gender == o.gender && + phone == o.phone && + mobile == o.mobile && + twitter_user_name == o.twitter_user_name && + is_authorised_to_approve_leave == o.is_authorised_to_approve_leave && + is_authorised_to_approve_timesheets == o.is_authorised_to_approve_timesheets && + job_title == o.job_title && + classification == o.classification && + ordinary_earnings_rate_id == o.ordinary_earnings_rate_id && + payroll_calendar_id == o.payroll_calendar_id && + employee_group_name == o.employee_group_name && + employee_id == o.employee_id && + termination_date == o.termination_date && + bank_accounts == o.bank_accounts && + pay_template == o.pay_template && + opening_balances == o.opening_balances && + tax_declaration == o.tax_declaration && + leave_balances == o.leave_balances && + leave_lines == o.leave_lines && + super_memberships == o.super_memberships && + status == o.status && + updated_date_utc == o.updated_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [first_name, last_name, date_of_birth, home_address, start_date, title, middle_names, email, gender, phone, mobile, twitter_user_name, is_authorised_to_approve_leave, is_authorised_to_approve_timesheets, job_title, classification, ordinary_earnings_rate_id, payroll_calendar_id, employee_group_name, employee_id, termination_date, bank_accounts, pay_template, opening_balances, tax_declaration, leave_balances, leave_lines, super_memberships, status, updated_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/employee_status.rb b/lib/xero-ruby/models/payroll_au/employee_status.rb new file mode 100644 index 00000000..d21cfdb0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/employee_status.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EmployeeStatus + ACTIVE = "ACTIVE".freeze + TERMINATED = "TERMINATED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EmployeeStatus.constants.select { |c| EmployeeStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EmployeeStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/employees.rb b/lib/xero-ruby/models/payroll_au/employees.rb new file mode 100644 index 00000000..a35157f1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/employees.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Employees + + attr_accessor :employees + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employees' => :'Employees' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employees' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Employees` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Employees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employees') + if (value = attributes[:'employees']).is_a?(Array) + self.employees = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employees == o.employees + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employees].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/employment_basis.rb b/lib/xero-ruby/models/payroll_au/employment_basis.rb new file mode 100644 index 00000000..4975dd67 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/employment_basis.rb @@ -0,0 +1,40 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EmploymentBasis + FULLTIME = "FULLTIME".freeze + PARTTIME = "PARTTIME".freeze + CASUAL = "CASUAL".freeze + LABOURHIRE = "LABOURHIRE".freeze + SUPERINCOMESTREAM = "SUPERINCOMESTREAM".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EmploymentBasis.constants.select { |c| EmploymentBasis::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EmploymentBasis" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb b/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb new file mode 100644 index 00000000..ea9ce8e0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EmploymentTerminationPaymentType + O = "O".freeze + R = "R".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EmploymentTerminationPaymentType.constants.select { |c| EmploymentTerminationPaymentType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EmploymentTerminationPaymentType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb b/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb new file mode 100644 index 00000000..1ff83161 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class EntitlementFinalPayPayoutType + NOTPAIDOUT = "NOTPAIDOUT".freeze + PAIDOUT = "PAIDOUT".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EntitlementFinalPayPayoutType.constants.select { |c| EntitlementFinalPayPayoutType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EntitlementFinalPayPayoutType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/home_address.rb b/lib/xero-ruby/models/payroll_au/home_address.rb new file mode 100644 index 00000000..21653789 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/home_address.rb @@ -0,0 +1,263 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class HomeAddress + # Address line 1 for employee home address + attr_accessor :address_line1 + + # Address line 2 for employee home address + attr_accessor :address_line2 + + # Suburb for employee home address + attr_accessor :city + + + attr_accessor :region + + # PostCode for employee home address + attr_accessor :postal_code + + # Country of HomeAddress + attr_accessor :country + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'address_line1' => :'AddressLine1', + :'address_line2' => :'AddressLine2', + :'city' => :'City', + :'region' => :'Region', + :'postal_code' => :'PostalCode', + :'country' => :'Country' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'address_line1' => :'String', + :'address_line2' => :'String', + :'city' => :'String', + :'region' => :'State', + :'postal_code' => :'String', + :'country' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::HomeAddress` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::HomeAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'address_line1') + self.address_line1 = attributes[:'address_line1'] + end + + if attributes.key?(:'address_line2') + self.address_line2 = attributes[:'address_line2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @address_line1.nil? + invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @address_line1.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address_line1 == o.address_line1 && + address_line2 == o.address_line2 && + city == o.city && + region == o.region && + postal_code == o.postal_code && + country == o.country + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [address_line1, address_line2, city, region, postal_code, country].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb new file mode 100644 index 00000000..267e5f89 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveAccrualLine + # Xero identifier for the Leave type. + attr_accessor :leave_type_id + + # Leave Accrual number of units + attr_accessor :number_of_units + + # If you want to auto calculate leave. + attr_accessor :auto_calculate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'LeaveTypeID', + :'number_of_units' => :'NumberOfUnits', + :'auto_calculate' => :'AutoCalculate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'number_of_units' => :'BigDecimal', + :'auto_calculate' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveAccrualLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveAccrualLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'auto_calculate') + self.auto_calculate = attributes[:'auto_calculate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + number_of_units == o.number_of_units && + auto_calculate == o.auto_calculate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, number_of_units, auto_calculate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_application.rb b/lib/xero-ruby/models/payroll_au/leave_application.rb new file mode 100644 index 00000000..7e57723e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_application.rb @@ -0,0 +1,302 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveApplication + # The Xero identifier for Payroll Employee + attr_accessor :leave_application_id + + # The Xero identifier for Payroll Employee + attr_accessor :employee_id + + # The Xero identifier for Leave Type + attr_accessor :leave_type_id + + # The title of the leave + attr_accessor :title + + # Start date of the leave (YYYY-MM-DD) + attr_accessor :start_date + + # End date of the leave (YYYY-MM-DD) + attr_accessor :end_date + + # The Description of the Leave + attr_accessor :description + + + attr_accessor :leave_periods + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_application_id' => :'LeaveApplicationID', + :'employee_id' => :'EmployeeID', + :'leave_type_id' => :'LeaveTypeID', + :'title' => :'Title', + :'start_date' => :'StartDate', + :'end_date' => :'EndDate', + :'description' => :'Description', + :'leave_periods' => :'LeavePeriods', + :'updated_date_utc' => :'UpdatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_application_id' => :'String', + :'employee_id' => :'String', + :'leave_type_id' => :'String', + :'title' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'description' => :'String', + :'leave_periods' => :'Array', + :'updated_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveApplication` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveApplication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_application_id') + self.leave_application_id = attributes[:'leave_application_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'leave_periods') + if (value = attributes[:'leave_periods']).is_a?(Array) + self.leave_periods = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_application_id == o.leave_application_id && + employee_id == o.employee_id && + leave_type_id == o.leave_type_id && + title == o.title && + start_date == o.start_date && + end_date == o.end_date && + description == o.description && + leave_periods == o.leave_periods && + updated_date_utc == o.updated_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_application_id, employee_id, leave_type_id, title, start_date, end_date, description, leave_periods, updated_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_applications.rb b/lib/xero-ruby/models/payroll_au/leave_applications.rb new file mode 100644 index 00000000..3384d5a2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_applications.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveApplications + + attr_accessor :leave_applications + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_applications' => :'LeaveApplications' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_applications' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveApplications` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveApplications`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_applications') + if (value = attributes[:'leave_applications']).is_a?(Array) + self.leave_applications = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_applications == o.leave_applications + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_applications].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_balance.rb b/lib/xero-ruby/models/payroll_au/leave_balance.rb new file mode 100644 index 00000000..a6f21e05 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_balance.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveBalance + # The name of the leave type + attr_accessor :leave_name + + # Identifier of the leave type (see PayItems) + attr_accessor :leave_type_id + + # The balance of the leave available + attr_accessor :number_of_units + + # The type of units as specified by the LeaveType (see PayItems) + attr_accessor :type_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_name' => :'LeaveName', + :'leave_type_id' => :'LeaveTypeID', + :'number_of_units' => :'NumberOfUnits', + :'type_of_units' => :'TypeOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_name' => :'String', + :'leave_type_id' => :'String', + :'number_of_units' => :'BigDecimal', + :'type_of_units' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_name') + self.leave_name = attributes[:'leave_name'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_name == o.leave_name && + leave_type_id == o.leave_type_id && + number_of_units == o.number_of_units && + type_of_units == o.type_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_name, leave_type_id, number_of_units, type_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb new file mode 100644 index 00000000..6647107f --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveEarningsLine + # Xero identifier + attr_accessor :earnings_rate_id + + # Rate per unit of the EarningsLine. + attr_accessor :rate_per_unit + + # Earnings rate number of units. + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'EarningsRateID', + :'rate_per_unit' => :'RatePerUnit', + :'number_of_units' => :'NumberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveEarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, rate_per_unit, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_line.rb b/lib/xero-ruby/models/payroll_au/leave_line.rb new file mode 100644 index 00000000..0a4e006e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_line.rb @@ -0,0 +1,278 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveLine + # Xero leave type identifier + attr_accessor :leave_type_id + + + attr_accessor :calculation_type + + + attr_accessor :entitlement_final_pay_payout_type + + + attr_accessor :employment_termination_payment_type + + # amount of leave line + attr_accessor :include_superannuation_guarantee_contribution + + # Number of units for leave line. + attr_accessor :number_of_units + + # Hours of leave accrued each year + attr_accessor :annual_number_of_units + + # Normal ordinary earnings number of units for leave line. + attr_accessor :full_time_number_of_units_per_period + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'LeaveTypeID', + :'calculation_type' => :'CalculationType', + :'entitlement_final_pay_payout_type' => :'EntitlementFinalPayPayoutType', + :'employment_termination_payment_type' => :'EmploymentTerminationPaymentType', + :'include_superannuation_guarantee_contribution' => :'IncludeSuperannuationGuaranteeContribution', + :'number_of_units' => :'NumberOfUnits', + :'annual_number_of_units' => :'AnnualNumberOfUnits', + :'full_time_number_of_units_per_period' => :'FullTimeNumberOfUnitsPerPeriod' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'calculation_type' => :'LeaveLineCalculationType', + :'entitlement_final_pay_payout_type' => :'EntitlementFinalPayPayoutType', + :'employment_termination_payment_type' => :'EmploymentTerminationPaymentType', + :'include_superannuation_guarantee_contribution' => :'Boolean', + :'number_of_units' => :'BigDecimal', + :'annual_number_of_units' => :'BigDecimal', + :'full_time_number_of_units_per_period' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'entitlement_final_pay_payout_type') + self.entitlement_final_pay_payout_type = attributes[:'entitlement_final_pay_payout_type'] + end + + if attributes.key?(:'employment_termination_payment_type') + self.employment_termination_payment_type = attributes[:'employment_termination_payment_type'] + end + + if attributes.key?(:'include_superannuation_guarantee_contribution') + self.include_superannuation_guarantee_contribution = attributes[:'include_superannuation_guarantee_contribution'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'annual_number_of_units') + self.annual_number_of_units = attributes[:'annual_number_of_units'] + end + + if attributes.key?(:'full_time_number_of_units_per_period') + self.full_time_number_of_units_per_period = attributes[:'full_time_number_of_units_per_period'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + calculation_type == o.calculation_type && + entitlement_final_pay_payout_type == o.entitlement_final_pay_payout_type && + employment_termination_payment_type == o.employment_termination_payment_type && + include_superannuation_guarantee_contribution == o.include_superannuation_guarantee_contribution && + number_of_units == o.number_of_units && + annual_number_of_units == o.annual_number_of_units && + full_time_number_of_units_per_period == o.full_time_number_of_units_per_period + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, calculation_type, entitlement_final_pay_payout_type, employment_termination_payment_type, include_superannuation_guarantee_contribution, number_of_units, annual_number_of_units, full_time_number_of_units_per_period].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb b/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb new file mode 100644 index 00000000..6bcfd488 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb @@ -0,0 +1,40 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class LeaveLineCalculationType + NOCALCULATIONREQUIRED = "NOCALCULATIONREQUIRED".freeze + FIXEDAMOUNTEACHPERIOD = "FIXEDAMOUNTEACHPERIOD".freeze + ENTERRATEINPAYTEMPLATE = "ENTERRATEINPAYTEMPLATE".freeze + BASEDONORDINARYEARNINGS = "BASEDONORDINARYEARNINGS".freeze + EMPTY = "".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LeaveLineCalculationType.constants.select { |c| LeaveLineCalculationType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LeaveLineCalculationType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_lines.rb b/lib/xero-ruby/models/payroll_au/leave_lines.rb new file mode 100644 index 00000000..b6e6302a --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_lines.rb @@ -0,0 +1,211 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # The leave type lines + require 'bigdecimal' + + class LeaveLines + + attr_accessor :employee + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee' => :'Employee' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveLines` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveLines`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee') + if (value = attributes[:'employee']).is_a?(Array) + self.employee = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee == o.employee + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_period.rb b/lib/xero-ruby/models/payroll_au/leave_period.rb new file mode 100644 index 00000000..ab4b151c --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_period.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeavePeriod + # The Number of Units for the leave + attr_accessor :number_of_units + + # The Pay Period End Date (YYYY-MM-DD) + attr_accessor :pay_period_end_date + + # The Pay Period Start Date (YYYY-MM-DD) + attr_accessor :pay_period_start_date + + + attr_accessor :leave_period_status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number_of_units' => :'NumberOfUnits', + :'pay_period_end_date' => :'PayPeriodEndDate', + :'pay_period_start_date' => :'PayPeriodStartDate', + :'leave_period_status' => :'LeavePeriodStatus' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'number_of_units' => :'BigDecimal', + :'pay_period_end_date' => :'Date', + :'pay_period_start_date' => :'Date', + :'leave_period_status' => :'LeavePeriodStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeavePeriod` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeavePeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'pay_period_end_date') + self.pay_period_end_date = attributes[:'pay_period_end_date'] + end + + if attributes.key?(:'pay_period_start_date') + self.pay_period_start_date = attributes[:'pay_period_start_date'] + end + + if attributes.key?(:'leave_period_status') + self.leave_period_status = attributes[:'leave_period_status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + number_of_units == o.number_of_units && + pay_period_end_date == o.pay_period_end_date && + pay_period_start_date == o.pay_period_start_date && + leave_period_status == o.leave_period_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [number_of_units, pay_period_end_date, pay_period_start_date, leave_period_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_period_status.rb b/lib/xero-ruby/models/payroll_au/leave_period_status.rb new file mode 100644 index 00000000..8f6605a3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_period_status.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class LeavePeriodStatus + SCHEDULED = "SCHEDULED".freeze + PROCESSED = "PROCESSED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LeavePeriodStatus.constants.select { |c| LeavePeriodStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LeavePeriodStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_type.rb b/lib/xero-ruby/models/payroll_au/leave_type.rb new file mode 100644 index 00000000..cd51437a --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_type.rb @@ -0,0 +1,303 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class LeaveType + # Name of the earnings rate (max length = 100) + attr_accessor :name + + # The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate + attr_accessor :type_of_units + + # Xero identifier + attr_accessor :leave_type_id + + # The number of units the employee is entitled to each year + attr_accessor :normal_entitlement + + # Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + attr_accessor :leave_loading_rate + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Set this to indicate that an employee will be paid when taking this type of leave + attr_accessor :is_paid_leave + + # Set this if you want a balance for this leave type to be shown on your employee’s payslips + attr_accessor :show_on_payslip + + # Is the current record + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'type_of_units' => :'TypeOfUnits', + :'leave_type_id' => :'LeaveTypeID', + :'normal_entitlement' => :'NormalEntitlement', + :'leave_loading_rate' => :'LeaveLoadingRate', + :'updated_date_utc' => :'UpdatedDateUTC', + :'is_paid_leave' => :'IsPaidLeave', + :'show_on_payslip' => :'ShowOnPayslip', + :'current_record' => :'CurrentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'type_of_units' => :'String', + :'leave_type_id' => :'String', + :'normal_entitlement' => :'Float', + :'leave_loading_rate' => :'Float', + :'updated_date_utc' => :'DateTime', + :'is_paid_leave' => :'Boolean', + :'show_on_payslip' => :'Boolean', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::LeaveType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::LeaveType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'normal_entitlement') + self.normal_entitlement = attributes[:'normal_entitlement'] + end + + if attributes.key?(:'leave_loading_rate') + self.leave_loading_rate = attributes[:'leave_loading_rate'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_paid_leave') + self.is_paid_leave = attributes[:'is_paid_leave'] + end + + if attributes.key?(:'show_on_payslip') + self.show_on_payslip = attributes[:'show_on_payslip'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + type_of_units == o.type_of_units && + leave_type_id == o.leave_type_id && + normal_entitlement == o.normal_entitlement && + leave_loading_rate == o.leave_loading_rate && + updated_date_utc == o.updated_date_utc && + is_paid_leave == o.is_paid_leave && + show_on_payslip == o.show_on_payslip && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, type_of_units, leave_type_id, normal_entitlement, leave_loading_rate, updated_date_utc, is_paid_leave, show_on_payslip, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb b/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb new file mode 100644 index 00000000..c82704af --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb @@ -0,0 +1,39 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class LeaveTypeContributionType + SGC = "SGC".freeze + SALARYSACRIFICE = "SALARYSACRIFICE".freeze + EMPLOYERADDITIONAL = "EMPLOYERADDITIONAL".freeze + EMPLOYEE = "EMPLOYEE".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LeaveTypeContributionType.constants.select { |c| LeaveTypeContributionType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LeaveTypeContributionType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/manual_tax_type.rb b/lib/xero-ruby/models/payroll_au/manual_tax_type.rb new file mode 100644 index 00000000..cd806e8b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/manual_tax_type.rb @@ -0,0 +1,40 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class ManualTaxType + PAYGMANUAL = "PAYGMANUAL".freeze + ETPOMANUAL = "ETPOMANUAL".freeze + ETPRMANUAL = "ETPRMANUAL".freeze + SCHEDULE5_MANUAL = "SCHEDULE5MANUAL".freeze + SCHEDULE5_STSLMANUAL = "SCHEDULE5STSLMANUAL".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ManualTaxType.constants.select { |c| ManualTaxType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ManualTaxType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/opening_balances.rb b/lib/xero-ruby/models/payroll_au/opening_balances.rb new file mode 100644 index 00000000..b7732cf7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/opening_balances.rb @@ -0,0 +1,278 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class OpeningBalances + # Opening Balance Date. (YYYY-MM-DD) + attr_accessor :opening_balance_date + + # Opening Balance tax + attr_accessor :tax + + + attr_accessor :earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :super_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :leave_lines + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'opening_balance_date' => :'OpeningBalanceDate', + :'tax' => :'Tax', + :'earnings_lines' => :'EarningsLines', + :'deduction_lines' => :'DeductionLines', + :'super_lines' => :'SuperLines', + :'reimbursement_lines' => :'ReimbursementLines', + :'leave_lines' => :'LeaveLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'opening_balance_date' => :'Date', + :'tax' => :'String', + :'earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'super_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'leave_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::OpeningBalances` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::OpeningBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'opening_balance_date') + self.opening_balance_date = attributes[:'opening_balance_date'] + end + + if attributes.key?(:'tax') + self.tax = attributes[:'tax'] + end + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'super_lines') + if (value = attributes[:'super_lines']).is_a?(Array) + self.super_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'leave_lines') + if (value = attributes[:'leave_lines']).is_a?(Array) + self.leave_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + opening_balance_date == o.opening_balance_date && + tax == o.tax && + earnings_lines == o.earnings_lines && + deduction_lines == o.deduction_lines && + super_lines == o.super_lines && + reimbursement_lines == o.reimbursement_lines && + leave_lines == o.leave_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [opening_balance_date, tax, earnings_lines, deduction_lines, super_lines, reimbursement_lines, leave_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_item.rb b/lib/xero-ruby/models/payroll_au/pay_item.rb new file mode 100644 index 00000000..b1ac6ae0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_item.rb @@ -0,0 +1,246 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayItem + + attr_accessor :earnings_rates + + + attr_accessor :deduction_types + + + attr_accessor :leave_types + + + attr_accessor :reimbursement_types + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rates' => :'EarningsRates', + :'deduction_types' => :'DeductionTypes', + :'leave_types' => :'LeaveTypes', + :'reimbursement_types' => :'ReimbursementTypes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rates' => :'Array', + :'deduction_types' => :'Array', + :'leave_types' => :'Array', + :'reimbursement_types' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rates') + if (value = attributes[:'earnings_rates']).is_a?(Array) + self.earnings_rates = value + end + end + + if attributes.key?(:'deduction_types') + if (value = attributes[:'deduction_types']).is_a?(Array) + self.deduction_types = value + end + end + + if attributes.key?(:'leave_types') + if (value = attributes[:'leave_types']).is_a?(Array) + self.leave_types = value + end + end + + if attributes.key?(:'reimbursement_types') + if (value = attributes[:'reimbursement_types']).is_a?(Array) + self.reimbursement_types = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rates == o.earnings_rates && + deduction_types == o.deduction_types && + leave_types == o.leave_types && + reimbursement_types == o.reimbursement_types + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rates, deduction_types, leave_types, reimbursement_types].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_items.rb b/lib/xero-ruby/models/payroll_au/pay_items.rb new file mode 100644 index 00000000..d640309e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_items.rb @@ -0,0 +1,208 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayItems + + attr_accessor :pay_items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_items' => :'PayItems' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_items' => :'PayItem' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayItems` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_items') + self.pay_items = attributes[:'pay_items'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_items == o.pay_items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_run.rb b/lib/xero-ruby/models/payroll_au/pay_run.rb new file mode 100644 index 00000000..32e46fb3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_run.rb @@ -0,0 +1,367 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayRun + # Xero identifier for pay run + attr_accessor :payroll_calendar_id + + # Xero identifier for pay run + attr_accessor :pay_run_id + + # Period Start Date for the PayRun (YYYY-MM-DD) + attr_accessor :pay_run_period_start_date + + # Period End Date for the PayRun (YYYY-MM-DD) + attr_accessor :pay_run_period_end_date + + + attr_accessor :pay_run_status + + # Payment Date for the PayRun (YYYY-MM-DD) + attr_accessor :payment_date + + # Payslip message for the PayRun + attr_accessor :payslip_message + + # Last modified timestamp + attr_accessor :updated_date_utc + + # The payslips in the payrun + attr_accessor :payslips + + # The total Wages for the Payrun + attr_accessor :wages + + # The total Deductions for the Payrun + attr_accessor :deductions + + # The total Tax for the Payrun + attr_accessor :tax + + # The total Super for the Payrun + attr_accessor :_super + + # The total Reimbursements for the Payrun + attr_accessor :reimbursement + + # The total NetPay for the Payrun + attr_accessor :net_pay + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendar_id' => :'PayrollCalendarID', + :'pay_run_id' => :'PayRunID', + :'pay_run_period_start_date' => :'PayRunPeriodStartDate', + :'pay_run_period_end_date' => :'PayRunPeriodEndDate', + :'pay_run_status' => :'PayRunStatus', + :'payment_date' => :'PaymentDate', + :'payslip_message' => :'PayslipMessage', + :'updated_date_utc' => :'UpdatedDateUTC', + :'payslips' => :'Payslips', + :'wages' => :'Wages', + :'deductions' => :'Deductions', + :'tax' => :'Tax', + :'_super' => :'Super', + :'reimbursement' => :'Reimbursement', + :'net_pay' => :'NetPay', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendar_id' => :'String', + :'pay_run_id' => :'String', + :'pay_run_period_start_date' => :'Date', + :'pay_run_period_end_date' => :'Date', + :'pay_run_status' => :'PayRunStatus', + :'payment_date' => :'Date', + :'payslip_message' => :'String', + :'updated_date_utc' => :'DateTime', + :'payslips' => :'Array', + :'wages' => :'BigDecimal', + :'deductions' => :'BigDecimal', + :'tax' => :'BigDecimal', + :'_super' => :'BigDecimal', + :'reimbursement' => :'BigDecimal', + :'net_pay' => :'BigDecimal', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayRun` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayRun`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'pay_run_id') + self.pay_run_id = attributes[:'pay_run_id'] + end + + if attributes.key?(:'pay_run_period_start_date') + self.pay_run_period_start_date = attributes[:'pay_run_period_start_date'] + end + + if attributes.key?(:'pay_run_period_end_date') + self.pay_run_period_end_date = attributes[:'pay_run_period_end_date'] + end + + if attributes.key?(:'pay_run_status') + self.pay_run_status = attributes[:'pay_run_status'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'payslip_message') + self.payslip_message = attributes[:'payslip_message'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'payslips') + if (value = attributes[:'payslips']).is_a?(Array) + self.payslips = value + end + end + + if attributes.key?(:'wages') + self.wages = attributes[:'wages'] + end + + if attributes.key?(:'deductions') + self.deductions = attributes[:'deductions'] + end + + if attributes.key?(:'tax') + self.tax = attributes[:'tax'] + end + + if attributes.key?(:'_super') + self._super = attributes[:'_super'] + end + + if attributes.key?(:'reimbursement') + self.reimbursement = attributes[:'reimbursement'] + end + + if attributes.key?(:'net_pay') + self.net_pay = attributes[:'net_pay'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @payroll_calendar_id.nil? + invalid_properties.push('invalid value for "payroll_calendar_id", payroll_calendar_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @payroll_calendar_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendar_id == o.payroll_calendar_id && + pay_run_id == o.pay_run_id && + pay_run_period_start_date == o.pay_run_period_start_date && + pay_run_period_end_date == o.pay_run_period_end_date && + pay_run_status == o.pay_run_status && + payment_date == o.payment_date && + payslip_message == o.payslip_message && + updated_date_utc == o.updated_date_utc && + payslips == o.payslips && + wages == o.wages && + deductions == o.deductions && + tax == o.tax && + _super == o._super && + reimbursement == o.reimbursement && + net_pay == o.net_pay && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendar_id, pay_run_id, pay_run_period_start_date, pay_run_period_end_date, pay_run_status, payment_date, payslip_message, updated_date_utc, payslips, wages, deductions, tax, _super, reimbursement, net_pay, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_run_status.rb b/lib/xero-ruby/models/payroll_au/pay_run_status.rb new file mode 100644 index 00000000..7a2a2ff3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_run_status.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class PayRunStatus + DRAFT = "DRAFT".freeze + POSTED = "POSTED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = PayRunStatus.constants.select { |c| PayRunStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #PayRunStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_runs.rb b/lib/xero-ruby/models/payroll_au/pay_runs.rb new file mode 100644 index 00000000..47909133 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_runs.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayRuns + + attr_accessor :pay_runs + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_runs' => :'PayRuns' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_runs' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayRuns` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayRuns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_runs') + if (value = attributes[:'pay_runs']).is_a?(Array) + self.pay_runs = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_runs == o.pay_runs + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_runs].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/pay_template.rb b/lib/xero-ruby/models/payroll_au/pay_template.rb new file mode 100644 index 00000000..c3a45a0d --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/pay_template.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayTemplate + + attr_accessor :earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :super_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :leave_lines + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_lines' => :'EarningsLines', + :'deduction_lines' => :'DeductionLines', + :'super_lines' => :'SuperLines', + :'reimbursement_lines' => :'ReimbursementLines', + :'leave_lines' => :'LeaveLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'super_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'leave_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'super_lines') + if (value = attributes[:'super_lines']).is_a?(Array) + self.super_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'leave_lines') + if (value = attributes[:'leave_lines']).is_a?(Array) + self.leave_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_lines == o.earnings_lines && + deduction_lines == o.deduction_lines && + super_lines == o.super_lines && + reimbursement_lines == o.reimbursement_lines && + leave_lines == o.leave_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_lines, deduction_lines, super_lines, reimbursement_lines, leave_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb b/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb new file mode 100644 index 00000000..cf70c063 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb @@ -0,0 +1,42 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class PaymentFrequencyType + WEEKLY = "WEEKLY".freeze + MONTHLY = "MONTHLY".freeze + FORTNIGHTLY = "FORTNIGHTLY".freeze + QUARTERLY = "QUARTERLY".freeze + TWICEMONTHLY = "TWICEMONTHLY".freeze + FOURWEEKLY = "FOURWEEKLY".freeze + YEARLY = "YEARLY".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = PaymentFrequencyType.constants.select { |c| PaymentFrequencyType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #PaymentFrequencyType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payroll_calendar.rb b/lib/xero-ruby/models/payroll_au/payroll_calendar.rb new file mode 100644 index 00000000..71c90815 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payroll_calendar.rb @@ -0,0 +1,270 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayrollCalendar + # Name of the Payroll Calendar + attr_accessor :name + + + attr_accessor :calendar_type + + # The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) + attr_accessor :start_date + + # The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) + attr_accessor :payment_date + + # Xero identifier + attr_accessor :payroll_calendar_id + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'calendar_type' => :'CalendarType', + :'start_date' => :'StartDate', + :'payment_date' => :'PaymentDate', + :'payroll_calendar_id' => :'PayrollCalendarID', + :'updated_date_utc' => :'UpdatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'calendar_type' => :'CalendarType', + :'start_date' => :'Date', + :'payment_date' => :'Date', + :'payroll_calendar_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayrollCalendar` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayrollCalendar`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'calendar_type') + self.calendar_type = attributes[:'calendar_type'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + calendar_type == o.calendar_type && + start_date == o.start_date && + payment_date == o.payment_date && + payroll_calendar_id == o.payroll_calendar_id && + updated_date_utc == o.updated_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, calendar_type, start_date, payment_date, payroll_calendar_id, updated_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payroll_calendars.rb b/lib/xero-ruby/models/payroll_au/payroll_calendars.rb new file mode 100644 index 00000000..9a1ad345 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payroll_calendars.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayrollCalendars + + attr_accessor :payroll_calendars + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendars' => :'PayrollCalendars' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendars' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayrollCalendars` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayrollCalendars`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendars') + if (value = attributes[:'payroll_calendars']).is_a?(Array) + self.payroll_calendars = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendars == o.payroll_calendars + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendars].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payslip.rb b/lib/xero-ruby/models/payroll_au/payslip.rb new file mode 100644 index 00000000..f8f21220 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payslip.rb @@ -0,0 +1,404 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Payslip + # The Xero identifier for an employee + attr_accessor :employee_id + + # Xero identifier for the payslip + attr_accessor :payslip_id + + # First name of employee + attr_accessor :first_name + + # Last name of employee + attr_accessor :last_name + + # The Wages for the Payslip + attr_accessor :wages + + # The Deductions for the Payslip + attr_accessor :deductions + + # The Tax for the Payslip + attr_accessor :tax + + # The Super for the Payslip + attr_accessor :_super + + # The Reimbursements for the Payslip + attr_accessor :reimbursements + + # The NetPay for the Payslip + attr_accessor :net_pay + + + attr_accessor :earnings_lines + + + attr_accessor :leave_earnings_lines + + + attr_accessor :timesheet_earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :leave_accrual_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :superannuation_lines + + + attr_accessor :tax_lines + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'EmployeeID', + :'payslip_id' => :'PayslipID', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'wages' => :'Wages', + :'deductions' => :'Deductions', + :'tax' => :'Tax', + :'_super' => :'Super', + :'reimbursements' => :'Reimbursements', + :'net_pay' => :'NetPay', + :'earnings_lines' => :'EarningsLines', + :'leave_earnings_lines' => :'LeaveEarningsLines', + :'timesheet_earnings_lines' => :'TimesheetEarningsLines', + :'deduction_lines' => :'DeductionLines', + :'leave_accrual_lines' => :'LeaveAccrualLines', + :'reimbursement_lines' => :'ReimbursementLines', + :'superannuation_lines' => :'SuperannuationLines', + :'tax_lines' => :'TaxLines', + :'updated_date_utc' => :'UpdatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'payslip_id' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'wages' => :'BigDecimal', + :'deductions' => :'BigDecimal', + :'tax' => :'BigDecimal', + :'_super' => :'BigDecimal', + :'reimbursements' => :'BigDecimal', + :'net_pay' => :'BigDecimal', + :'earnings_lines' => :'Array', + :'leave_earnings_lines' => :'Array', + :'timesheet_earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'leave_accrual_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'superannuation_lines' => :'Array', + :'tax_lines' => :'Array', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Payslip` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Payslip`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'payslip_id') + self.payslip_id = attributes[:'payslip_id'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'wages') + self.wages = attributes[:'wages'] + end + + if attributes.key?(:'deductions') + self.deductions = attributes[:'deductions'] + end + + if attributes.key?(:'tax') + self.tax = attributes[:'tax'] + end + + if attributes.key?(:'_super') + self._super = attributes[:'_super'] + end + + if attributes.key?(:'reimbursements') + self.reimbursements = attributes[:'reimbursements'] + end + + if attributes.key?(:'net_pay') + self.net_pay = attributes[:'net_pay'] + end + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'leave_earnings_lines') + if (value = attributes[:'leave_earnings_lines']).is_a?(Array) + self.leave_earnings_lines = value + end + end + + if attributes.key?(:'timesheet_earnings_lines') + if (value = attributes[:'timesheet_earnings_lines']).is_a?(Array) + self.timesheet_earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'leave_accrual_lines') + if (value = attributes[:'leave_accrual_lines']).is_a?(Array) + self.leave_accrual_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'superannuation_lines') + if (value = attributes[:'superannuation_lines']).is_a?(Array) + self.superannuation_lines = value + end + end + + if attributes.key?(:'tax_lines') + if (value = attributes[:'tax_lines']).is_a?(Array) + self.tax_lines = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + payslip_id == o.payslip_id && + first_name == o.first_name && + last_name == o.last_name && + wages == o.wages && + deductions == o.deductions && + tax == o.tax && + _super == o._super && + reimbursements == o.reimbursements && + net_pay == o.net_pay && + earnings_lines == o.earnings_lines && + leave_earnings_lines == o.leave_earnings_lines && + timesheet_earnings_lines == o.timesheet_earnings_lines && + deduction_lines == o.deduction_lines && + leave_accrual_lines == o.leave_accrual_lines && + reimbursement_lines == o.reimbursement_lines && + superannuation_lines == o.superannuation_lines && + tax_lines == o.tax_lines && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, payslip_id, first_name, last_name, wages, deductions, tax, _super, reimbursements, net_pay, earnings_lines, leave_earnings_lines, timesheet_earnings_lines, deduction_lines, leave_accrual_lines, reimbursement_lines, superannuation_lines, tax_lines, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payslip_lines.rb b/lib/xero-ruby/models/payroll_au/payslip_lines.rb new file mode 100644 index 00000000..e45752d0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payslip_lines.rb @@ -0,0 +1,294 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayslipLines + + attr_accessor :earnings_lines + + + attr_accessor :leave_earnings_lines + + + attr_accessor :timesheet_earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :leave_accrual_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :superannuation_lines + + + attr_accessor :tax_lines + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_lines' => :'EarningsLines', + :'leave_earnings_lines' => :'LeaveEarningsLines', + :'timesheet_earnings_lines' => :'TimesheetEarningsLines', + :'deduction_lines' => :'DeductionLines', + :'leave_accrual_lines' => :'LeaveAccrualLines', + :'reimbursement_lines' => :'ReimbursementLines', + :'superannuation_lines' => :'SuperannuationLines', + :'tax_lines' => :'TaxLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_lines' => :'Array', + :'leave_earnings_lines' => :'Array', + :'timesheet_earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'leave_accrual_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'superannuation_lines' => :'Array', + :'tax_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayslipLines` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayslipLines`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'leave_earnings_lines') + if (value = attributes[:'leave_earnings_lines']).is_a?(Array) + self.leave_earnings_lines = value + end + end + + if attributes.key?(:'timesheet_earnings_lines') + if (value = attributes[:'timesheet_earnings_lines']).is_a?(Array) + self.timesheet_earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'leave_accrual_lines') + if (value = attributes[:'leave_accrual_lines']).is_a?(Array) + self.leave_accrual_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'superannuation_lines') + if (value = attributes[:'superannuation_lines']).is_a?(Array) + self.superannuation_lines = value + end + end + + if attributes.key?(:'tax_lines') + if (value = attributes[:'tax_lines']).is_a?(Array) + self.tax_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_lines == o.earnings_lines && + leave_earnings_lines == o.leave_earnings_lines && + timesheet_earnings_lines == o.timesheet_earnings_lines && + deduction_lines == o.deduction_lines && + leave_accrual_lines == o.leave_accrual_lines && + reimbursement_lines == o.reimbursement_lines && + superannuation_lines == o.superannuation_lines && + tax_lines == o.tax_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_lines, leave_earnings_lines, timesheet_earnings_lines, deduction_lines, leave_accrual_lines, reimbursement_lines, superannuation_lines, tax_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payslip_object.rb b/lib/xero-ruby/models/payroll_au/payslip_object.rb new file mode 100644 index 00000000..190ac8c5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payslip_object.rb @@ -0,0 +1,208 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayslipObject + + attr_accessor :payslip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payslip' => :'Payslip' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payslip' => :'Payslip' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayslipObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayslipObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payslip') + self.payslip = attributes[:'payslip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payslip == o.payslip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payslip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payslip_summary.rb b/lib/xero-ruby/models/payroll_au/payslip_summary.rb new file mode 100644 index 00000000..2fee42a4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payslip_summary.rb @@ -0,0 +1,318 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class PayslipSummary + # The Xero identifier for an employee + attr_accessor :employee_id + + # Xero identifier for the payslip + attr_accessor :payslip_id + + # First name of employee + attr_accessor :first_name + + # Last name of employee + attr_accessor :last_name + + # Employee group name + attr_accessor :employee_group + + # The Wages for the Payslip + attr_accessor :wages + + # The Deductions for the Payslip + attr_accessor :deductions + + # The Tax for the Payslip + attr_accessor :tax + + # The Super for the Payslip + attr_accessor :_super + + # The Reimbursements for the Payslip + attr_accessor :reimbursements + + # The NetPay for the Payslip + attr_accessor :net_pay + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'EmployeeID', + :'payslip_id' => :'PayslipID', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'employee_group' => :'EmployeeGroup', + :'wages' => :'Wages', + :'deductions' => :'Deductions', + :'tax' => :'Tax', + :'_super' => :'Super', + :'reimbursements' => :'Reimbursements', + :'net_pay' => :'NetPay', + :'updated_date_utc' => :'UpdatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'payslip_id' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'employee_group' => :'String', + :'wages' => :'BigDecimal', + :'deductions' => :'BigDecimal', + :'tax' => :'BigDecimal', + :'_super' => :'BigDecimal', + :'reimbursements' => :'BigDecimal', + :'net_pay' => :'BigDecimal', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PayslipSummary` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PayslipSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'payslip_id') + self.payslip_id = attributes[:'payslip_id'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'employee_group') + self.employee_group = attributes[:'employee_group'] + end + + if attributes.key?(:'wages') + self.wages = attributes[:'wages'] + end + + if attributes.key?(:'deductions') + self.deductions = attributes[:'deductions'] + end + + if attributes.key?(:'tax') + self.tax = attributes[:'tax'] + end + + if attributes.key?(:'_super') + self._super = attributes[:'_super'] + end + + if attributes.key?(:'reimbursements') + self.reimbursements = attributes[:'reimbursements'] + end + + if attributes.key?(:'net_pay') + self.net_pay = attributes[:'net_pay'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + payslip_id == o.payslip_id && + first_name == o.first_name && + last_name == o.last_name && + employee_group == o.employee_group && + wages == o.wages && + deductions == o.deductions && + tax == o.tax && + _super == o._super && + reimbursements == o.reimbursements && + net_pay == o.net_pay && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, payslip_id, first_name, last_name, employee_group, wages, deductions, tax, _super, reimbursements, net_pay, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/payslips.rb b/lib/xero-ruby/models/payroll_au/payslips.rb new file mode 100644 index 00000000..405fb248 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/payslips.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Payslips + + attr_accessor :payslips + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payslips' => :'Payslips' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payslips' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Payslips` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Payslips`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payslips') + if (value = attributes[:'payslips']).is_a?(Array) + self.payslips = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payslips == o.payslips + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payslips].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/rate_type.rb b/lib/xero-ruby/models/payroll_au/rate_type.rb new file mode 100644 index 00000000..2809f40c --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/rate_type.rb @@ -0,0 +1,38 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class RateType + FIXEDAMOUNT = "FIXEDAMOUNT".freeze + MULTIPLE = "MULTIPLE".freeze + RATEPERUNIT = "RATEPERUNIT".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = RateType.constants.select { |c| RateType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #RateType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_line.rb b/lib/xero-ruby/models/payroll_au/reimbursement_line.rb new file mode 100644 index 00000000..78557118 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/reimbursement_line.rb @@ -0,0 +1,253 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class ReimbursementLine + # Xero reimbursement type identifier + attr_accessor :reimbursement_type_id + + # Reimbursement type amount + attr_accessor :amount + + # Reimbursement lines description (max length 50) + attr_accessor :description + + # Reimbursement expense account. For posted pay run you should be able to see expense account code. + attr_accessor :expense_account + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_type_id' => :'ReimbursementTypeID', + :'amount' => :'Amount', + :'description' => :'Description', + :'expense_account' => :'ExpenseAccount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_type_id' => :'String', + :'amount' => :'BigDecimal', + :'description' => :'String', + :'expense_account' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::ReimbursementLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::ReimbursementLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_type_id') + self.reimbursement_type_id = attributes[:'reimbursement_type_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'expense_account') + self.expense_account = attributes[:'expense_account'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@description.nil? && @description.to_s.length > 50 + invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 50.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@description.nil? && @description.to_s.length > 50 + true + end + + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if !description.nil? && description.to_s.length > 50 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 50.' + end + + @description = description + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_type_id == o.reimbursement_type_id && + amount == o.amount && + description == o.description && + expense_account == o.expense_account + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_type_id, amount, description, expense_account].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb b/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb new file mode 100644 index 00000000..90dd1e83 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb @@ -0,0 +1,211 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # The reimbursement type lines + require 'bigdecimal' + + class ReimbursementLines + + attr_accessor :reimbursement_lines + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_lines' => :'ReimbursementLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::ReimbursementLines` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::ReimbursementLines`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_lines == o.reimbursement_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_type.rb b/lib/xero-ruby/models/payroll_au/reimbursement_type.rb new file mode 100644 index 00000000..10ddf916 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/reimbursement_type.rb @@ -0,0 +1,263 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class ReimbursementType + # Name of the earnings rate (max length = 100) + attr_accessor :name + + # See Accounts + attr_accessor :account_code + + # Xero identifier + attr_accessor :reimbursement_type_id + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Is the current record + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'account_code' => :'AccountCode', + :'reimbursement_type_id' => :'ReimbursementTypeID', + :'updated_date_utc' => :'UpdatedDateUTC', + :'current_record' => :'CurrentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'account_code' => :'String', + :'reimbursement_type_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::ReimbursementType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::ReimbursementType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'reimbursement_type_id') + self.reimbursement_type_id = attributes[:'reimbursement_type_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + account_code == o.account_code && + reimbursement_type_id == o.reimbursement_type_id && + updated_date_utc == o.updated_date_utc && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, account_code, reimbursement_type_id, updated_date_utc, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/residency_status.rb b/lib/xero-ruby/models/payroll_au/residency_status.rb new file mode 100644 index 00000000..cd2569bb --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/residency_status.rb @@ -0,0 +1,38 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class ResidencyStatus + AUSTRALIANRESIDENT = "AUSTRALIANRESIDENT".freeze + FOREIGNRESIDENT = "FOREIGNRESIDENT".freeze + WORKINGHOLIDAYMAKER = "WORKINGHOLIDAYMAKER".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ResidencyStatus.constants.select { |c| ResidencyStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ResidencyStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/settings.rb b/lib/xero-ruby/models/payroll_au/settings.rb new file mode 100644 index 00000000..6c3ba5ff --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/settings.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Settings + # Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. + attr_accessor :accounts + + + attr_accessor :tracking_categories + + # Number of days in the Payroll year + attr_accessor :days_in_payroll_year + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'accounts' => :'Accounts', + :'tracking_categories' => :'TrackingCategories', + :'days_in_payroll_year' => :'DaysInPayrollYear' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'accounts' => :'Array', + :'tracking_categories' => :'SettingsTrackingCategories', + :'days_in_payroll_year' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Settings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Settings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + + if attributes.key?(:'tracking_categories') + self.tracking_categories = attributes[:'tracking_categories'] + end + + if attributes.key?(:'days_in_payroll_year') + self.days_in_payroll_year = attributes[:'days_in_payroll_year'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts && + tracking_categories == o.tracking_categories && + days_in_payroll_year == o.days_in_payroll_year + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [accounts, tracking_categories, days_in_payroll_year].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/settings_object.rb b/lib/xero-ruby/models/payroll_au/settings_object.rb new file mode 100644 index 00000000..6d8f1292 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/settings_object.rb @@ -0,0 +1,208 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SettingsObject + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'settings' => :'Settings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'settings' => :'Settings' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SettingsObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SettingsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [settings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb new file mode 100644 index 00000000..3b33a9ab --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb @@ -0,0 +1,219 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # Tracking categories for Employees and Timesheets + require 'bigdecimal' + + class SettingsTrackingCategories + + attr_accessor :employee_groups + + + attr_accessor :timesheet_categories + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_groups' => :'EmployeeGroups', + :'timesheet_categories' => :'TimesheetCategories' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_groups' => :'SettingsTrackingCategoriesEmployeeGroups', + :'timesheet_categories' => :'SettingsTrackingCategoriesTimesheetCategories' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SettingsTrackingCategories` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SettingsTrackingCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_groups') + self.employee_groups = attributes[:'employee_groups'] + end + + if attributes.key?(:'timesheet_categories') + self.timesheet_categories = attributes[:'timesheet_categories'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_groups == o.employee_groups && + timesheet_categories == o.timesheet_categories + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_groups, timesheet_categories].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb new file mode 100644 index 00000000..14b4d9a2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb @@ -0,0 +1,219 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # The tracking category used for employees + require 'bigdecimal' + + class SettingsTrackingCategoriesEmployeeGroups + # The identifier for the tracking category + attr_accessor :tracking_category_id + + # Name of the tracking category + attr_accessor :tracking_category_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_category_id' => :'TrackingCategoryID', + :'tracking_category_name' => :'TrackingCategoryName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_category_id' => :'String', + :'tracking_category_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_category_id') + self.tracking_category_id = attributes[:'tracking_category_id'] + end + + if attributes.key?(:'tracking_category_name') + self.tracking_category_name = attributes[:'tracking_category_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_category_id == o.tracking_category_id && + tracking_category_name == o.tracking_category_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_category_id, tracking_category_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb new file mode 100644 index 00000000..fdc2c924 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb @@ -0,0 +1,219 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + # The tracking category used for timesheets + require 'bigdecimal' + + class SettingsTrackingCategoriesTimesheetCategories + # The identifier for the tracking category + attr_accessor :tracking_category_id + + # Name of the tracking category + attr_accessor :tracking_category_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_category_id' => :'TrackingCategoryID', + :'tracking_category_name' => :'TrackingCategoryName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_category_id' => :'String', + :'tracking_category_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_category_id') + self.tracking_category_id = attributes[:'tracking_category_id'] + end + + if attributes.key?(:'tracking_category_name') + self.tracking_category_name = attributes[:'tracking_category_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_category_id == o.tracking_category_id && + tracking_category_name == o.tracking_category_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_category_id, tracking_category_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/state.rb b/lib/xero-ruby/models/payroll_au/state.rb new file mode 100644 index 00000000..78c28637 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/state.rb @@ -0,0 +1,43 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class State + ACT = "ACT".freeze + NSW = "NSW".freeze + NT = "NT".freeze + QLD = "QLD".freeze + SA = "SA".freeze + TAS = "TAS".freeze + VIC = "VIC".freeze + WA = "WA".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = State.constants.select { |c| State::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #State" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_fund.rb b/lib/xero-ruby/models/payroll_au/super_fund.rb new file mode 100644 index 00000000..42f2b32b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_fund.rb @@ -0,0 +1,335 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperFund + # Xero identifier for a super fund + attr_accessor :super_fund_id + + + attr_accessor :type + + # Name of the super fund + attr_accessor :name + + # ABN of the self managed super fund + attr_accessor :abn + + # BSB of the self managed super fund + attr_accessor :bsb + + # The account number for the self managed super fund. + attr_accessor :account_number + + # The account name for the self managed super fund. + attr_accessor :account_name + + # The electronic service address for the self managed super fund. + attr_accessor :electronic_service_address + + # Some funds assign a unique number to each employer + attr_accessor :employer_number + + # The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. + attr_accessor :spin + + # The USI of the Regulated SuperFund + attr_accessor :usi + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_fund_id' => :'SuperFundID', + :'type' => :'Type', + :'name' => :'Name', + :'abn' => :'ABN', + :'bsb' => :'BSB', + :'account_number' => :'AccountNumber', + :'account_name' => :'AccountName', + :'electronic_service_address' => :'ElectronicServiceAddress', + :'employer_number' => :'EmployerNumber', + :'spin' => :'SPIN', + :'usi' => :'USI', + :'updated_date_utc' => :'UpdatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_fund_id' => :'String', + :'type' => :'SuperFundType', + :'name' => :'String', + :'abn' => :'String', + :'bsb' => :'String', + :'account_number' => :'String', + :'account_name' => :'String', + :'electronic_service_address' => :'String', + :'employer_number' => :'String', + :'spin' => :'String', + :'usi' => :'String', + :'updated_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperFund` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperFund`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_fund_id') + self.super_fund_id = attributes[:'super_fund_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'abn') + self.abn = attributes[:'abn'] + end + + if attributes.key?(:'bsb') + self.bsb = attributes[:'bsb'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'electronic_service_address') + self.electronic_service_address = attributes[:'electronic_service_address'] + end + + if attributes.key?(:'employer_number') + self.employer_number = attributes[:'employer_number'] + end + + if attributes.key?(:'spin') + self.spin = attributes[:'spin'] + end + + if attributes.key?(:'usi') + self.usi = attributes[:'usi'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_fund_id == o.super_fund_id && + type == o.type && + name == o.name && + abn == o.abn && + bsb == o.bsb && + account_number == o.account_number && + account_name == o.account_name && + electronic_service_address == o.electronic_service_address && + employer_number == o.employer_number && + spin == o.spin && + usi == o.usi && + updated_date_utc == o.updated_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_fund_id, type, name, abn, bsb, account_number, account_name, electronic_service_address, employer_number, spin, usi, updated_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_fund_product.rb b/lib/xero-ruby/models/payroll_au/super_fund_product.rb new file mode 100644 index 00000000..6c752714 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_fund_product.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperFundProduct + # The ABN of the Regulated SuperFund + attr_accessor :abn + + # The USI of the Regulated SuperFund + attr_accessor :usi + + # The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN + attr_accessor :spin + + # The name of the Regulated SuperFund + attr_accessor :product_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'abn' => :'ABN', + :'usi' => :'USI', + :'spin' => :'SPIN', + :'product_name' => :'ProductName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'abn' => :'String', + :'usi' => :'String', + :'spin' => :'String', + :'product_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperFundProduct` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperFundProduct`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'abn') + self.abn = attributes[:'abn'] + end + + if attributes.key?(:'usi') + self.usi = attributes[:'usi'] + end + + if attributes.key?(:'spin') + self.spin = attributes[:'spin'] + end + + if attributes.key?(:'product_name') + self.product_name = attributes[:'product_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + abn == o.abn && + usi == o.usi && + spin == o.spin && + product_name == o.product_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [abn, usi, spin, product_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_fund_products.rb b/lib/xero-ruby/models/payroll_au/super_fund_products.rb new file mode 100644 index 00000000..078b5d3b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_fund_products.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperFundProducts + + attr_accessor :super_fund_products + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_fund_products' => :'SuperFundProducts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_fund_products' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperFundProducts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperFundProducts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_fund_products') + if (value = attributes[:'super_fund_products']).is_a?(Array) + self.super_fund_products = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_fund_products == o.super_fund_products + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_fund_products].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_fund_type.rb b/lib/xero-ruby/models/payroll_au/super_fund_type.rb new file mode 100644 index 00000000..06f0234f --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_fund_type.rb @@ -0,0 +1,37 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class SuperFundType + REGULATED = "REGULATED".freeze + SMSF = "SMSF".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SuperFundType.constants.select { |c| SuperFundType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SuperFundType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_funds.rb b/lib/xero-ruby/models/payroll_au/super_funds.rb new file mode 100644 index 00000000..ed1ad44e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_funds.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperFunds + + attr_accessor :super_funds + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_funds' => :'SuperFunds' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_funds' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperFunds` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperFunds`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_funds') + if (value = attributes[:'super_funds']).is_a?(Array) + self.super_funds = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_funds == o.super_funds + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_funds].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_line.rb b/lib/xero-ruby/models/payroll_au/super_line.rb new file mode 100644 index 00000000..49b760c3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_line.rb @@ -0,0 +1,278 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperLine + # Xero super membership ID + attr_accessor :super_membership_id + + + attr_accessor :contribution_type + + + attr_accessor :calculation_type + + # amount of mimimum earnings + attr_accessor :minimum_monthly_earnings + + # expense account code + attr_accessor :expense_account_code + + # liabilty account code + attr_accessor :liability_account_code + + # percentage for super line + attr_accessor :percentage + + # Super membership amount + attr_accessor :amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_membership_id' => :'SuperMembershipID', + :'contribution_type' => :'ContributionType', + :'calculation_type' => :'CalculationType', + :'minimum_monthly_earnings' => :'MinimumMonthlyEarnings', + :'expense_account_code' => :'ExpenseAccountCode', + :'liability_account_code' => :'LiabilityAccountCode', + :'percentage' => :'Percentage', + :'amount' => :'Amount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_membership_id' => :'String', + :'contribution_type' => :'SuperannuationContributionType', + :'calculation_type' => :'SuperannuationCalculationType', + :'minimum_monthly_earnings' => :'BigDecimal', + :'expense_account_code' => :'String', + :'liability_account_code' => :'String', + :'percentage' => :'BigDecimal', + :'amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_membership_id') + self.super_membership_id = attributes[:'super_membership_id'] + end + + if attributes.key?(:'contribution_type') + self.contribution_type = attributes[:'contribution_type'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'minimum_monthly_earnings') + self.minimum_monthly_earnings = attributes[:'minimum_monthly_earnings'] + end + + if attributes.key?(:'expense_account_code') + self.expense_account_code = attributes[:'expense_account_code'] + end + + if attributes.key?(:'liability_account_code') + self.liability_account_code = attributes[:'liability_account_code'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_membership_id == o.super_membership_id && + contribution_type == o.contribution_type && + calculation_type == o.calculation_type && + minimum_monthly_earnings == o.minimum_monthly_earnings && + expense_account_code == o.expense_account_code && + liability_account_code == o.liability_account_code && + percentage == o.percentage && + amount == o.amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_membership_id, contribution_type, calculation_type, minimum_monthly_earnings, expense_account_code, liability_account_code, percentage, amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/super_membership.rb b/lib/xero-ruby/models/payroll_au/super_membership.rb new file mode 100644 index 00000000..2b4fe99f --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/super_membership.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperMembership + # Xero unique identifier for Super membership + attr_accessor :super_membership_id + + # Xero identifier for super fund + attr_accessor :super_fund_id + + # The memberhsip number assigned to the employee by the super fund. + attr_accessor :employee_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_membership_id' => :'SuperMembershipID', + :'super_fund_id' => :'SuperFundID', + :'employee_number' => :'EmployeeNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_membership_id' => :'String', + :'super_fund_id' => :'String', + :'employee_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperMembership` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperMembership`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_membership_id') + self.super_membership_id = attributes[:'super_membership_id'] + end + + if attributes.key?(:'super_fund_id') + self.super_fund_id = attributes[:'super_fund_id'] + end + + if attributes.key?(:'employee_number') + self.employee_number = attributes[:'employee_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @super_fund_id.nil? + invalid_properties.push('invalid value for "super_fund_id", super_fund_id cannot be nil.') + end + + if @employee_number.nil? + invalid_properties.push('invalid value for "employee_number", employee_number cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @super_fund_id.nil? + return false if @employee_number.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_membership_id == o.super_membership_id && + super_fund_id == o.super_fund_id && + employee_number == o.employee_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_membership_id, super_fund_id, employee_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb b/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb new file mode 100644 index 00000000..c0b4d880 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb @@ -0,0 +1,38 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class SuperannuationCalculationType + FIXEDAMOUNT = "FIXEDAMOUNT".freeze + PERCENTAGEOFEARNINGS = "PERCENTAGEOFEARNINGS".freeze + STATUTORY = "STATUTORY".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SuperannuationCalculationType.constants.select { |c| SuperannuationCalculationType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SuperannuationCalculationType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb b/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb new file mode 100644 index 00000000..659f9a63 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb @@ -0,0 +1,39 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class SuperannuationContributionType + SGC = "SGC".freeze + SALARYSACRIFICE = "SALARYSACRIFICE".freeze + EMPLOYERADDITIONAL = "EMPLOYERADDITIONAL".freeze + EMPLOYEE = "EMPLOYEE".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SuperannuationContributionType.constants.select { |c| SuperannuationContributionType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SuperannuationContributionType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/superannuation_line.rb b/lib/xero-ruby/models/payroll_au/superannuation_line.rb new file mode 100644 index 00000000..c994c56e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/superannuation_line.rb @@ -0,0 +1,288 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class SuperannuationLine + # Xero identifier for payroll super fund membership ID. + attr_accessor :super_membership_id + + + attr_accessor :contribution_type + + + attr_accessor :calculation_type + + # Superannuation minimum monthly earnings. + attr_accessor :minimum_monthly_earnings + + # Superannuation expense account code. + attr_accessor :expense_account_code + + # Superannuation liability account code + attr_accessor :liability_account_code + + # Superannuation payment date for the current period (YYYY-MM-DD) + attr_accessor :payment_date_for_this_period + + # Superannuation percentage + attr_accessor :percentage + + # Superannuation amount + attr_accessor :amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'super_membership_id' => :'SuperMembershipID', + :'contribution_type' => :'ContributionType', + :'calculation_type' => :'CalculationType', + :'minimum_monthly_earnings' => :'MinimumMonthlyEarnings', + :'expense_account_code' => :'ExpenseAccountCode', + :'liability_account_code' => :'LiabilityAccountCode', + :'payment_date_for_this_period' => :'PaymentDateForThisPeriod', + :'percentage' => :'Percentage', + :'amount' => :'Amount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'super_membership_id' => :'String', + :'contribution_type' => :'SuperannuationContributionType', + :'calculation_type' => :'SuperannuationCalculationType', + :'minimum_monthly_earnings' => :'BigDecimal', + :'expense_account_code' => :'String', + :'liability_account_code' => :'String', + :'payment_date_for_this_period' => :'Date', + :'percentage' => :'BigDecimal', + :'amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::SuperannuationLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::SuperannuationLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'super_membership_id') + self.super_membership_id = attributes[:'super_membership_id'] + end + + if attributes.key?(:'contribution_type') + self.contribution_type = attributes[:'contribution_type'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'minimum_monthly_earnings') + self.minimum_monthly_earnings = attributes[:'minimum_monthly_earnings'] + end + + if attributes.key?(:'expense_account_code') + self.expense_account_code = attributes[:'expense_account_code'] + end + + if attributes.key?(:'liability_account_code') + self.liability_account_code = attributes[:'liability_account_code'] + end + + if attributes.key?(:'payment_date_for_this_period') + self.payment_date_for_this_period = attributes[:'payment_date_for_this_period'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + super_membership_id == o.super_membership_id && + contribution_type == o.contribution_type && + calculation_type == o.calculation_type && + minimum_monthly_earnings == o.minimum_monthly_earnings && + expense_account_code == o.expense_account_code && + liability_account_code == o.liability_account_code && + payment_date_for_this_period == o.payment_date_for_this_period && + percentage == o.percentage && + amount == o.amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [super_membership_id, contribution_type, calculation_type, minimum_monthly_earnings, expense_account_code, liability_account_code, payment_date_for_this_period, percentage, amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/tax_declaration.rb b/lib/xero-ruby/models/payroll_au/tax_declaration.rb new file mode 100644 index 00000000..40c4cc5b --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/tax_declaration.rb @@ -0,0 +1,358 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class TaxDeclaration + # Address line 1 for employee home address + attr_accessor :employee_id + + + attr_accessor :employment_basis + + + attr_accessor :tfn_exemption_type + + # The tax file number e.g 123123123. + attr_accessor :tax_file_number + + # If the employee is Australian resident for tax purposes. e.g true or false + attr_accessor :australian_resident_for_tax_purposes + + + attr_accessor :residency_status + + # If tax free threshold claimed. e.g true or false + attr_accessor :tax_free_threshold_claimed + + # If has tax offset estimated then the tax offset estimated amount. e.g 100 + attr_accessor :tax_offset_estimated_amount + + # If employee has HECS or HELP debt. e.g true or false + attr_accessor :has_help_debt + + # If employee has financial supplement debt. e.g true or false + attr_accessor :has_sfss_debt + + # If employee has trade support loan. e.g true or false + attr_accessor :has_trade_support_loan_debt + + # If the employee has requested that additional tax be withheld each pay run. e.g 50 + attr_accessor :upward_variation_tax_withholding_amount + + # If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false + attr_accessor :eligible_to_receive_leave_loading + + # If the employee has approved withholding variation. e.g (0 - 100) + attr_accessor :approved_withholding_variation_percentage + + # If the employee is eligible for student startup loan rules + attr_accessor :has_student_startup_loan + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'EmployeeID', + :'employment_basis' => :'EmploymentBasis', + :'tfn_exemption_type' => :'TFNExemptionType', + :'tax_file_number' => :'TaxFileNumber', + :'australian_resident_for_tax_purposes' => :'AustralianResidentForTaxPurposes', + :'residency_status' => :'ResidencyStatus', + :'tax_free_threshold_claimed' => :'TaxFreeThresholdClaimed', + :'tax_offset_estimated_amount' => :'TaxOffsetEstimatedAmount', + :'has_help_debt' => :'HasHELPDebt', + :'has_sfss_debt' => :'HasSFSSDebt', + :'has_trade_support_loan_debt' => :'HasTradeSupportLoanDebt', + :'upward_variation_tax_withholding_amount' => :'UpwardVariationTaxWithholdingAmount', + :'eligible_to_receive_leave_loading' => :'EligibleToReceiveLeaveLoading', + :'approved_withholding_variation_percentage' => :'ApprovedWithholdingVariationPercentage', + :'has_student_startup_loan' => :'HasStudentStartupLoan', + :'updated_date_utc' => :'UpdatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'employment_basis' => :'EmploymentBasis', + :'tfn_exemption_type' => :'TFNExemptionType', + :'tax_file_number' => :'String', + :'australian_resident_for_tax_purposes' => :'Boolean', + :'residency_status' => :'ResidencyStatus', + :'tax_free_threshold_claimed' => :'Boolean', + :'tax_offset_estimated_amount' => :'Float', + :'has_help_debt' => :'Boolean', + :'has_sfss_debt' => :'Boolean', + :'has_trade_support_loan_debt' => :'Boolean', + :'upward_variation_tax_withholding_amount' => :'Float', + :'eligible_to_receive_leave_loading' => :'Boolean', + :'approved_withholding_variation_percentage' => :'Float', + :'has_student_startup_loan' => :'Boolean', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::TaxDeclaration` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::TaxDeclaration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'employment_basis') + self.employment_basis = attributes[:'employment_basis'] + end + + if attributes.key?(:'tfn_exemption_type') + self.tfn_exemption_type = attributes[:'tfn_exemption_type'] + end + + if attributes.key?(:'tax_file_number') + self.tax_file_number = attributes[:'tax_file_number'] + end + + if attributes.key?(:'australian_resident_for_tax_purposes') + self.australian_resident_for_tax_purposes = attributes[:'australian_resident_for_tax_purposes'] + end + + if attributes.key?(:'residency_status') + self.residency_status = attributes[:'residency_status'] + end + + if attributes.key?(:'tax_free_threshold_claimed') + self.tax_free_threshold_claimed = attributes[:'tax_free_threshold_claimed'] + end + + if attributes.key?(:'tax_offset_estimated_amount') + self.tax_offset_estimated_amount = attributes[:'tax_offset_estimated_amount'] + end + + if attributes.key?(:'has_help_debt') + self.has_help_debt = attributes[:'has_help_debt'] + end + + if attributes.key?(:'has_sfss_debt') + self.has_sfss_debt = attributes[:'has_sfss_debt'] + end + + if attributes.key?(:'has_trade_support_loan_debt') + self.has_trade_support_loan_debt = attributes[:'has_trade_support_loan_debt'] + end + + if attributes.key?(:'upward_variation_tax_withholding_amount') + self.upward_variation_tax_withholding_amount = attributes[:'upward_variation_tax_withholding_amount'] + end + + if attributes.key?(:'eligible_to_receive_leave_loading') + self.eligible_to_receive_leave_loading = attributes[:'eligible_to_receive_leave_loading'] + end + + if attributes.key?(:'approved_withholding_variation_percentage') + self.approved_withholding_variation_percentage = attributes[:'approved_withholding_variation_percentage'] + end + + if attributes.key?(:'has_student_startup_loan') + self.has_student_startup_loan = attributes[:'has_student_startup_loan'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + employment_basis == o.employment_basis && + tfn_exemption_type == o.tfn_exemption_type && + tax_file_number == o.tax_file_number && + australian_resident_for_tax_purposes == o.australian_resident_for_tax_purposes && + residency_status == o.residency_status && + tax_free_threshold_claimed == o.tax_free_threshold_claimed && + tax_offset_estimated_amount == o.tax_offset_estimated_amount && + has_help_debt == o.has_help_debt && + has_sfss_debt == o.has_sfss_debt && + has_trade_support_loan_debt == o.has_trade_support_loan_debt && + upward_variation_tax_withholding_amount == o.upward_variation_tax_withholding_amount && + eligible_to_receive_leave_loading == o.eligible_to_receive_leave_loading && + approved_withholding_variation_percentage == o.approved_withholding_variation_percentage && + has_student_startup_loan == o.has_student_startup_loan && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, employment_basis, tfn_exemption_type, tax_file_number, australian_resident_for_tax_purposes, residency_status, tax_free_threshold_claimed, tax_offset_estimated_amount, has_help_debt, has_sfss_debt, has_trade_support_loan_debt, upward_variation_tax_withholding_amount, eligible_to_receive_leave_loading, approved_withholding_variation_percentage, has_student_startup_loan, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/tax_line.rb b/lib/xero-ruby/models/payroll_au/tax_line.rb new file mode 100644 index 00000000..a7078d4e --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/tax_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class TaxLine + # Xero identifier for payslip tax line ID. + attr_accessor :payslip_tax_line_id + + # The tax line amount + attr_accessor :amount + + # Name of the tax type. + attr_accessor :tax_type_name + + # Description of the tax line. + attr_accessor :description + + + attr_accessor :manual_tax_type + + # The tax line liability account code. For posted pay run you should be able to see liability account code + attr_accessor :liability_account + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payslip_tax_line_id' => :'PayslipTaxLineID', + :'amount' => :'Amount', + :'tax_type_name' => :'TaxTypeName', + :'description' => :'Description', + :'manual_tax_type' => :'ManualTaxType', + :'liability_account' => :'LiabilityAccount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payslip_tax_line_id' => :'String', + :'amount' => :'BigDecimal', + :'tax_type_name' => :'String', + :'description' => :'String', + :'manual_tax_type' => :'ManualTaxType', + :'liability_account' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::TaxLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::TaxLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payslip_tax_line_id') + self.payslip_tax_line_id = attributes[:'payslip_tax_line_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'tax_type_name') + self.tax_type_name = attributes[:'tax_type_name'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'manual_tax_type') + self.manual_tax_type = attributes[:'manual_tax_type'] + end + + if attributes.key?(:'liability_account') + self.liability_account = attributes[:'liability_account'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payslip_tax_line_id == o.payslip_tax_line_id && + amount == o.amount && + tax_type_name == o.tax_type_name && + description == o.description && + manual_tax_type == o.manual_tax_type && + liability_account == o.liability_account + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payslip_tax_line_id, amount, tax_type_name, description, manual_tax_type, liability_account].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb b/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb new file mode 100644 index 00000000..db1fc6f3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb @@ -0,0 +1,39 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class TFNExemptionType + NOTQUOTED = "NOTQUOTED".freeze + PENDING = "PENDING".freeze + PENSIONER = "PENSIONER".freeze + UNDER18 = "UNDER18".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TFNExemptionType.constants.select { |c| TFNExemptionType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TFNExemptionType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/timesheet.rb b/lib/xero-ruby/models/payroll_au/timesheet.rb new file mode 100644 index 00000000..1a201c83 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/timesheet.rb @@ -0,0 +1,307 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Timesheet + # The Xero identifier for an employee + attr_accessor :employee_id + + # Period start date (YYYY-MM-DD) + attr_accessor :start_date + + # Period end date (YYYY-MM-DD) + attr_accessor :end_date + + + attr_accessor :status + + # Timesheet total hours + attr_accessor :hours + + # The Xero identifier for a Payroll Timesheet + attr_accessor :timesheet_id + + + attr_accessor :timesheet_lines + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'EmployeeID', + :'start_date' => :'StartDate', + :'end_date' => :'EndDate', + :'status' => :'Status', + :'hours' => :'Hours', + :'timesheet_id' => :'TimesheetID', + :'timesheet_lines' => :'TimesheetLines', + :'updated_date_utc' => :'UpdatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'status' => :'TimesheetStatus', + :'hours' => :'BigDecimal', + :'timesheet_id' => :'String', + :'timesheet_lines' => :'Array', + :'updated_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Timesheet` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Timesheet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'hours') + self.hours = attributes[:'hours'] + end + + if attributes.key?(:'timesheet_id') + self.timesheet_id = attributes[:'timesheet_id'] + end + + if attributes.key?(:'timesheet_lines') + if (value = attributes[:'timesheet_lines']).is_a?(Array) + self.timesheet_lines = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @employee_id.nil? + invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @employee_id.nil? + return false if @start_date.nil? + return false if @end_date.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + start_date == o.start_date && + end_date == o.end_date && + status == o.status && + hours == o.hours && + timesheet_id == o.timesheet_id && + timesheet_lines == o.timesheet_lines && + updated_date_utc == o.updated_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, start_date, end_date, status, hours, timesheet_id, timesheet_lines, updated_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/timesheet_line.rb b/lib/xero-ruby/models/payroll_au/timesheet_line.rb new file mode 100644 index 00000000..3b511302 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/timesheet_line.rb @@ -0,0 +1,240 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class TimesheetLine + # The Xero identifier for an Earnings Rate + attr_accessor :earnings_rate_id + + # The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. + attr_accessor :tracking_item_id + + # The number of units on a timesheet line + attr_accessor :number_of_units + + # Last modified timestamp + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'EarningsRateID', + :'tracking_item_id' => :'TrackingItemID', + :'number_of_units' => :'NumberOfUnits', + :'updated_date_utc' => :'UpdatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'tracking_item_id' => :'String', + :'number_of_units' => :'Array', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::TimesheetLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::TimesheetLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'tracking_item_id') + self.tracking_item_id = attributes[:'tracking_item_id'] + end + + if attributes.key?(:'number_of_units') + if (value = attributes[:'number_of_units']).is_a?(Array) + self.number_of_units = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + tracking_item_id == o.tracking_item_id && + number_of_units == o.number_of_units && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, tracking_item_id, number_of_units, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/timesheet_object.rb b/lib/xero-ruby/models/payroll_au/timesheet_object.rb new file mode 100644 index 00000000..ae689c5c --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/timesheet_object.rb @@ -0,0 +1,208 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class TimesheetObject + + attr_accessor :timesheet + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheet' => :'Timesheet' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheet' => :'Timesheet' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::TimesheetObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::TimesheetObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheet') + self.timesheet = attributes[:'timesheet'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheet == o.timesheet + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheet].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/timesheet_status.rb b/lib/xero-ruby/models/payroll_au/timesheet_status.rb new file mode 100644 index 00000000..5c3ad0e3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/timesheet_status.rb @@ -0,0 +1,40 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + class TimesheetStatus + DRAFT = "DRAFT".freeze + PROCESSED = "PROCESSED".freeze + APPROVED = "APPROVED".freeze + REJECTED = "REJECTED".freeze + REQUESTED = "REQUESTED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TimesheetStatus.constants.select { |c| TimesheetStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TimesheetStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/timesheets.rb b/lib/xero-ruby/models/payroll_au/timesheets.rb new file mode 100644 index 00000000..84aa2119 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/timesheets.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class Timesheets + + attr_accessor :timesheets + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheets' => :'Timesheets' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheets' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::Timesheets` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::Timesheets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheets') + if (value = attributes[:'timesheets']).is_a?(Array) + self.timesheets = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheets == o.timesheets + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheets].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_au/validation_error.rb b/lib/xero-ruby/models/payroll_au/validation_error.rb new file mode 100644 index 00000000..de310c33 --- /dev/null +++ b/lib/xero-ruby/models/payroll_au/validation_error.rb @@ -0,0 +1,208 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollAu + require 'bigdecimal' + + class ValidationError + # Validation error message + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'Message' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::ValidationError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollAu.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/account.rb b/lib/xero-ruby/models/payroll_nz/account.rb new file mode 100644 index 00000000..068bc52d --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/account.rb @@ -0,0 +1,276 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Account + # The Xero identifier for Settings. + attr_accessor :account_id + + # The assigned AccountType + attr_accessor :type + PAYELIABILITY = "PAYELIABILITY".freeze + WAGESPAYABLE = "WAGESPAYABLE".freeze + WAGESEXPENSE = "WAGESEXPENSE".freeze + BANK = "BANK".freeze + + # A unique 3 digit number for each Account + attr_accessor :code + + # Name of the Account. + attr_accessor :name + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_id' => :'accountID', + :'type' => :'type', + :'code' => :'code', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_id' => :'String', + :'type' => :'String', + :'code' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Account` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE", "BANK"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE", "BANK"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + type == o.type && + code == o.code && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_id, type, code, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/accounts.rb b/lib/xero-ruby/models/payroll_nz/accounts.rb new file mode 100644 index 00000000..f6aa75cd --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/accounts.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Accounts + + attr_accessor :accounts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'accounts' => :'accounts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'accounts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Accounts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Accounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [accounts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/address.rb b/lib/xero-ruby/models/payroll_nz/address.rb new file mode 100644 index 00000000..e12df6c1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/address.rb @@ -0,0 +1,273 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Address + # Address line 1 for employee home address + attr_accessor :address_line1 + + # Address line 2 for employee home address + attr_accessor :address_line2 + + # Suburb for employee home address + attr_accessor :city + + # Suburb for employee home address + attr_accessor :suburb + + # PostCode for employee home address + attr_accessor :post_code + + # Country of HomeAddress + attr_accessor :country_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'address_line1' => :'addressLine1', + :'address_line2' => :'addressLine2', + :'city' => :'city', + :'suburb' => :'suburb', + :'post_code' => :'postCode', + :'country_name' => :'countryName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'address_line1' => :'String', + :'address_line2' => :'String', + :'city' => :'String', + :'suburb' => :'String', + :'post_code' => :'String', + :'country_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Address` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'address_line1') + self.address_line1 = attributes[:'address_line1'] + end + + if attributes.key?(:'address_line2') + self.address_line2 = attributes[:'address_line2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'suburb') + self.suburb = attributes[:'suburb'] + end + + if attributes.key?(:'post_code') + self.post_code = attributes[:'post_code'] + end + + if attributes.key?(:'country_name') + self.country_name = attributes[:'country_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @address_line1.nil? + invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @post_code.nil? + invalid_properties.push('invalid value for "post_code", post_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @address_line1.nil? + return false if @city.nil? + return false if @post_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address_line1 == o.address_line1 && + address_line2 == o.address_line2 && + city == o.city && + suburb == o.suburb && + post_code == o.post_code && + country_name == o.country_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [address_line1, address_line2, city, suburb, post_code, country_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/bank_account.rb b/lib/xero-ruby/models/payroll_nz/bank_account.rb new file mode 100644 index 00000000..048fbc08 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/bank_account.rb @@ -0,0 +1,329 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class BankAccount + # Bank account name (max length = 32) + attr_accessor :account_name + + # Bank account number (digits only; max length = 8) + attr_accessor :account_number + + # Bank account sort code (6 digits) + attr_accessor :sort_code + + # Particulars that appear on the statement. + attr_accessor :particulars + + # Code of a transaction that appear on the statement. + attr_accessor :code + + # Dollar amount of a transaction. + attr_accessor :dollar_amount + + # Statement Text/reference for a transaction that appear on the statement. + attr_accessor :reference + + # Calculation type for the transaction can be 'Fixed Amount' or 'Balance' + attr_accessor :calculation_type + FIXED_AMOUNT = "FixedAmount".freeze + BALANCE = "Balance".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_name' => :'accountName', + :'account_number' => :'accountNumber', + :'sort_code' => :'sortCode', + :'particulars' => :'particulars', + :'code' => :'code', + :'dollar_amount' => :'dollarAmount', + :'reference' => :'reference', + :'calculation_type' => :'calculationType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_name' => :'String', + :'account_number' => :'String', + :'sort_code' => :'String', + :'particulars' => :'String', + :'code' => :'String', + :'dollar_amount' => :'BigDecimal', + :'reference' => :'String', + :'calculation_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::BankAccount` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::BankAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'sort_code') + self.sort_code = attributes[:'sort_code'] + end + + if attributes.key?(:'particulars') + self.particulars = attributes[:'particulars'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'dollar_amount') + self.dollar_amount = attributes[:'dollar_amount'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @account_name.nil? + invalid_properties.push('invalid value for "account_name", account_name cannot be nil.') + end + + if @account_number.nil? + invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') + end + + if @sort_code.nil? + invalid_properties.push('invalid value for "sort_code", sort_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @account_name.nil? + return false if @account_number.nil? + return false if @sort_code.nil? + calculation_type_validator = EnumAttributeValidator.new('String', ["FixedAmount", "Balance"]) + return false unless calculation_type_validator.valid?(@calculation_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calculation_type Object to be assigned + def calculation_type=(calculation_type) + validator = EnumAttributeValidator.new('String', ["FixedAmount", "Balance"]) + unless validator.valid?(calculation_type) + fail ArgumentError, "invalid value for \"calculation_type\", must be one of #{validator.allowable_values}." + end + @calculation_type = calculation_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_name == o.account_name && + account_number == o.account_number && + sort_code == o.sort_code && + particulars == o.particulars && + code == o.code && + dollar_amount == o.dollar_amount && + reference == o.reference && + calculation_type == o.calculation_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_name, account_number, sort_code, particulars, code, dollar_amount, reference, calculation_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/benefit.rb b/lib/xero-ruby/models/payroll_nz/benefit.rb new file mode 100644 index 00000000..e578fcb2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/benefit.rb @@ -0,0 +1,369 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Benefit + # The Xero identifier for superannuation + attr_accessor :id + + # Name of the superannuations + attr_accessor :name + + # Superannuations Category type + attr_accessor :category + KIWI_SAVER = "KiwiSaver".freeze + COMPLYING_FUND = "ComplyingFund".freeze + OTHER = "Other".freeze + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Xero identifier for Expense Account + attr_accessor :expense_account_id + + # Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings + attr_accessor :calculation_type_nz + FIXED_AMOUNT = "FixedAmount".freeze + PERCENTAGE_OF_TAXABLE_EARNINGS = "PercentageOfTaxableEarnings".freeze + + # Standard amount of the superannuation + attr_accessor :standard_amount + + # Percentage of Taxable Earnings of the superannuation + attr_accessor :percentage + + # Company Maximum amount of the superannuation + attr_accessor :company_max + + # Identifier of a record is active or not. + attr_accessor :current_record + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'category' => :'category', + :'liability_account_id' => :'liabilityAccountId', + :'expense_account_id' => :'expenseAccountId', + :'calculation_type_nz' => :'calculationTypeNZ', + :'standard_amount' => :'standardAmount', + :'percentage' => :'percentage', + :'company_max' => :'companyMax', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'category' => :'String', + :'liability_account_id' => :'String', + :'expense_account_id' => :'String', + :'calculation_type_nz' => :'String', + :'standard_amount' => :'BigDecimal', + :'percentage' => :'BigDecimal', + :'company_max' => :'BigDecimal', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Benefit` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Benefit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'expense_account_id') + self.expense_account_id = attributes[:'expense_account_id'] + end + + if attributes.key?(:'calculation_type_nz') + self.calculation_type_nz = attributes[:'calculation_type_nz'] + end + + if attributes.key?(:'standard_amount') + self.standard_amount = attributes[:'standard_amount'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'company_max') + self.company_max = attributes[:'company_max'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @category.nil? + invalid_properties.push('invalid value for "category", category cannot be nil.') + end + + if @liability_account_id.nil? + invalid_properties.push('invalid value for "liability_account_id", liability_account_id cannot be nil.') + end + + if @expense_account_id.nil? + invalid_properties.push('invalid value for "expense_account_id", expense_account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @category.nil? + category_validator = EnumAttributeValidator.new('String', ["KiwiSaver", "ComplyingFund", "Other"]) + return false unless category_validator.valid?(@category) + return false if @liability_account_id.nil? + return false if @expense_account_id.nil? + calculation_type_nz_validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfTaxableEarnings"]) + return false unless calculation_type_nz_validator.valid?(@calculation_type_nz) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] category Object to be assigned + def category=(category) + validator = EnumAttributeValidator.new('String', ["KiwiSaver", "ComplyingFund", "Other"]) + unless validator.valid?(category) + fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}." + end + @category = category + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calculation_type_nz Object to be assigned + def calculation_type_nz=(calculation_type_nz) + validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfTaxableEarnings"]) + unless validator.valid?(calculation_type_nz) + fail ArgumentError, "invalid value for \"calculation_type_nz\", must be one of #{validator.allowable_values}." + end + @calculation_type_nz = calculation_type_nz + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + category == o.category && + liability_account_id == o.liability_account_id && + expense_account_id == o.expense_account_id && + calculation_type_nz == o.calculation_type_nz && + standard_amount == o.standard_amount && + percentage == o.percentage && + company_max == o.company_max && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, category, liability_account_id, expense_account_id, calculation_type_nz, standard_amount, percentage, company_max, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/deduction.rb b/lib/xero-ruby/models/payroll_nz/deduction.rb new file mode 100644 index 00000000..3f120a7a --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/deduction.rb @@ -0,0 +1,311 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Deduction + # The Xero identifier for Deduction + attr_accessor :deduction_id + + # Name of the deduction + attr_accessor :deduction_name + + # Deduction Category type + attr_accessor :deduction_category + PAYROLL_GIVING = "PayrollGiving".freeze + KIWI_SAVER_VOLUNTARY_CONTRIBUTIONS = "KiwiSaverVoluntaryContributions".freeze + SUPERANNUATION = "Superannuation".freeze + NZ_OTHER = "NzOther".freeze + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Standard amount of the deduction. + attr_accessor :standard_amount + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deduction_id' => :'deductionId', + :'deduction_name' => :'deductionName', + :'deduction_category' => :'deductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord', + :'standard_amount' => :'standardAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'deduction_id' => :'String', + :'deduction_name' => :'String', + :'deduction_category' => :'String', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean', + :'standard_amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Deduction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Deduction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deduction_id') + self.deduction_id = attributes[:'deduction_id'] + end + + if attributes.key?(:'deduction_name') + self.deduction_name = attributes[:'deduction_name'] + end + + if attributes.key?(:'deduction_category') + self.deduction_category = attributes[:'deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'standard_amount') + self.standard_amount = attributes[:'standard_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @deduction_name.nil? + invalid_properties.push('invalid value for "deduction_name", deduction_name cannot be nil.') + end + + if @deduction_category.nil? + invalid_properties.push('invalid value for "deduction_category", deduction_category cannot be nil.') + end + + if @liability_account_id.nil? + invalid_properties.push('invalid value for "liability_account_id", liability_account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @deduction_name.nil? + return false if @deduction_category.nil? + deduction_category_validator = EnumAttributeValidator.new('String', ["PayrollGiving", "KiwiSaverVoluntaryContributions", "Superannuation", "NzOther"]) + return false unless deduction_category_validator.valid?(@deduction_category) + return false if @liability_account_id.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deduction_category Object to be assigned + def deduction_category=(deduction_category) + validator = EnumAttributeValidator.new('String', ["PayrollGiving", "KiwiSaverVoluntaryContributions", "Superannuation", "NzOther"]) + unless validator.valid?(deduction_category) + fail ArgumentError, "invalid value for \"deduction_category\", must be one of #{validator.allowable_values}." + end + @deduction_category = deduction_category + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deduction_id == o.deduction_id && + deduction_name == o.deduction_name && + deduction_category == o.deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record && + standard_amount == o.standard_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deduction_id, deduction_name, deduction_category, liability_account_id, current_record, standard_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/deduction_line.rb b/lib/xero-ruby/models/payroll_nz/deduction_line.rb new file mode 100644 index 00000000..33cb6876 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/deduction_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class DeductionLine + # Xero identifier for payroll deduction + attr_accessor :deduction_type_id + + # name of earnings rate for display in UI + attr_accessor :display_name + + # The amount of the deduction line + attr_accessor :amount + + # Identifies if the deduction is subject to tax + attr_accessor :subject_to_tax + + # Deduction rate percentage + attr_accessor :percentage + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deduction_type_id' => :'deductionTypeID', + :'display_name' => :'displayName', + :'amount' => :'amount', + :'subject_to_tax' => :'subjectToTax', + :'percentage' => :'percentage' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'deduction_type_id' => :'String', + :'display_name' => :'String', + :'amount' => :'BigDecimal', + :'subject_to_tax' => :'Boolean', + :'percentage' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::DeductionLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::DeductionLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deduction_type_id') + self.deduction_type_id = attributes[:'deduction_type_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'subject_to_tax') + self.subject_to_tax = attributes[:'subject_to_tax'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deduction_type_id == o.deduction_type_id && + display_name == o.display_name && + amount == o.amount && + subject_to_tax == o.subject_to_tax && + percentage == o.percentage + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deduction_type_id, display_name, amount, subject_to_tax, percentage].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/deduction_object.rb b/lib/xero-ruby/models/payroll_nz/deduction_object.rb new file mode 100644 index 00000000..3e7325d0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/deduction_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class DeductionObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :deduction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'deduction' => :'deduction' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'deduction' => :'Deduction' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::DeductionObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::DeductionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'deduction') + self.deduction = attributes[:'deduction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + deduction == o.deduction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, deduction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/deductions.rb b/lib/xero-ruby/models/payroll_nz/deductions.rb new file mode 100644 index 00000000..a4dbe253 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/deductions.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Deductions + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :deductions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'deductions' => :'deductions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'deductions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Deductions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Deductions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'deductions') + if (value = attributes[:'deductions']).is_a?(Array) + self.deductions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + deductions == o.deductions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, deductions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_line.rb b/lib/xero-ruby/models/payroll_nz/earnings_line.rb new file mode 100644 index 00000000..8818ee6f --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_line.rb @@ -0,0 +1,298 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsLine + # Xero identifier for payroll earnings line + attr_accessor :earnings_line_id + + # Xero identifier for payroll earnings rate + attr_accessor :earnings_rate_id + + # name of earnings rate for display in UI + attr_accessor :display_name + + # Rate per unit for earnings line + attr_accessor :rate_per_unit + + # Earnings number of units + attr_accessor :number_of_units + + # Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the earnings line. + attr_accessor :amount + + # Identifies if the earnings is taken from the timesheet. False for earnings line + attr_accessor :is_linked_to_timesheet + + # Identifies if the earnings is using an average daily pay rate + attr_accessor :is_average_daily_pay_rate + + # Flag to indentify whether the earnings line is system generated or not. + attr_accessor :is_system_generated + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_line_id' => :'earningsLineID', + :'earnings_rate_id' => :'earningsRateID', + :'display_name' => :'displayName', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet', + :'is_average_daily_pay_rate' => :'isAverageDailyPayRate', + :'is_system_generated' => :'isSystemGenerated' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_line_id' => :'String', + :'earnings_rate_id' => :'String', + :'display_name' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'amount' => :'BigDecimal', + :'is_linked_to_timesheet' => :'Boolean', + :'is_average_daily_pay_rate' => :'Boolean', + :'is_system_generated' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_line_id') + self.earnings_line_id = attributes[:'earnings_line_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + + if attributes.key?(:'is_average_daily_pay_rate') + self.is_average_daily_pay_rate = attributes[:'is_average_daily_pay_rate'] + end + + if attributes.key?(:'is_system_generated') + self.is_system_generated = attributes[:'is_system_generated'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_line_id == o.earnings_line_id && + earnings_rate_id == o.earnings_rate_id && + display_name == o.display_name && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet && + is_average_daily_pay_rate == o.is_average_daily_pay_rate && + is_system_generated == o.is_system_generated + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_line_id, earnings_rate_id, display_name, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet, is_average_daily_pay_rate, is_system_generated].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_order.rb b/lib/xero-ruby/models/payroll_nz/earnings_order.rb new file mode 100644 index 00000000..c65f4af0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_order.rb @@ -0,0 +1,255 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsOrder + # Xero unique identifier for an earning rate + attr_accessor :id + + # Name of the earning order + attr_accessor :name + + + attr_accessor :statutory_deduction_category + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'statutory_deduction_category' => :'statutoryDeductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'statutory_deduction_category' => :'StatutoryDeductionCategory', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsOrder` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'statutory_deduction_category') + self.statutory_deduction_category = attributes[:'statutory_deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + else + self.current_record = true + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + statutory_deduction_category == o.statutory_deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, statutory_deduction_category, liability_account_id, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb new file mode 100644 index 00000000..c93be063 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsOrderObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deduction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deduction' => :'statutoryDeduction' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deduction' => :'EarningsOrder' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsOrderObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsOrderObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deduction') + self.statutory_deduction = attributes[:'statutory_deduction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deduction == o.statutory_deduction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deduction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_orders.rb b/lib/xero-ruby/models/payroll_nz/earnings_orders.rb new file mode 100644 index 00000000..8ef44526 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_orders.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsOrders + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deductions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deductions' => :'statutoryDeductions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deductions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsOrders` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsOrders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deductions') + if (value = attributes[:'statutory_deductions']).is_a?(Array) + self.statutory_deductions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deductions == o.statutory_deductions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deductions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rate.rb b/lib/xero-ruby/models/payroll_nz/earnings_rate.rb new file mode 100644 index 00000000..8248fc1f --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_rate.rb @@ -0,0 +1,382 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsRate + # Xero unique identifier for an earning rate + attr_accessor :earnings_rate_id + + # Name of the earning rate + attr_accessor :name + + # Indicates how an employee will be paid when taking this type of earning + attr_accessor :earnings_type + OVERTIME_EARNINGS = "OvertimeEarnings".freeze + ALLOWANCE = "Allowance".freeze + REGULAR_EARNINGS = "RegularEarnings".freeze + COMMISSION = "Commission".freeze + BONUS = "Bonus".freeze + TIPS_DIRECT = "Tips(Direct)".freeze + TIPS_NON_DIRECT = "Tips(Non-Direct)".freeze + BACKPAY = "Backpay".freeze + OTHER_EARNINGS = "OtherEarnings".freeze + LUMP_SUM = "LumpSum".freeze + + # Indicates the type of the earning rate + attr_accessor :rate_type + RATE_PER_UNIT = "RatePerUnit".freeze + MULTIPLE_OF_ORDINARY_EARNINGS_RATE = "MultipleOfOrdinaryEarningsRate".freeze + FIXED_AMOUNT = "FixedAmount".freeze + + # The type of units used to record earnings + attr_accessor :type_of_units + + # Indicates whether an earning type is active + attr_accessor :current_record + + # The account that will be used for the earnings rate + attr_accessor :expense_account_id + + # Default rate per unit (optional). Only applicable if RateType is RatePerUnit + attr_accessor :rate_per_unit + + # This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + attr_accessor :multiple_of_ordinary_earnings_rate + + # Optional Fixed Rate Amount. Applicable for FixedAmount Rate + attr_accessor :fixed_amount + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'earningsRateID', + :'name' => :'name', + :'earnings_type' => :'earningsType', + :'rate_type' => :'rateType', + :'type_of_units' => :'typeOfUnits', + :'current_record' => :'currentRecord', + :'expense_account_id' => :'expenseAccountID', + :'rate_per_unit' => :'ratePerUnit', + :'multiple_of_ordinary_earnings_rate' => :'multipleOfOrdinaryEarningsRate', + :'fixed_amount' => :'fixedAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'name' => :'String', + :'earnings_type' => :'String', + :'rate_type' => :'String', + :'type_of_units' => :'String', + :'current_record' => :'Boolean', + :'expense_account_id' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'multiple_of_ordinary_earnings_rate' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsRate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'earnings_type') + self.earnings_type = attributes[:'earnings_type'] + end + + if attributes.key?(:'rate_type') + self.rate_type = attributes[:'rate_type'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'expense_account_id') + self.expense_account_id = attributes[:'expense_account_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'multiple_of_ordinary_earnings_rate') + self.multiple_of_ordinary_earnings_rate = attributes[:'multiple_of_ordinary_earnings_rate'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @earnings_type.nil? + invalid_properties.push('invalid value for "earnings_type", earnings_type cannot be nil.') + end + + if @rate_type.nil? + invalid_properties.push('invalid value for "rate_type", rate_type cannot be nil.') + end + + if @type_of_units.nil? + invalid_properties.push('invalid value for "type_of_units", type_of_units cannot be nil.') + end + + if @expense_account_id.nil? + invalid_properties.push('invalid value for "expense_account_id", expense_account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @earnings_type.nil? + earnings_type_validator = EnumAttributeValidator.new('String', ["OvertimeEarnings", "Allowance", "RegularEarnings", "Commission", "Bonus", "Tips(Direct)", "Tips(Non-Direct)", "Backpay", "OtherEarnings", "LumpSum"]) + return false unless earnings_type_validator.valid?(@earnings_type) + return false if @rate_type.nil? + rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + return false unless rate_type_validator.valid?(@rate_type) + return false if @type_of_units.nil? + return false if @expense_account_id.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] earnings_type Object to be assigned + def earnings_type=(earnings_type) + validator = EnumAttributeValidator.new('String', ["OvertimeEarnings", "Allowance", "RegularEarnings", "Commission", "Bonus", "Tips(Direct)", "Tips(Non-Direct)", "Backpay", "OtherEarnings", "LumpSum"]) + unless validator.valid?(earnings_type) + fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}." + end + @earnings_type = earnings_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] rate_type Object to be assigned + def rate_type=(rate_type) + validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + unless validator.valid?(rate_type) + fail ArgumentError, "invalid value for \"rate_type\", must be one of #{validator.allowable_values}." + end + @rate_type = rate_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + name == o.name && + earnings_type == o.earnings_type && + rate_type == o.rate_type && + type_of_units == o.type_of_units && + current_record == o.current_record && + expense_account_id == o.expense_account_id && + rate_per_unit == o.rate_per_unit && + multiple_of_ordinary_earnings_rate == o.multiple_of_ordinary_earnings_rate && + fixed_amount == o.fixed_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, name, earnings_type, rate_type, type_of_units, current_record, expense_account_id, rate_per_unit, multiple_of_ordinary_earnings_rate, fixed_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb new file mode 100644 index 00000000..7e994286 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsRateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earnings_rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earnings_rate' => :'earningsRate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earnings_rate' => :'EarningsRate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsRateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsRateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earnings_rate') + self.earnings_rate = attributes[:'earnings_rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earnings_rate == o.earnings_rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earnings_rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rates.rb b/lib/xero-ruby/models/payroll_nz/earnings_rates.rb new file mode 100644 index 00000000..14936c09 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_rates.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsRates + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earnings_rates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earnings_rates' => :'earningsRates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earnings_rates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsRates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsRates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earnings_rates') + if (value = attributes[:'earnings_rates']).is_a?(Array) + self.earnings_rates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earnings_rates == o.earnings_rates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earnings_rates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_template.rb b/lib/xero-ruby/models/payroll_nz/earnings_template.rb new file mode 100644 index 00000000..e2c2ae55 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_template.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsTemplate + # The Xero identifier for the earnings template + attr_accessor :pay_template_earning_id + + # The rate per unit + attr_accessor :rate_per_unit + + # The rate per unit + attr_accessor :number_of_units + + # The fixed amount per period + attr_accessor :fixed_amount + + # The corresponding earnings rate identifier + attr_accessor :earnings_rate_id + + # The read-only name of the Earning Template. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_template_earning_id' => :'payTemplateEarningID', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'earnings_rate_id' => :'earningsRateID', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_template_earning_id' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'earnings_rate_id' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_template_earning_id') + self.pay_template_earning_id = attributes[:'pay_template_earning_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_template_earning_id == o.pay_template_earning_id && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + earnings_rate_id == o.earnings_rate_id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_template_earning_id, rate_per_unit, number_of_units, fixed_amount, earnings_rate_id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb new file mode 100644 index 00000000..27b1716c --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EarningsTemplateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earning_template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earning_template' => :'earningTemplate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earning_template' => :'EarningsTemplate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EarningsTemplateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EarningsTemplateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earning_template') + self.earning_template = attributes[:'earning_template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earning_template == o.earning_template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earning_template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee.rb b/lib/xero-ruby/models/payroll_nz/employee.rb new file mode 100644 index 00000000..e64eb1ac --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee.rb @@ -0,0 +1,374 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Employee + # Xero unique identifier for the employee + attr_accessor :employee_id + + # Title of the employee + attr_accessor :title + + # First name of employee + attr_accessor :first_name + + # Last name of employee + attr_accessor :last_name + + # Date of birth of the employee (YYYY-MM-DD) + attr_accessor :date_of_birth + + + attr_accessor :address + + # The email address for the employee + attr_accessor :email + + # The employee’s gender + attr_accessor :gender + M = "M".freeze + F = "F".freeze + + # Employee phone number + attr_accessor :phone_number + + # Employment start date of the employee at the time it was requested + attr_accessor :start_date + + # Employment end date of the employee at the time it was requested + attr_accessor :end_date + + # Xero unique identifier for the payroll calendar of the employee + attr_accessor :payroll_calendar_id + + # UTC timestamp of last update to the employee + attr_accessor :updated_date_utc + + # UTC timestamp when the employee was created in Xero + attr_accessor :created_date_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'employeeID', + :'title' => :'title', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'date_of_birth' => :'dateOfBirth', + :'address' => :'address', + :'email' => :'email', + :'gender' => :'gender', + :'phone_number' => :'phoneNumber', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'payroll_calendar_id' => :'payrollCalendarID', + :'updated_date_utc' => :'updatedDateUTC', + :'created_date_utc' => :'createdDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'title' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'date_of_birth' => :'Date', + :'address' => :'Address', + :'email' => :'String', + :'gender' => :'String', + :'phone_number' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'payroll_calendar_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'created_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Employee` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'date_of_birth') + self.date_of_birth = attributes[:'date_of_birth'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'gender') + self.gender = attributes[:'gender'] + end + + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + gender_validator = EnumAttributeValidator.new('String', ["M", "F"]) + return false unless gender_validator.valid?(@gender) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] gender Object to be assigned + def gender=(gender) + validator = EnumAttributeValidator.new('String', ["M", "F"]) + unless validator.valid?(gender) + fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}." + end + @gender = gender + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + title == o.title && + first_name == o.first_name && + last_name == o.last_name && + date_of_birth == o.date_of_birth && + address == o.address && + email == o.email && + gender == o.gender && + phone_number == o.phone_number && + start_date == o.start_date && + end_date == o.end_date && + payroll_calendar_id == o.payroll_calendar_id && + updated_date_utc == o.updated_date_utc && + created_date_utc == o.created_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb b/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb new file mode 100644 index 00000000..51d7f63e --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeEarningsTemplates + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earning_templates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earning_templates' => :'earningTemplates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earning_templates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeEarningsTemplates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeEarningsTemplates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earning_templates') + if (value = attributes[:'earning_templates']).is_a?(Array) + self.earning_templates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earning_templates == o.earning_templates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earning_templates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave.rb b/lib/xero-ruby/models/payroll_nz/employee_leave.rb new file mode 100644 index 00000000..18f033de --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave.rb @@ -0,0 +1,290 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeave + # The Xero identifier for LeaveType + attr_accessor :leave_id + + # The Xero identifier for LeaveType + attr_accessor :leave_type_id + + # The description of the leave (max length = 50) + attr_accessor :description + + # Start date of the leave (YYYY-MM-DD) + attr_accessor :start_date + + # End date of the leave (YYYY-MM-DD) + attr_accessor :end_date + + # The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + attr_accessor :periods + + # UTC timestamp of last update to the leave type note + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_id' => :'leaveID', + :'leave_type_id' => :'leaveTypeID', + :'description' => :'description', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'periods' => :'periods', + :'updated_date_utc' => :'updatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_id' => :'String', + :'leave_type_id' => :'String', + :'description' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'periods' => :'Array', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeave` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeave`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_id') + self.leave_id = attributes[:'leave_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'periods') + if (value = attributes[:'periods']).is_a?(Array) + self.periods = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @leave_type_id.nil? + invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @leave_type_id.nil? + return false if @description.nil? + return false if @start_date.nil? + return false if @end_date.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_id == o.leave_id && + leave_type_id == o.leave_type_id && + description == o.description && + start_date == o.start_date && + end_date == o.end_date && + periods == o.periods && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_id, leave_type_id, description, start_date, end_date, periods, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb new file mode 100644 index 00000000..bf7b37c8 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveBalance + # Name of the leave type. + attr_accessor :name + + # The Xero identifier for leave type + attr_accessor :leave_type_id + + # The employees current balance for the corresponding leave type. + attr_accessor :balance + + # The type of the units of the leave. + attr_accessor :type_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'leave_type_id' => :'leaveTypeID', + :'balance' => :'balance', + :'type_of_units' => :'typeOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'leave_type_id' => :'String', + :'balance' => :'BigDecimal', + :'type_of_units' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'balance') + self.balance = attributes[:'balance'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + leave_type_id == o.leave_type_id && + balance == o.balance && + type_of_units == o.type_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, leave_type_id, balance, type_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb new file mode 100644 index 00000000..2bedd8e8 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveBalances + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_balances + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_balances' => :'leaveBalances' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_balances' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveBalances` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_balances') + if (value = attributes[:'leave_balances']).is_a?(Array) + self.leave_balances = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_balances == o.leave_balances + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_balances].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb new file mode 100644 index 00000000..c50c9915 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave' => :'leave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave' => :'EmployeeLeave' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave') + self.leave = attributes[:'leave'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave == o.leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb new file mode 100644 index 00000000..787f93ff --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb @@ -0,0 +1,268 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveSetup + # Identifier if holiday pay will be included in each payslip + attr_accessor :include_holiday_pay + + # Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. + attr_accessor :holiday_pay_opening_balance + + # Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. + attr_accessor :annual_leave_opening_balance + + # The dollar value of annual leave opening balance if negative. + attr_accessor :negative_annual_leave_balance_paid_amount + + # Number of hours accrued annually for sick leave. Multiply the number of days they're entitled to by the hours worked per day + attr_accessor :sick_leave_hours_to_accrue_annually + + # Maximum number of hours accrued annually for sick leave. Multiply the maximum days they can accrue by the hours worked per day + attr_accessor :sick_leave_maximum_hours_to_accrue + + # Initial sick leave balance. This will be positive unless they've taken sick leave in advance + attr_accessor :sick_leave_opening_balance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'include_holiday_pay' => :'includeHolidayPay', + :'holiday_pay_opening_balance' => :'holidayPayOpeningBalance', + :'annual_leave_opening_balance' => :'annualLeaveOpeningBalance', + :'negative_annual_leave_balance_paid_amount' => :'negativeAnnualLeaveBalancePaidAmount', + :'sick_leave_hours_to_accrue_annually' => :'sickLeaveHoursToAccrueAnnually', + :'sick_leave_maximum_hours_to_accrue' => :'sickLeaveMaximumHoursToAccrue', + :'sick_leave_opening_balance' => :'sickLeaveOpeningBalance' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'include_holiday_pay' => :'Boolean', + :'holiday_pay_opening_balance' => :'BigDecimal', + :'annual_leave_opening_balance' => :'BigDecimal', + :'negative_annual_leave_balance_paid_amount' => :'BigDecimal', + :'sick_leave_hours_to_accrue_annually' => :'BigDecimal', + :'sick_leave_maximum_hours_to_accrue' => :'BigDecimal', + :'sick_leave_opening_balance' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveSetup` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveSetup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'include_holiday_pay') + self.include_holiday_pay = attributes[:'include_holiday_pay'] + end + + if attributes.key?(:'holiday_pay_opening_balance') + self.holiday_pay_opening_balance = attributes[:'holiday_pay_opening_balance'] + end + + if attributes.key?(:'annual_leave_opening_balance') + self.annual_leave_opening_balance = attributes[:'annual_leave_opening_balance'] + end + + if attributes.key?(:'negative_annual_leave_balance_paid_amount') + self.negative_annual_leave_balance_paid_amount = attributes[:'negative_annual_leave_balance_paid_amount'] + end + + if attributes.key?(:'sick_leave_hours_to_accrue_annually') + self.sick_leave_hours_to_accrue_annually = attributes[:'sick_leave_hours_to_accrue_annually'] + end + + if attributes.key?(:'sick_leave_maximum_hours_to_accrue') + self.sick_leave_maximum_hours_to_accrue = attributes[:'sick_leave_maximum_hours_to_accrue'] + end + + if attributes.key?(:'sick_leave_opening_balance') + self.sick_leave_opening_balance = attributes[:'sick_leave_opening_balance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_holiday_pay == o.include_holiday_pay && + holiday_pay_opening_balance == o.holiday_pay_opening_balance && + annual_leave_opening_balance == o.annual_leave_opening_balance && + negative_annual_leave_balance_paid_amount == o.negative_annual_leave_balance_paid_amount && + sick_leave_hours_to_accrue_annually == o.sick_leave_hours_to_accrue_annually && + sick_leave_maximum_hours_to_accrue == o.sick_leave_maximum_hours_to_accrue && + sick_leave_opening_balance == o.sick_leave_opening_balance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [include_holiday_pay, holiday_pay_opening_balance, annual_leave_opening_balance, negative_annual_leave_balance_paid_amount, sick_leave_hours_to_accrue_annually, sick_leave_maximum_hours_to_accrue, sick_leave_opening_balance].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb new file mode 100644 index 00000000..f105f477 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveSetupObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_setup + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_setup' => :'leaveSetup' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_setup' => :'EmployeeLeaveSetup' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveSetupObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveSetupObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_setup') + self.leave_setup = attributes[:'leave_setup'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_setup == o.leave_setup + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_setup].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb new file mode 100644 index 00000000..6fc6edc8 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb @@ -0,0 +1,336 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveType + # The Xero identifier for leave type + attr_accessor :leave_type_id + + # The schedule of accrual + attr_accessor :schedule_of_accrual + ANNUALLY_AFTER6_MONTHS = "AnnuallyAfter6Months".freeze + ON_ANNIVERSARY_DATE = "OnAnniversaryDate".freeze + PERCENTAGE_OF_GROSS_EARNINGS = "PercentageOfGrossEarnings".freeze + NO_ACCRUALS = "NoAccruals".freeze + + # The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" + attr_accessor :hours_accrued_annually + + # The maximum number of hours that can be accrued for the leave + attr_accessor :maximum_to_accrue + + # The initial number of hours assigned when the leave was added to the employee + attr_accessor :opening_balance + + # The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + attr_accessor :rate_accrued_hourly + + # Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. + attr_accessor :percentage_of_gross_earnings + + # Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. + attr_accessor :include_holiday_pay_every_pay + + # Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip + attr_accessor :show_annual_leave_in_advance + + # Specific to Annual Leave. Annual leave balance in dollars + attr_accessor :annual_leave_total_amount_paid + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'leaveTypeID', + :'schedule_of_accrual' => :'scheduleOfAccrual', + :'hours_accrued_annually' => :'hoursAccruedAnnually', + :'maximum_to_accrue' => :'maximumToAccrue', + :'opening_balance' => :'openingBalance', + :'rate_accrued_hourly' => :'rateAccruedHourly', + :'percentage_of_gross_earnings' => :'percentageOfGrossEarnings', + :'include_holiday_pay_every_pay' => :'includeHolidayPayEveryPay', + :'show_annual_leave_in_advance' => :'showAnnualLeaveInAdvance', + :'annual_leave_total_amount_paid' => :'annualLeaveTotalAmountPaid' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'schedule_of_accrual' => :'String', + :'hours_accrued_annually' => :'BigDecimal', + :'maximum_to_accrue' => :'BigDecimal', + :'opening_balance' => :'BigDecimal', + :'rate_accrued_hourly' => :'BigDecimal', + :'percentage_of_gross_earnings' => :'BigDecimal', + :'include_holiday_pay_every_pay' => :'Boolean', + :'show_annual_leave_in_advance' => :'Boolean', + :'annual_leave_total_amount_paid' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'schedule_of_accrual') + self.schedule_of_accrual = attributes[:'schedule_of_accrual'] + end + + if attributes.key?(:'hours_accrued_annually') + self.hours_accrued_annually = attributes[:'hours_accrued_annually'] + end + + if attributes.key?(:'maximum_to_accrue') + self.maximum_to_accrue = attributes[:'maximum_to_accrue'] + end + + if attributes.key?(:'opening_balance') + self.opening_balance = attributes[:'opening_balance'] + end + + if attributes.key?(:'rate_accrued_hourly') + self.rate_accrued_hourly = attributes[:'rate_accrued_hourly'] + end + + if attributes.key?(:'percentage_of_gross_earnings') + self.percentage_of_gross_earnings = attributes[:'percentage_of_gross_earnings'] + end + + if attributes.key?(:'include_holiday_pay_every_pay') + self.include_holiday_pay_every_pay = attributes[:'include_holiday_pay_every_pay'] + end + + if attributes.key?(:'show_annual_leave_in_advance') + self.show_annual_leave_in_advance = attributes[:'show_annual_leave_in_advance'] + end + + if attributes.key?(:'annual_leave_total_amount_paid') + self.annual_leave_total_amount_paid = attributes[:'annual_leave_total_amount_paid'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + schedule_of_accrual_validator = EnumAttributeValidator.new('String', ["AnnuallyAfter6Months", "OnAnniversaryDate", "PercentageOfGrossEarnings", "NoAccruals"]) + return false unless schedule_of_accrual_validator.valid?(@schedule_of_accrual) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] schedule_of_accrual Object to be assigned + def schedule_of_accrual=(schedule_of_accrual) + validator = EnumAttributeValidator.new('String', ["AnnuallyAfter6Months", "OnAnniversaryDate", "PercentageOfGrossEarnings", "NoAccruals"]) + unless validator.valid?(schedule_of_accrual) + fail ArgumentError, "invalid value for \"schedule_of_accrual\", must be one of #{validator.allowable_values}." + end + @schedule_of_accrual = schedule_of_accrual + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + schedule_of_accrual == o.schedule_of_accrual && + hours_accrued_annually == o.hours_accrued_annually && + maximum_to_accrue == o.maximum_to_accrue && + opening_balance == o.opening_balance && + rate_accrued_hourly == o.rate_accrued_hourly && + percentage_of_gross_earnings == o.percentage_of_gross_earnings && + include_holiday_pay_every_pay == o.include_holiday_pay_every_pay && + show_annual_leave_in_advance == o.show_annual_leave_in_advance && + annual_leave_total_amount_paid == o.annual_leave_total_amount_paid + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, schedule_of_accrual, hours_accrued_annually, maximum_to_accrue, opening_balance, rate_accrued_hourly, percentage_of_gross_earnings, include_holiday_pay_every_pay, show_annual_leave_in_advance, annual_leave_total_amount_paid].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb new file mode 100644 index 00000000..5f955fcf --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveTypeObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_type' => :'leaveType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_type' => :'EmployeeLeaveType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveTypeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveTypeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_type == o.leave_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb new file mode 100644 index 00000000..7307985d --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaveTypes + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_types + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_types' => :'leaveTypes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_types' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaveTypes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaveTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_types') + if (value = attributes[:'leave_types']).is_a?(Array) + self.leave_types = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_types == o.leave_types + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_types].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_leaves.rb b/lib/xero-ruby/models/payroll_nz/employee_leaves.rb new file mode 100644 index 00000000..9b2c60c9 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_leaves.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeLeaves + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave' => :'leave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeLeaves` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeLeaves`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave') + if (value = attributes[:'leave']).is_a?(Array) + self.leave = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave == o.leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_object.rb b/lib/xero-ruby/models/payroll_nz/employee_object.rb new file mode 100644 index 00000000..4e7cd709 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeObject + + attr_accessor :pagination + + + attr_accessor :employee + + + attr_accessor :problem + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'employee' => :'employee', + :'problem' => :'problem' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'employee' => :'Employee', + :'problem' => :'Problem' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'employee') + self.employee = attributes[:'employee'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + employee == o.employee && + problem == o.problem + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, employee, problem].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb new file mode 100644 index 00000000..eccd95ee --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeOpeningBalance + # The opening balance period end date. + attr_accessor :period_end_date + + # The paid number of days. + attr_accessor :days_paid + + # The number of unpaid weeks. + attr_accessor :unpaid_weeks + + # The gross earnings during the period. + attr_accessor :gross_earnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_end_date' => :'periodEndDate', + :'days_paid' => :'daysPaid', + :'unpaid_weeks' => :'unpaidWeeks', + :'gross_earnings' => :'grossEarnings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_end_date' => :'Date', + :'days_paid' => :'Integer', + :'unpaid_weeks' => :'Integer', + :'gross_earnings' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeOpeningBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeOpeningBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'days_paid') + self.days_paid = attributes[:'days_paid'] + end + + if attributes.key?(:'unpaid_weeks') + self.unpaid_weeks = attributes[:'unpaid_weeks'] + end + + if attributes.key?(:'gross_earnings') + self.gross_earnings = attributes[:'gross_earnings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_end_date == o.period_end_date && + days_paid == o.days_paid && + unpaid_weeks == o.unpaid_weeks && + gross_earnings == o.gross_earnings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_end_date, days_paid, unpaid_weeks, gross_earnings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb b/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb new file mode 100644 index 00000000..28b828f4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeOpeningBalancesObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :opening_balances + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'opening_balances' => :'openingBalances' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'opening_balances' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeOpeningBalancesObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeOpeningBalancesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'opening_balances') + if (value = attributes[:'opening_balances']).is_a?(Array) + self.opening_balances = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + opening_balances == o.opening_balances + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, opening_balances].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb new file mode 100644 index 00000000..8e110ff3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb @@ -0,0 +1,220 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeePayTemplate + # Unique identifier for the employee + attr_accessor :employee_id + + + attr_accessor :earning_templates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'employeeID', + :'earning_templates' => :'earningTemplates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'earning_templates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeePayTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeePayTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'earning_templates') + if (value = attributes[:'earning_templates']).is_a?(Array) + self.earning_templates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + earning_templates == o.earning_templates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, earning_templates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb new file mode 100644 index 00000000..fe2947d4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeePayTemplateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_template' => :'payTemplate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_template' => :'EmployeePayTemplate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeePayTemplateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeePayTemplateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_template') + self.pay_template = attributes[:'pay_template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_template == o.pay_template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb new file mode 100644 index 00000000..00ef2144 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeePayTemplates + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_template' => :'payTemplate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_template' => :'EmployeePayTemplate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeePayTemplates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeePayTemplates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_template') + self.pay_template = attributes[:'pay_template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_template == o.pay_template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb new file mode 100644 index 00000000..7bd3cb51 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb @@ -0,0 +1,280 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutoryLeaveBalance + # The type of statutory leave + attr_accessor :leave_type + SICK = "Sick".freeze + ADOPTION = "Adoption".freeze + MATERNITY = "Maternity".freeze + PATERNITY = "Paternity".freeze + SHAREDPARENTAL = "Sharedparental".freeze + + # The balance remaining for the corresponding leave type as of specified date. + attr_accessor :balance_remaining + + # The units will be \"Hours\" + attr_accessor :units + HOURS = "Hours".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type' => :'leaveType', + :'balance_remaining' => :'balanceRemaining', + :'units' => :'units' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type' => :'String', + :'balance_remaining' => :'BigDecimal', + :'units' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + + if attributes.key?(:'balance_remaining') + self.balance_remaining = attributes[:'balance_remaining'] + end + + if attributes.key?(:'units') + self.units = attributes[:'units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + return false unless leave_type_validator.valid?(@leave_type) + units_validator = EnumAttributeValidator.new('String', ["Hours"]) + return false unless units_validator.valid?(@units) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] leave_type Object to be assigned + def leave_type=(leave_type) + validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + unless validator.valid?(leave_type) + fail ArgumentError, "invalid value for \"leave_type\", must be one of #{validator.allowable_values}." + end + @leave_type = leave_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] units Object to be assigned + def units=(units) + validator = EnumAttributeValidator.new('String', ["Hours"]) + unless validator.valid?(units) + fail ArgumentError, "invalid value for \"units\", must be one of #{validator.allowable_values}." + end + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type == o.leave_type && + balance_remaining == o.balance_remaining && + units == o.units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type, balance_remaining, units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb new file mode 100644 index 00000000..c8b53e21 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutoryLeaveBalanceObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_balance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_balance' => :'leaveBalance' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_balance' => :'EmployeeStatutoryLeaveBalance' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_balance') + self.leave_balance = attributes[:'leave_balance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_balance == o.leave_balance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_balance].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb new file mode 100644 index 00000000..0a66b05f --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb @@ -0,0 +1,322 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutoryLeaveSummary + # The unique identifier (guid) of a statutory leave. + attr_accessor :statutory_leave_id + + # The unique identifier (guid) of the employee + attr_accessor :employee_id + + # The category of statutory leave + attr_accessor :type + SICK = "Sick".freeze + ADOPTION = "Adoption".freeze + MATERNITY = "Maternity".freeze + PATERNITY = "Paternity".freeze + SHAREDPARENTAL = "Sharedparental".freeze + + # The date when the leave starts + attr_accessor :start_date + + # The date when the leave ends + attr_accessor :end_date + + # Whether the leave was entitled to receive payment + attr_accessor :is_entitled + + # The status of the leave + attr_accessor :status + PENDING = "Pending".freeze + IN_PROGRESS = "In-Progress".freeze + COMPLETED = "Completed".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_leave_id' => :'statutoryLeaveID', + :'employee_id' => :'employeeID', + :'type' => :'type', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'is_entitled' => :'isEntitled', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_leave_id' => :'String', + :'employee_id' => :'String', + :'type' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'is_entitled' => :'Boolean', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_leave_id') + self.statutory_leave_id = attributes[:'statutory_leave_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'is_entitled') + self.is_entitled = attributes[:'is_entitled'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_leave_id == o.statutory_leave_id && + employee_id == o.employee_id && + type == o.type && + start_date == o.start_date && + end_date == o.end_date && + is_entitled == o.is_entitled && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_leave_id, employee_id, type, start_date, end_date, is_entitled, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb new file mode 100644 index 00000000..9bd74f65 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutoryLeavesSummaries + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_leaves + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_leaves' => :'statutoryLeaves' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_leaves' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_leaves') + if (value = attributes[:'statutory_leaves']).is_a?(Array) + self.statutory_leaves = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_leaves == o.statutory_leaves + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_leaves].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb new file mode 100644 index 00000000..1b7951d5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb @@ -0,0 +1,419 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutorySickLeave + # The unique identifier (guid) of a statutory leave + attr_accessor :statutory_leave_id + + # The unique identifier (guid) of the employee + attr_accessor :employee_id + + # The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + attr_accessor :leave_type_id + + # The date when the leave starts + attr_accessor :start_date + + # The date when the leave ends + attr_accessor :end_date + + # the type of statutory leave + attr_accessor :type + + # the type of statutory leave + attr_accessor :status + + # The days of the work week the employee is scheduled to work at the time the leave is taken + attr_accessor :work_pattern + + # Whether the sick leave was pregnancy related + attr_accessor :is_pregnancy_related + + # Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request + attr_accessor :sufficient_notice + + # Whether the leave was entitled to receive payment + attr_accessor :is_entitled + + # The amount of requested time (in weeks) + attr_accessor :entitlement_weeks_requested + + # The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + attr_accessor :entitlement_weeks_qualified + + # A calculated amount of time (in weeks) that remains for the statutory sick leave period + attr_accessor :entitlement_weeks_remaining + + # Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + attr_accessor :overlaps_with_other_leave + + # If the leave requested was considered \"not entitled\", the reasons why are listed here. + attr_accessor :entitlement_failure_reasons + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_leave_id' => :'statutoryLeaveID', + :'employee_id' => :'employeeID', + :'leave_type_id' => :'leaveTypeID', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'type' => :'type', + :'status' => :'status', + :'work_pattern' => :'workPattern', + :'is_pregnancy_related' => :'isPregnancyRelated', + :'sufficient_notice' => :'sufficientNotice', + :'is_entitled' => :'isEntitled', + :'entitlement_weeks_requested' => :'entitlementWeeksRequested', + :'entitlement_weeks_qualified' => :'entitlementWeeksQualified', + :'entitlement_weeks_remaining' => :'entitlementWeeksRemaining', + :'overlaps_with_other_leave' => :'overlapsWithOtherLeave', + :'entitlement_failure_reasons' => :'entitlementFailureReasons' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_leave_id' => :'String', + :'employee_id' => :'String', + :'leave_type_id' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'type' => :'String', + :'status' => :'String', + :'work_pattern' => :'Array', + :'is_pregnancy_related' => :'Boolean', + :'sufficient_notice' => :'Boolean', + :'is_entitled' => :'Boolean', + :'entitlement_weeks_requested' => :'BigDecimal', + :'entitlement_weeks_qualified' => :'BigDecimal', + :'entitlement_weeks_remaining' => :'BigDecimal', + :'overlaps_with_other_leave' => :'Boolean', + :'entitlement_failure_reasons' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutorySickLeave` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutorySickLeave`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_leave_id') + self.statutory_leave_id = attributes[:'statutory_leave_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'work_pattern') + if (value = attributes[:'work_pattern']).is_a?(Array) + self.work_pattern = value + end + end + + if attributes.key?(:'is_pregnancy_related') + self.is_pregnancy_related = attributes[:'is_pregnancy_related'] + end + + if attributes.key?(:'sufficient_notice') + self.sufficient_notice = attributes[:'sufficient_notice'] + end + + if attributes.key?(:'is_entitled') + self.is_entitled = attributes[:'is_entitled'] + end + + if attributes.key?(:'entitlement_weeks_requested') + self.entitlement_weeks_requested = attributes[:'entitlement_weeks_requested'] + end + + if attributes.key?(:'entitlement_weeks_qualified') + self.entitlement_weeks_qualified = attributes[:'entitlement_weeks_qualified'] + end + + if attributes.key?(:'entitlement_weeks_remaining') + self.entitlement_weeks_remaining = attributes[:'entitlement_weeks_remaining'] + end + + if attributes.key?(:'overlaps_with_other_leave') + self.overlaps_with_other_leave = attributes[:'overlaps_with_other_leave'] + end + + if attributes.key?(:'entitlement_failure_reasons') + if (value = attributes[:'entitlement_failure_reasons']).is_a?(Array) + self.entitlement_failure_reasons = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @employee_id.nil? + invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.') + end + + if @leave_type_id.nil? + invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + if @work_pattern.nil? + invalid_properties.push('invalid value for "work_pattern", work_pattern cannot be nil.') + end + + if @is_pregnancy_related.nil? + invalid_properties.push('invalid value for "is_pregnancy_related", is_pregnancy_related cannot be nil.') + end + + if @sufficient_notice.nil? + invalid_properties.push('invalid value for "sufficient_notice", sufficient_notice cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @employee_id.nil? + return false if @leave_type_id.nil? + return false if @start_date.nil? + return false if @end_date.nil? + return false if @work_pattern.nil? + return false if @is_pregnancy_related.nil? + return false if @sufficient_notice.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_leave_id == o.statutory_leave_id && + employee_id == o.employee_id && + leave_type_id == o.leave_type_id && + start_date == o.start_date && + end_date == o.end_date && + type == o.type && + status == o.status && + work_pattern == o.work_pattern && + is_pregnancy_related == o.is_pregnancy_related && + sufficient_notice == o.sufficient_notice && + is_entitled == o.is_entitled && + entitlement_weeks_requested == o.entitlement_weeks_requested && + entitlement_weeks_qualified == o.entitlement_weeks_qualified && + entitlement_weeks_remaining == o.entitlement_weeks_remaining && + overlaps_with_other_leave == o.overlaps_with_other_leave && + entitlement_failure_reasons == o.entitlement_failure_reasons + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_leave_id, employee_id, leave_type_id, start_date, end_date, type, status, work_pattern, is_pregnancy_related, sufficient_notice, is_entitled, entitlement_weeks_requested, entitlement_weeks_qualified, entitlement_weeks_remaining, overlaps_with_other_leave, entitlement_failure_reasons].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb new file mode 100644 index 00000000..c19e4396 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutorySickLeaveObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_sick_leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_sick_leave' => :'statutorySickLeave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_sick_leave' => :'EmployeeStatutorySickLeave' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_sick_leave') + self.statutory_sick_leave = attributes[:'statutory_sick_leave'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_sick_leave == o.statutory_sick_leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_sick_leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb new file mode 100644 index 00000000..873b2cf4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeStatutorySickLeaves + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_sick_leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_sick_leave' => :'statutorySickLeave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_sick_leave' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeStatutorySickLeaves` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeStatutorySickLeaves`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_sick_leave') + if (value = attributes[:'statutory_sick_leave']).is_a?(Array) + self.statutory_sick_leave = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_sick_leave == o.statutory_sick_leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_sick_leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_tax.rb b/lib/xero-ruby/models/payroll_nz/employee_tax.rb new file mode 100644 index 00000000..d2c17e7b --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_tax.rb @@ -0,0 +1,397 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeTax + # The IRD Number. + attr_accessor :ird_number + + + attr_accessor :tax_code + + # Special tax rate percentage. + attr_accessor :special_tax_rate_percentage + + # Does the employee has a special student loan rate? + attr_accessor :has_special_student_loan_rate + + # The employee student loan rate percentage. + attr_accessor :special_student_loan_rate_percentage + + # The employee eligibility for KiwiSaver. + attr_accessor :is_eligible_for_kiwi_saver + + # Employer superannuation contribution tax rate. + attr_accessor :esct_rate_percentage + + # Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership + attr_accessor :kiwi_saver_contributions + MAKE_CONTRIBUTIONS = "MakeContributions".freeze + OPT_OUT = "OptOut".freeze + ON_A_CONTRIBUTIONS_HOLIDAY = "OnAContributionsHoliday".freeze + ON_A_SAVINGS_SUSPENSION = "OnASavingsSuspension".freeze + NOT_CURRENTLY_A_KIWI_SAVER_MEMBER = "NotCurrentlyAKiwiSaverMember".freeze + + # Employee Contribution percentage. + attr_accessor :kiwi_saver_employee_contribution_rate_percentage + + # Employer Contribution percentage. + attr_accessor :kiwi_saver_employer_contribution_rate_percentage + + # Employer Contribution through Salary Sacrifice percentage. + attr_accessor :kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage + + # Opt Out Date. + attr_accessor :kiwi_saver_opt_out_date + + # Contribution holiday expiry date or end date. + attr_accessor :kiwi_saver_contribution_holiday_end_date + + # Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. + attr_accessor :has_student_loan_balance + + # The employee's student loan balance shown on the letter from IR. + attr_accessor :student_loan_balance + + # The date of the letter from IR. + attr_accessor :student_loan_as_at + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ird_number' => :'irdNumber', + :'tax_code' => :'taxCode', + :'special_tax_rate_percentage' => :'specialTaxRatePercentage', + :'has_special_student_loan_rate' => :'hasSpecialStudentLoanRate', + :'special_student_loan_rate_percentage' => :'specialStudentLoanRatePercentage', + :'is_eligible_for_kiwi_saver' => :'isEligibleForKiwiSaver', + :'esct_rate_percentage' => :'esctRatePercentage', + :'kiwi_saver_contributions' => :'kiwiSaverContributions', + :'kiwi_saver_employee_contribution_rate_percentage' => :'kiwiSaverEmployeeContributionRatePercentage', + :'kiwi_saver_employer_contribution_rate_percentage' => :'kiwiSaverEmployerContributionRatePercentage', + :'kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage' => :'kiwiSaverEmployerSalarySacrificeContributionRatePercentage', + :'kiwi_saver_opt_out_date' => :'kiwiSaverOptOutDate', + :'kiwi_saver_contribution_holiday_end_date' => :'kiwiSaverContributionHolidayEndDate', + :'has_student_loan_balance' => :'hasStudentLoanBalance', + :'student_loan_balance' => :'studentLoanBalance', + :'student_loan_as_at' => :'studentLoanAsAt' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'ird_number' => :'String', + :'tax_code' => :'TaxCode', + :'special_tax_rate_percentage' => :'BigDecimal', + :'has_special_student_loan_rate' => :'Boolean', + :'special_student_loan_rate_percentage' => :'BigDecimal', + :'is_eligible_for_kiwi_saver' => :'Boolean', + :'esct_rate_percentage' => :'BigDecimal', + :'kiwi_saver_contributions' => :'String', + :'kiwi_saver_employee_contribution_rate_percentage' => :'BigDecimal', + :'kiwi_saver_employer_contribution_rate_percentage' => :'BigDecimal', + :'kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage' => :'BigDecimal', + :'kiwi_saver_opt_out_date' => :'Date', + :'kiwi_saver_contribution_holiday_end_date' => :'Date', + :'has_student_loan_balance' => :'Boolean', + :'student_loan_balance' => :'BigDecimal', + :'student_loan_as_at' => :'Date' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeTax` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeTax`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ird_number') + self.ird_number = attributes[:'ird_number'] + end + + if attributes.key?(:'tax_code') + self.tax_code = attributes[:'tax_code'] + end + + if attributes.key?(:'special_tax_rate_percentage') + self.special_tax_rate_percentage = attributes[:'special_tax_rate_percentage'] + end + + if attributes.key?(:'has_special_student_loan_rate') + self.has_special_student_loan_rate = attributes[:'has_special_student_loan_rate'] + end + + if attributes.key?(:'special_student_loan_rate_percentage') + self.special_student_loan_rate_percentage = attributes[:'special_student_loan_rate_percentage'] + end + + if attributes.key?(:'is_eligible_for_kiwi_saver') + self.is_eligible_for_kiwi_saver = attributes[:'is_eligible_for_kiwi_saver'] + end + + if attributes.key?(:'esct_rate_percentage') + self.esct_rate_percentage = attributes[:'esct_rate_percentage'] + end + + if attributes.key?(:'kiwi_saver_contributions') + self.kiwi_saver_contributions = attributes[:'kiwi_saver_contributions'] + end + + if attributes.key?(:'kiwi_saver_employee_contribution_rate_percentage') + self.kiwi_saver_employee_contribution_rate_percentage = attributes[:'kiwi_saver_employee_contribution_rate_percentage'] + end + + if attributes.key?(:'kiwi_saver_employer_contribution_rate_percentage') + self.kiwi_saver_employer_contribution_rate_percentage = attributes[:'kiwi_saver_employer_contribution_rate_percentage'] + end + + if attributes.key?(:'kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage') + self.kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage = attributes[:'kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage'] + end + + if attributes.key?(:'kiwi_saver_opt_out_date') + self.kiwi_saver_opt_out_date = attributes[:'kiwi_saver_opt_out_date'] + end + + if attributes.key?(:'kiwi_saver_contribution_holiday_end_date') + self.kiwi_saver_contribution_holiday_end_date = attributes[:'kiwi_saver_contribution_holiday_end_date'] + end + + if attributes.key?(:'has_student_loan_balance') + self.has_student_loan_balance = attributes[:'has_student_loan_balance'] + end + + if attributes.key?(:'student_loan_balance') + self.student_loan_balance = attributes[:'student_loan_balance'] + end + + if attributes.key?(:'student_loan_as_at') + self.student_loan_as_at = attributes[:'student_loan_as_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kiwi_saver_contributions_validator = EnumAttributeValidator.new('String', ["MakeContributions", "OptOut", "OnAContributionsHoliday", "OnASavingsSuspension", "NotCurrentlyAKiwiSaverMember"]) + return false unless kiwi_saver_contributions_validator.valid?(@kiwi_saver_contributions) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kiwi_saver_contributions Object to be assigned + def kiwi_saver_contributions=(kiwi_saver_contributions) + validator = EnumAttributeValidator.new('String', ["MakeContributions", "OptOut", "OnAContributionsHoliday", "OnASavingsSuspension", "NotCurrentlyAKiwiSaverMember"]) + unless validator.valid?(kiwi_saver_contributions) + fail ArgumentError, "invalid value for \"kiwi_saver_contributions\", must be one of #{validator.allowable_values}." + end + @kiwi_saver_contributions = kiwi_saver_contributions + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ird_number == o.ird_number && + tax_code == o.tax_code && + special_tax_rate_percentage == o.special_tax_rate_percentage && + has_special_student_loan_rate == o.has_special_student_loan_rate && + special_student_loan_rate_percentage == o.special_student_loan_rate_percentage && + is_eligible_for_kiwi_saver == o.is_eligible_for_kiwi_saver && + esct_rate_percentage == o.esct_rate_percentage && + kiwi_saver_contributions == o.kiwi_saver_contributions && + kiwi_saver_employee_contribution_rate_percentage == o.kiwi_saver_employee_contribution_rate_percentage && + kiwi_saver_employer_contribution_rate_percentage == o.kiwi_saver_employer_contribution_rate_percentage && + kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage == o.kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage && + kiwi_saver_opt_out_date == o.kiwi_saver_opt_out_date && + kiwi_saver_contribution_holiday_end_date == o.kiwi_saver_contribution_holiday_end_date && + has_student_loan_balance == o.has_student_loan_balance && + student_loan_balance == o.student_loan_balance && + student_loan_as_at == o.student_loan_as_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ird_number, tax_code, special_tax_rate_percentage, has_special_student_loan_rate, special_student_loan_rate_percentage, is_eligible_for_kiwi_saver, esct_rate_percentage, kiwi_saver_contributions, kiwi_saver_employee_contribution_rate_percentage, kiwi_saver_employer_contribution_rate_percentage, kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage, kiwi_saver_opt_out_date, kiwi_saver_contribution_holiday_end_date, has_student_loan_balance, student_loan_balance, student_loan_as_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb b/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb new file mode 100644 index 00000000..df397b3b --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmployeeTaxObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employee_tax + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employee_tax' => :'employeeTax' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employee_tax' => :'EmployeeTax' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeTaxObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeTaxObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employee_tax') + self.employee_tax = attributes[:'employee_tax'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employee_tax == o.employee_tax + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employee_tax].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employees.rb b/lib/xero-ruby/models/payroll_nz/employees.rb new file mode 100644 index 00000000..124f7518 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employees.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Employees + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employees + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employees' => :'employees' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employees' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Employees` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Employees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employees') + if (value = attributes[:'employees']).is_a?(Array) + self.employees = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employees == o.employees + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employees].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employment.rb b/lib/xero-ruby/models/payroll_nz/employment.rb new file mode 100644 index 00000000..b9e40e9d --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employment.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Employment + # Xero unique identifier for the payroll calendar of the employee + attr_accessor :payroll_calendar_id + + # Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) + attr_accessor :pay_run_calendar_id + + # Start date of the employment (YYYY-MM-DD) + attr_accessor :start_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendar_id' => :'payrollCalendarID', + :'pay_run_calendar_id' => :'payRunCalendarID', + :'start_date' => :'startDate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendar_id' => :'String', + :'pay_run_calendar_id' => :'String', + :'start_date' => :'Date' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Employment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Employment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'pay_run_calendar_id') + self.pay_run_calendar_id = attributes[:'pay_run_calendar_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendar_id == o.payroll_calendar_id && + pay_run_calendar_id == o.pay_run_calendar_id && + start_date == o.start_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendar_id, pay_run_calendar_id, start_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employment_object.rb b/lib/xero-ruby/models/payroll_nz/employment_object.rb new file mode 100644 index 00000000..f9a10d69 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employment_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class EmploymentObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employment' => :'employment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employment' => :'Employment' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmploymentObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmploymentObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employment') + self.employment = attributes[:'employment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employment == o.employment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb b/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb new file mode 100644 index 00000000..1a91e559 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class GrossEarningsHistory + # Number of days the employee worked in the pay period (0 - 365) + attr_accessor :days_paid + + # Number of full weeks the employee didn't work in the pay period (0 - 52) + attr_accessor :unpaid_weeks + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'days_paid' => :'daysPaid', + :'unpaid_weeks' => :'unpaidWeeks' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'days_paid' => :'Integer', + :'unpaid_weeks' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::GrossEarningsHistory` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::GrossEarningsHistory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'days_paid') + self.days_paid = attributes[:'days_paid'] + end + + if attributes.key?(:'unpaid_weeks') + self.unpaid_weeks = attributes[:'unpaid_weeks'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + days_paid == o.days_paid && + unpaid_weeks == o.unpaid_weeks + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [days_paid, unpaid_weeks].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/invalid_field.rb b/lib/xero-ruby/models/payroll_nz/invalid_field.rb new file mode 100644 index 00000000..46658a3d --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/invalid_field.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class InvalidField + # The name of the field that caused the error + attr_accessor :name + + # The reason the error occurred + attr_accessor :reason + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'reason' => :'reason' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'reason' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::InvalidField` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::InvalidField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + reason == o.reason + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, reason].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb new file mode 100644 index 00000000..f1181c7f --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeaveAccrualLine + # Xero identifier for the Leave type + attr_accessor :leave_type_id + + # Leave accrual number of units + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'leaveTypeID', + :'number_of_units' => :'numberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'number_of_units' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeaveAccrualLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeaveAccrualLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb new file mode 100644 index 00000000..0f6aba4f --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb @@ -0,0 +1,298 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeaveEarningsLine + # Xero identifier for payroll earnings line + attr_accessor :earnings_line_id + + # Xero identifier for payroll leave earnings rate + attr_accessor :earnings_rate_id + + # name of earnings rate for display in UI + attr_accessor :display_name + + # Rate per unit for leave earnings line + attr_accessor :rate_per_unit + + # Leave earnings number of units + attr_accessor :number_of_units + + # Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the earnings line. + attr_accessor :amount + + # Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + attr_accessor :is_linked_to_timesheet + + # Identifies if the earnings is using an average daily pay rate + attr_accessor :is_average_daily_pay_rate + + # Flag to indentify whether the earnings line is system generated or not. + attr_accessor :is_system_generated + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_line_id' => :'earningsLineID', + :'earnings_rate_id' => :'earningsRateID', + :'display_name' => :'displayName', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet', + :'is_average_daily_pay_rate' => :'isAverageDailyPayRate', + :'is_system_generated' => :'isSystemGenerated' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_line_id' => :'String', + :'earnings_rate_id' => :'String', + :'display_name' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'amount' => :'BigDecimal', + :'is_linked_to_timesheet' => :'Boolean', + :'is_average_daily_pay_rate' => :'Boolean', + :'is_system_generated' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeaveEarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeaveEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_line_id') + self.earnings_line_id = attributes[:'earnings_line_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + + if attributes.key?(:'is_average_daily_pay_rate') + self.is_average_daily_pay_rate = attributes[:'is_average_daily_pay_rate'] + end + + if attributes.key?(:'is_system_generated') + self.is_system_generated = attributes[:'is_system_generated'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_line_id == o.earnings_line_id && + earnings_rate_id == o.earnings_rate_id && + display_name == o.display_name && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet && + is_average_daily_pay_rate == o.is_average_daily_pay_rate && + is_system_generated == o.is_system_generated + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_line_id, earnings_rate_id, display_name, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet, is_average_daily_pay_rate, is_system_generated].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_period.rb b/lib/xero-ruby/models/payroll_nz/leave_period.rb new file mode 100644 index 00000000..a2ab8412 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_period.rb @@ -0,0 +1,274 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeavePeriod + # The Pay Period Start Date (YYYY-MM-DD) + attr_accessor :period_start_date + + # The Pay Period End Date (YYYY-MM-DD) + attr_accessor :period_end_date + + # The Number of Units for the leave + attr_accessor :number_of_units + + # Period Status + attr_accessor :period_status + APPROVED = "Approved".freeze + COMPLETED = "Completed".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'number_of_units' => :'numberOfUnits', + :'period_status' => :'periodStatus' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'number_of_units' => :'BigDecimal', + :'period_status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeavePeriod` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeavePeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'period_status') + self.period_status = attributes[:'period_status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + period_status_validator = EnumAttributeValidator.new('String', ["Approved", "Completed"]) + return false unless period_status_validator.valid?(@period_status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] period_status Object to be assigned + def period_status=(period_status) + validator = EnumAttributeValidator.new('String', ["Approved", "Completed"]) + unless validator.valid?(period_status) + fail ArgumentError, "invalid value for \"period_status\", must be one of #{validator.allowable_values}." + end + @period_status = period_status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + number_of_units == o.number_of_units && + period_status == o.period_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_start_date, period_end_date, number_of_units, period_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_periods.rb b/lib/xero-ruby/models/payroll_nz/leave_periods.rb new file mode 100644 index 00000000..3c5216e5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_periods.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeavePeriods + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :periods + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'periods' => :'periods' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'periods' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeavePeriods` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeavePeriods`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'periods') + if (value = attributes[:'periods']).is_a?(Array) + self.periods = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + periods == o.periods + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, periods].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_type.rb b/lib/xero-ruby/models/payroll_nz/leave_type.rb new file mode 100644 index 00000000..88761475 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_type.rb @@ -0,0 +1,273 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeaveType + # Xero unique identifier for the leave type + attr_accessor :leave_type_id + + # Name of the leave type + attr_accessor :name + + # Indicate that an employee will be paid when taking this type of leave + attr_accessor :is_paid_leave + + # Indicate that a balance for this leave type to be shown on the employee’s payslips + attr_accessor :show_on_payslip + + # UTC timestamp of last update to the leave type note + attr_accessor :updated_date_utc + + # Shows whether the leave type is active or not + attr_accessor :is_active + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'leaveTypeID', + :'name' => :'name', + :'is_paid_leave' => :'isPaidLeave', + :'show_on_payslip' => :'showOnPayslip', + :'updated_date_utc' => :'updatedDateUTC', + :'is_active' => :'isActive' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'name' => :'String', + :'is_paid_leave' => :'Boolean', + :'show_on_payslip' => :'Boolean', + :'updated_date_utc' => :'DateTime', + :'is_active' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeaveType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeaveType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'is_paid_leave') + self.is_paid_leave = attributes[:'is_paid_leave'] + end + + if attributes.key?(:'show_on_payslip') + self.show_on_payslip = attributes[:'show_on_payslip'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @is_paid_leave.nil? + invalid_properties.push('invalid value for "is_paid_leave", is_paid_leave cannot be nil.') + end + + if @show_on_payslip.nil? + invalid_properties.push('invalid value for "show_on_payslip", show_on_payslip cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @is_paid_leave.nil? + return false if @show_on_payslip.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + name == o.name && + is_paid_leave == o.is_paid_leave && + show_on_payslip == o.show_on_payslip && + updated_date_utc == o.updated_date_utc && + is_active == o.is_active + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, name, is_paid_leave, show_on_payslip, updated_date_utc, is_active].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_type_object.rb b/lib/xero-ruby/models/payroll_nz/leave_type_object.rb new file mode 100644 index 00000000..3a7f9015 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_type_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeaveTypeObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_type' => :'leaveType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_type' => :'LeaveType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeaveTypeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeaveTypeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_type == o.leave_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/leave_types.rb b/lib/xero-ruby/models/payroll_nz/leave_types.rb new file mode 100644 index 00000000..06516695 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/leave_types.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class LeaveTypes + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_types + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_types' => :'leaveTypes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_types' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::LeaveTypes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::LeaveTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_types') + if (value = attributes[:'leave_types']).is_a?(Array) + self.leave_types = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_types == o.leave_types + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_types].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pagination.rb b/lib/xero-ruby/models/payroll_nz/pagination.rb new file mode 100644 index 00000000..9b3492f0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pagination.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Pagination + + attr_accessor :page + + + attr_accessor :page_size + + + attr_accessor :page_count + + + attr_accessor :item_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page' => :'page', + :'page_size' => :'pageSize', + :'page_count' => :'pageCount', + :'item_count' => :'itemCount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'page' => :'Integer', + :'page_size' => :'Integer', + :'page_count' => :'Integer', + :'item_count' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Pagination` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'page_count') + self.page_count = attributes[:'page_count'] + end + + if attributes.key?(:'item_count') + self.item_count = attributes[:'item_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + page_size == o.page_size && + page_count == o.page_count && + item_count == o.item_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page, page_size, page_count, item_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_run.rb b/lib/xero-ruby/models/payroll_nz/pay_run.rb new file mode 100644 index 00000000..c242a740 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_run.rb @@ -0,0 +1,389 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRun + # Xero unique identifier for the pay run + attr_accessor :pay_run_id + + # Xero unique identifier for the payroll calendar + attr_accessor :payroll_calendar_id + + # Period start date of the payroll calendar + attr_accessor :period_start_date + + # Period end date of the payroll calendar + attr_accessor :period_end_date + + # Payment date of the pay run + attr_accessor :payment_date + + # Total cost of the pay run + attr_accessor :total_cost + + # Total pay of the pay run + attr_accessor :total_pay + + # Pay run status + attr_accessor :pay_run_status + DRAFT = "Draft".freeze + POSTED = "Posted".freeze + + # Pay run type + attr_accessor :pay_run_type + SCHEDULED = "Scheduled".freeze + UNSCHEDULED = "Unscheduled".freeze + EARLIER_YEAR_UPDATE = "EarlierYearUpdate".freeze + + # Calendar type of the pay run + attr_accessor :calendar_type + WEEKLY = "Weekly".freeze + FORTNIGHTLY = "Fortnightly".freeze + FOUR_WEEKLY = "FourWeekly".freeze + MONTHLY = "Monthly".freeze + ANNUAL = "Annual".freeze + QUARTERLY = "Quarterly".freeze + + # Posted date time of the pay run + attr_accessor :posted_date_time + + + attr_accessor :pay_slips + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_run_id' => :'payRunID', + :'payroll_calendar_id' => :'payrollCalendarID', + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'payment_date' => :'paymentDate', + :'total_cost' => :'totalCost', + :'total_pay' => :'totalPay', + :'pay_run_status' => :'payRunStatus', + :'pay_run_type' => :'payRunType', + :'calendar_type' => :'calendarType', + :'posted_date_time' => :'postedDateTime', + :'pay_slips' => :'paySlips' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_run_id' => :'String', + :'payroll_calendar_id' => :'String', + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'payment_date' => :'Date', + :'total_cost' => :'BigDecimal', + :'total_pay' => :'BigDecimal', + :'pay_run_status' => :'String', + :'pay_run_type' => :'String', + :'calendar_type' => :'String', + :'posted_date_time' => :'Date', + :'pay_slips' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRun` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRun`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_run_id') + self.pay_run_id = attributes[:'pay_run_id'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'total_cost') + self.total_cost = attributes[:'total_cost'] + end + + if attributes.key?(:'total_pay') + self.total_pay = attributes[:'total_pay'] + end + + if attributes.key?(:'pay_run_status') + self.pay_run_status = attributes[:'pay_run_status'] + end + + if attributes.key?(:'pay_run_type') + self.pay_run_type = attributes[:'pay_run_type'] + end + + if attributes.key?(:'calendar_type') + self.calendar_type = attributes[:'calendar_type'] + end + + if attributes.key?(:'posted_date_time') + self.posted_date_time = attributes[:'posted_date_time'] + end + + if attributes.key?(:'pay_slips') + if (value = attributes[:'pay_slips']).is_a?(Array) + self.pay_slips = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + pay_run_status_validator = EnumAttributeValidator.new('String', ["Draft", "Posted"]) + return false unless pay_run_status_validator.valid?(@pay_run_status) + pay_run_type_validator = EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + return false unless pay_run_type_validator.valid?(@pay_run_type) + calendar_type_validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + return false unless calendar_type_validator.valid?(@calendar_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] pay_run_status Object to be assigned + def pay_run_status=(pay_run_status) + validator = EnumAttributeValidator.new('String', ["Draft", "Posted"]) + unless validator.valid?(pay_run_status) + fail ArgumentError, "invalid value for \"pay_run_status\", must be one of #{validator.allowable_values}." + end + @pay_run_status = pay_run_status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] pay_run_type Object to be assigned + def pay_run_type=(pay_run_type) + validator = EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + unless validator.valid?(pay_run_type) + fail ArgumentError, "invalid value for \"pay_run_type\", must be one of #{validator.allowable_values}." + end + @pay_run_type = pay_run_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calendar_type Object to be assigned + def calendar_type=(calendar_type) + validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + unless validator.valid?(calendar_type) + fail ArgumentError, "invalid value for \"calendar_type\", must be one of #{validator.allowable_values}." + end + @calendar_type = calendar_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_run_id == o.pay_run_id && + payroll_calendar_id == o.payroll_calendar_id && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + payment_date == o.payment_date && + total_cost == o.total_cost && + total_pay == o.total_pay && + pay_run_status == o.pay_run_status && + pay_run_type == o.pay_run_type && + calendar_type == o.calendar_type && + posted_date_time == o.posted_date_time && + pay_slips == o.pay_slips + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_run_id, payroll_calendar_id, period_start_date, period_end_date, payment_date, total_cost, total_pay, pay_run_status, pay_run_type, calendar_type, posted_date_time, pay_slips].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb new file mode 100644 index 00000000..c76e2315 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb @@ -0,0 +1,328 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRunCalendar + # Xero unique identifier for the payroll calendar + attr_accessor :payroll_calendar_id + + # Name of the calendar + attr_accessor :name + + # Type of the calendar + attr_accessor :calendar_type + WEEKLY = "Weekly".freeze + FORTNIGHTLY = "Fortnightly".freeze + FOUR_WEEKLY = "FourWeekly".freeze + MONTHLY = "Monthly".freeze + ANNUAL = "Annual".freeze + QUARTERLY = "Quarterly".freeze + + # Period start date of the calendar + attr_accessor :period_start_date + + # Period end date of the calendar + attr_accessor :period_end_date + + # Payment date of the calendar + attr_accessor :payment_date + + # UTC timestamp of the last update to the pay run calendar + attr_accessor :updated_date_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendar_id' => :'payrollCalendarID', + :'name' => :'name', + :'calendar_type' => :'calendarType', + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'payment_date' => :'paymentDate', + :'updated_date_utc' => :'updatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendar_id' => :'String', + :'name' => :'String', + :'calendar_type' => :'String', + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'payment_date' => :'Date', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRunCalendar` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRunCalendar`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'calendar_type') + self.calendar_type = attributes[:'calendar_type'] + end + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @calendar_type.nil? + invalid_properties.push('invalid value for "calendar_type", calendar_type cannot be nil.') + end + + if @period_start_date.nil? + invalid_properties.push('invalid value for "period_start_date", period_start_date cannot be nil.') + end + + if @payment_date.nil? + invalid_properties.push('invalid value for "payment_date", payment_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @calendar_type.nil? + calendar_type_validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + return false unless calendar_type_validator.valid?(@calendar_type) + return false if @period_start_date.nil? + return false if @payment_date.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calendar_type Object to be assigned + def calendar_type=(calendar_type) + validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + unless validator.valid?(calendar_type) + fail ArgumentError, "invalid value for \"calendar_type\", must be one of #{validator.allowable_values}." + end + @calendar_type = calendar_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendar_id == o.payroll_calendar_id && + name == o.name && + calendar_type == o.calendar_type && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + payment_date == o.payment_date && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendar_id, name, calendar_type, period_start_date, period_end_date, payment_date, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb new file mode 100644 index 00000000..15899817 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRunCalendarObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run_calendar + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run_calendar' => :'payRunCalendar' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run_calendar' => :'PayRunCalendar' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRunCalendarObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRunCalendarObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run_calendar') + self.pay_run_calendar = attributes[:'pay_run_calendar'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run_calendar == o.pay_run_calendar + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run_calendar].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb new file mode 100644 index 00000000..efee2cc4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRunCalendars + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run_calendars + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run_calendars' => :'payRunCalendars' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run_calendars' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRunCalendars` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRunCalendars`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run_calendars') + if (value = attributes[:'pay_run_calendars']).is_a?(Array) + self.pay_run_calendars = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run_calendars == o.pay_run_calendars + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run_calendars].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_object.rb b/lib/xero-ruby/models/payroll_nz/pay_run_object.rb new file mode 100644 index 00000000..aa444c59 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_run_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRunObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run' => :'payRun' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run' => :'PayRun' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRunObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRunObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run') + self.pay_run = attributes[:'pay_run'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run == o.pay_run + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_runs.rb b/lib/xero-ruby/models/payroll_nz/pay_runs.rb new file mode 100644 index 00000000..14ec9895 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_runs.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PayRuns + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_runs + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_runs' => :'payRuns' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_runs' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PayRuns` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PayRuns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_runs') + if (value = attributes[:'pay_runs']).is_a?(Array) + self.pay_runs = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_runs == o.pay_runs + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_runs].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_slip.rb b/lib/xero-ruby/models/payroll_nz/pay_slip.rb new file mode 100644 index 00000000..0bde2d55 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_slip.rb @@ -0,0 +1,557 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaySlip + # The Xero identifier for a PaySlip + attr_accessor :pay_slip_id + + # The Xero identifier for payroll employee + attr_accessor :employee_id + + # The Xero identifier for the associated payrun + attr_accessor :pay_run_id + + # The date payslip was last updated + attr_accessor :last_edited + + # Employee first name + attr_accessor :first_name + + # Employee last name + attr_accessor :last_name + + # Total earnings before any deductions. Same as gross earnings for NZ. + attr_accessor :total_earnings + + # Total earnings before any deductions. Same as total earnings for NZ. + attr_accessor :gross_earnings + + # The employee net pay + attr_accessor :total_pay + + # The employer's tax obligation + attr_accessor :total_employer_taxes + + # The part of an employee's earnings that is deducted for tax purposes + attr_accessor :total_employee_taxes + + # Total amount subtracted from an employee's earnings to reach total pay + attr_accessor :total_deductions + + # Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + attr_accessor :total_reimbursements + + # Total amounts required by law to subtract from the employee's earnings + attr_accessor :total_statutory_deductions + + # Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + attr_accessor :total_superannuation + + # BACS Service User Number + attr_accessor :bacs_hash + + # The payment method code + attr_accessor :payment_method + CHEQUE = "Cheque".freeze + ELECTRONICALLY = "Electronically".freeze + MANUAL = "Manual".freeze + + + attr_accessor :earnings_lines + + + attr_accessor :leave_earnings_lines + + + attr_accessor :timesheet_earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :leave_accrual_lines + + + attr_accessor :superannuation_lines + + + attr_accessor :payment_lines + + + attr_accessor :employee_tax_lines + + + attr_accessor :employer_tax_lines + + + attr_accessor :statutory_deduction_lines + + + attr_accessor :tax_settings + + + attr_accessor :gross_earnings_history + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_slip_id' => :'paySlipID', + :'employee_id' => :'employeeID', + :'pay_run_id' => :'payRunID', + :'last_edited' => :'lastEdited', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'total_earnings' => :'totalEarnings', + :'gross_earnings' => :'grossEarnings', + :'total_pay' => :'totalPay', + :'total_employer_taxes' => :'totalEmployerTaxes', + :'total_employee_taxes' => :'totalEmployeeTaxes', + :'total_deductions' => :'totalDeductions', + :'total_reimbursements' => :'totalReimbursements', + :'total_statutory_deductions' => :'totalStatutoryDeductions', + :'total_superannuation' => :'totalSuperannuation', + :'bacs_hash' => :'bacsHash', + :'payment_method' => :'paymentMethod', + :'earnings_lines' => :'earningsLines', + :'leave_earnings_lines' => :'leaveEarningsLines', + :'timesheet_earnings_lines' => :'timesheetEarningsLines', + :'deduction_lines' => :'deductionLines', + :'reimbursement_lines' => :'reimbursementLines', + :'leave_accrual_lines' => :'leaveAccrualLines', + :'superannuation_lines' => :'superannuationLines', + :'payment_lines' => :'paymentLines', + :'employee_tax_lines' => :'employeeTaxLines', + :'employer_tax_lines' => :'employerTaxLines', + :'statutory_deduction_lines' => :'statutoryDeductionLines', + :'tax_settings' => :'taxSettings', + :'gross_earnings_history' => :'grossEarningsHistory' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_slip_id' => :'String', + :'employee_id' => :'String', + :'pay_run_id' => :'String', + :'last_edited' => :'Date', + :'first_name' => :'String', + :'last_name' => :'String', + :'total_earnings' => :'BigDecimal', + :'gross_earnings' => :'BigDecimal', + :'total_pay' => :'BigDecimal', + :'total_employer_taxes' => :'BigDecimal', + :'total_employee_taxes' => :'BigDecimal', + :'total_deductions' => :'BigDecimal', + :'total_reimbursements' => :'BigDecimal', + :'total_statutory_deductions' => :'BigDecimal', + :'total_superannuation' => :'BigDecimal', + :'bacs_hash' => :'String', + :'payment_method' => :'String', + :'earnings_lines' => :'Array', + :'leave_earnings_lines' => :'Array', + :'timesheet_earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'leave_accrual_lines' => :'Array', + :'superannuation_lines' => :'Array', + :'payment_lines' => :'Array', + :'employee_tax_lines' => :'Array', + :'employer_tax_lines' => :'Array', + :'statutory_deduction_lines' => :'Array', + :'tax_settings' => :'TaxSettings', + :'gross_earnings_history' => :'GrossEarningsHistory' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaySlip` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaySlip`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_slip_id') + self.pay_slip_id = attributes[:'pay_slip_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'pay_run_id') + self.pay_run_id = attributes[:'pay_run_id'] + end + + if attributes.key?(:'last_edited') + self.last_edited = attributes[:'last_edited'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'total_earnings') + self.total_earnings = attributes[:'total_earnings'] + end + + if attributes.key?(:'gross_earnings') + self.gross_earnings = attributes[:'gross_earnings'] + end + + if attributes.key?(:'total_pay') + self.total_pay = attributes[:'total_pay'] + end + + if attributes.key?(:'total_employer_taxes') + self.total_employer_taxes = attributes[:'total_employer_taxes'] + end + + if attributes.key?(:'total_employee_taxes') + self.total_employee_taxes = attributes[:'total_employee_taxes'] + end + + if attributes.key?(:'total_deductions') + self.total_deductions = attributes[:'total_deductions'] + end + + if attributes.key?(:'total_reimbursements') + self.total_reimbursements = attributes[:'total_reimbursements'] + end + + if attributes.key?(:'total_statutory_deductions') + self.total_statutory_deductions = attributes[:'total_statutory_deductions'] + end + + if attributes.key?(:'total_superannuation') + self.total_superannuation = attributes[:'total_superannuation'] + end + + if attributes.key?(:'bacs_hash') + self.bacs_hash = attributes[:'bacs_hash'] + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'leave_earnings_lines') + if (value = attributes[:'leave_earnings_lines']).is_a?(Array) + self.leave_earnings_lines = value + end + end + + if attributes.key?(:'timesheet_earnings_lines') + if (value = attributes[:'timesheet_earnings_lines']).is_a?(Array) + self.timesheet_earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'leave_accrual_lines') + if (value = attributes[:'leave_accrual_lines']).is_a?(Array) + self.leave_accrual_lines = value + end + end + + if attributes.key?(:'superannuation_lines') + if (value = attributes[:'superannuation_lines']).is_a?(Array) + self.superannuation_lines = value + end + end + + if attributes.key?(:'payment_lines') + if (value = attributes[:'payment_lines']).is_a?(Array) + self.payment_lines = value + end + end + + if attributes.key?(:'employee_tax_lines') + if (value = attributes[:'employee_tax_lines']).is_a?(Array) + self.employee_tax_lines = value + end + end + + if attributes.key?(:'employer_tax_lines') + if (value = attributes[:'employer_tax_lines']).is_a?(Array) + self.employer_tax_lines = value + end + end + + if attributes.key?(:'statutory_deduction_lines') + if (value = attributes[:'statutory_deduction_lines']).is_a?(Array) + self.statutory_deduction_lines = value + end + end + + if attributes.key?(:'tax_settings') + self.tax_settings = attributes[:'tax_settings'] + end + + if attributes.key?(:'gross_earnings_history') + self.gross_earnings_history = attributes[:'gross_earnings_history'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + return false unless payment_method_validator.valid?(@payment_method) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_method Object to be assigned + def payment_method=(payment_method) + validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + unless validator.valid?(payment_method) + fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." + end + @payment_method = payment_method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_slip_id == o.pay_slip_id && + employee_id == o.employee_id && + pay_run_id == o.pay_run_id && + last_edited == o.last_edited && + first_name == o.first_name && + last_name == o.last_name && + total_earnings == o.total_earnings && + gross_earnings == o.gross_earnings && + total_pay == o.total_pay && + total_employer_taxes == o.total_employer_taxes && + total_employee_taxes == o.total_employee_taxes && + total_deductions == o.total_deductions && + total_reimbursements == o.total_reimbursements && + total_statutory_deductions == o.total_statutory_deductions && + total_superannuation == o.total_superannuation && + bacs_hash == o.bacs_hash && + payment_method == o.payment_method && + earnings_lines == o.earnings_lines && + leave_earnings_lines == o.leave_earnings_lines && + timesheet_earnings_lines == o.timesheet_earnings_lines && + deduction_lines == o.deduction_lines && + reimbursement_lines == o.reimbursement_lines && + leave_accrual_lines == o.leave_accrual_lines && + superannuation_lines == o.superannuation_lines && + payment_lines == o.payment_lines && + employee_tax_lines == o.employee_tax_lines && + employer_tax_lines == o.employer_tax_lines && + statutory_deduction_lines == o.statutory_deduction_lines && + tax_settings == o.tax_settings && + gross_earnings_history == o.gross_earnings_history + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_slip_id, employee_id, pay_run_id, last_edited, first_name, last_name, total_earnings, gross_earnings, total_pay, total_employer_taxes, total_employee_taxes, total_deductions, total_reimbursements, total_statutory_deductions, total_superannuation, bacs_hash, payment_method, earnings_lines, leave_earnings_lines, timesheet_earnings_lines, deduction_lines, reimbursement_lines, leave_accrual_lines, superannuation_lines, payment_lines, employee_tax_lines, employer_tax_lines, statutory_deduction_lines, tax_settings, gross_earnings_history].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb b/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb new file mode 100644 index 00000000..da14f202 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaySlipObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_slip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_slip' => :'paySlip' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_slip' => :'PaySlip' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaySlipObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaySlipObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_slip') + self.pay_slip = attributes[:'pay_slip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_slip == o.pay_slip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_slip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/pay_slips.rb b/lib/xero-ruby/models/payroll_nz/pay_slips.rb new file mode 100644 index 00000000..3d86faeb --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/pay_slips.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaySlips + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_slips + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_slips' => :'paySlips' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_slips' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaySlips` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaySlips`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_slips') + if (value = attributes[:'pay_slips']).is_a?(Array) + self.pay_slips = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_slips == o.pay_slips + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_slips].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/payment_line.rb b/lib/xero-ruby/models/payroll_nz/payment_line.rb new file mode 100644 index 00000000..389ca11b --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/payment_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaymentLine + # Xero identifier for payroll payment line + attr_accessor :payment_line_id + + # The amount of the payment line + attr_accessor :amount + + # The account number + attr_accessor :account_number + + # The account sort code + attr_accessor :sort_code + + # The account name + attr_accessor :account_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_line_id' => :'paymentLineID', + :'amount' => :'amount', + :'account_number' => :'accountNumber', + :'sort_code' => :'sortCode', + :'account_name' => :'accountName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_line_id' => :'String', + :'amount' => :'BigDecimal', + :'account_number' => :'String', + :'sort_code' => :'String', + :'account_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaymentLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaymentLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_line_id') + self.payment_line_id = attributes[:'payment_line_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'sort_code') + self.sort_code = attributes[:'sort_code'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_line_id == o.payment_line_id && + amount == o.amount && + account_number == o.account_number && + sort_code == o.sort_code && + account_name == o.account_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_line_id, amount, account_number, sort_code, account_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/payment_method.rb b/lib/xero-ruby/models/payroll_nz/payment_method.rb new file mode 100644 index 00000000..47ad6cdc --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/payment_method.rb @@ -0,0 +1,262 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaymentMethod + # The payment method code + attr_accessor :payment_method + CHEQUE = "Cheque".freeze + ELECTRONICALLY = "Electronically".freeze + MANUAL = "Manual".freeze + + + attr_accessor :bank_accounts + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_method' => :'paymentMethod', + :'bank_accounts' => :'bankAccounts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_method' => :'String', + :'bank_accounts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaymentMethod` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaymentMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + + if attributes.key?(:'bank_accounts') + if (value = attributes[:'bank_accounts']).is_a?(Array) + self.bank_accounts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @payment_method.nil? + invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @payment_method.nil? + payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + return false unless payment_method_validator.valid?(@payment_method) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_method Object to be assigned + def payment_method=(payment_method) + validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + unless validator.valid?(payment_method) + fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." + end + @payment_method = payment_method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_method == o.payment_method && + bank_accounts == o.bank_accounts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_method, bank_accounts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/payment_method_object.rb b/lib/xero-ruby/models/payroll_nz/payment_method_object.rb new file mode 100644 index 00000000..ece11759 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/payment_method_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class PaymentMethodObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :payment_method + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'payment_method' => :'paymentMethod' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'payment_method' => :'PaymentMethod' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaymentMethodObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaymentMethodObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + payment_method == o.payment_method + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, payment_method].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/problem.rb b/lib/xero-ruby/models/payroll_nz/problem.rb new file mode 100644 index 00000000..ed3ee93c --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/problem.rb @@ -0,0 +1,261 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + # The object returned for a bad request + require 'bigdecimal' + + class Problem + # The type of error format + attr_accessor :type + + # The type of the error + attr_accessor :title + + # The error status code + attr_accessor :status + + # A description of the error + attr_accessor :detail + + + attr_accessor :instance + + + attr_accessor :invalid_fields + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'title' => :'title', + :'status' => :'status', + :'detail' => :'detail', + :'instance' => :'instance', + :'invalid_fields' => :'invalidFields' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'title' => :'String', + :'status' => :'String', + :'detail' => :'String', + :'instance' => :'String', + :'invalid_fields' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Problem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Problem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + end + + if attributes.key?(:'invalid_fields') + if (value = attributes[:'invalid_fields']).is_a?(Array) + self.invalid_fields = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + title == o.title && + status == o.status && + detail == o.detail && + instance == o.instance && + invalid_fields == o.invalid_fields + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, title, status, detail, instance, invalid_fields].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement.rb b/lib/xero-ruby/models/payroll_nz/reimbursement.rb new file mode 100644 index 00000000..9bf5ba5a --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/reimbursement.rb @@ -0,0 +1,364 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Reimbursement + # Xero unique identifier for a reimbursement + attr_accessor :reimbursement_id + + # Name of the reimbursement + attr_accessor :name + + # Xero unique identifier for the account used for the reimbursement + attr_accessor :account_id + + # Indicates that whether the reimbursement is active + attr_accessor :current_record + + # See Reimbursement Categories + attr_accessor :reimbursement_category + GST = "GST".freeze + NO_GST = "NoGST".freeze + GST_INCLUSIVE = "GSTInclusive".freeze + + # See Calculation Types + attr_accessor :calculation_type + UNKNOWN = "Unknown".freeze + FIXED_AMOUNT = "FixedAmount".freeze + RATE_PER_UNIT = "RatePerUnit".freeze + + # Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount + attr_accessor :standard_amount + + # Optional Type Of Units. Applicable when calculation type is Rate Per Unit + attr_accessor :standard_type_of_units + HOURS = "Hours".freeze + KM = "km".freeze + + # Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit + attr_accessor :standard_rate_per_unit + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_id' => :'reimbursementID', + :'name' => :'name', + :'account_id' => :'accountID', + :'current_record' => :'currentRecord', + :'reimbursement_category' => :'reimbursementCategory', + :'calculation_type' => :'calculationType', + :'standard_amount' => :'standardAmount', + :'standard_type_of_units' => :'standardTypeOfUnits', + :'standard_rate_per_unit' => :'standardRatePerUnit' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_id' => :'String', + :'name' => :'String', + :'account_id' => :'String', + :'current_record' => :'Boolean', + :'reimbursement_category' => :'String', + :'calculation_type' => :'String', + :'standard_amount' => :'String', + :'standard_type_of_units' => :'String', + :'standard_rate_per_unit' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Reimbursement` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Reimbursement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_id') + self.reimbursement_id = attributes[:'reimbursement_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'reimbursement_category') + self.reimbursement_category = attributes[:'reimbursement_category'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'standard_amount') + self.standard_amount = attributes[:'standard_amount'] + end + + if attributes.key?(:'standard_type_of_units') + self.standard_type_of_units = attributes[:'standard_type_of_units'] + end + + if attributes.key?(:'standard_rate_per_unit') + self.standard_rate_per_unit = attributes[:'standard_rate_per_unit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @account_id.nil? + invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @account_id.nil? + reimbursement_category_validator = EnumAttributeValidator.new('String', ["GST", "NoGST", "GSTInclusive"]) + return false unless reimbursement_category_validator.valid?(@reimbursement_category) + calculation_type_validator = EnumAttributeValidator.new('String', ["Unknown", "FixedAmount", "RatePerUnit"]) + return false unless calculation_type_validator.valid?(@calculation_type) + standard_type_of_units_validator = EnumAttributeValidator.new('String', ["Hours", "km"]) + return false unless standard_type_of_units_validator.valid?(@standard_type_of_units) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] reimbursement_category Object to be assigned + def reimbursement_category=(reimbursement_category) + validator = EnumAttributeValidator.new('String', ["GST", "NoGST", "GSTInclusive"]) + unless validator.valid?(reimbursement_category) + fail ArgumentError, "invalid value for \"reimbursement_category\", must be one of #{validator.allowable_values}." + end + @reimbursement_category = reimbursement_category + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calculation_type Object to be assigned + def calculation_type=(calculation_type) + validator = EnumAttributeValidator.new('String', ["Unknown", "FixedAmount", "RatePerUnit"]) + unless validator.valid?(calculation_type) + fail ArgumentError, "invalid value for \"calculation_type\", must be one of #{validator.allowable_values}." + end + @calculation_type = calculation_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] standard_type_of_units Object to be assigned + def standard_type_of_units=(standard_type_of_units) + validator = EnumAttributeValidator.new('String', ["Hours", "km"]) + unless validator.valid?(standard_type_of_units) + fail ArgumentError, "invalid value for \"standard_type_of_units\", must be one of #{validator.allowable_values}." + end + @standard_type_of_units = standard_type_of_units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_id == o.reimbursement_id && + name == o.name && + account_id == o.account_id && + current_record == o.current_record && + reimbursement_category == o.reimbursement_category && + calculation_type == o.calculation_type && + standard_amount == o.standard_amount && + standard_type_of_units == o.standard_type_of_units && + standard_rate_per_unit == o.standard_rate_per_unit + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_id, name, account_id, current_record, reimbursement_category, calculation_type, standard_amount, standard_type_of_units, standard_rate_per_unit].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb b/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb new file mode 100644 index 00000000..cbe36892 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class ReimbursementLine + # Xero identifier for payroll reimbursement + attr_accessor :reimbursement_type_id + + # Reimbursement line description + attr_accessor :description + + # Reimbursement amount + attr_accessor :amount + + # Rate per unit for leave earnings line + attr_accessor :rate_per_unit + + # Leave earnings number of units + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_type_id' => :'reimbursementTypeID', + :'description' => :'description', + :'amount' => :'amount', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_type_id' => :'String', + :'description' => :'String', + :'amount' => :'BigDecimal', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::ReimbursementLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::ReimbursementLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_type_id') + self.reimbursement_type_id = attributes[:'reimbursement_type_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_type_id == o.reimbursement_type_id && + description == o.description && + amount == o.amount && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_type_id, description, amount, rate_per_unit, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb b/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb new file mode 100644 index 00000000..341214d7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class ReimbursementObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :reimbursement + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'reimbursement' => :'reimbursement' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'reimbursement' => :'Reimbursement' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::ReimbursementObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::ReimbursementObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'reimbursement') + self.reimbursement = attributes[:'reimbursement'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + reimbursement == o.reimbursement + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, reimbursement].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/reimbursements.rb b/lib/xero-ruby/models/payroll_nz/reimbursements.rb new file mode 100644 index 00000000..0652a603 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/reimbursements.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Reimbursements + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :reimbursements + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'reimbursements' => :'reimbursements' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'reimbursements' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Reimbursements` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Reimbursements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'reimbursements') + if (value = attributes[:'reimbursements']).is_a?(Array) + self.reimbursements = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + reimbursements == o.reimbursements + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, reimbursements].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb new file mode 100644 index 00000000..8f87e925 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb @@ -0,0 +1,388 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class SalaryAndWage + # Xero unique identifier for a salary and wages record + attr_accessor :salary_and_wages_id + + # Xero unique identifier for an earnings rate + attr_accessor :earnings_rate_id + + # The Number of Units per week for the corresponding salary and wages + attr_accessor :number_of_units_per_week + + # The rate of each unit for the corresponding salary and wages + attr_accessor :rate_per_unit + + # The Number of Units per day for the corresponding salary and wages + attr_accessor :number_of_units_per_day + + # The days per week for the salary. + attr_accessor :days_per_week + + # The effective date of the corresponding salary and wages + attr_accessor :effective_from + + # The annual salary + attr_accessor :annual_salary + + # The current status of the corresponding salary and wages + attr_accessor :status + ACTIVE = "Active".freeze + PENDING = "Pending".freeze + + # The type of the payment of the corresponding salary and wages + attr_accessor :payment_type + SALARY = "Salary".freeze + HOURLY = "Hourly".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'salary_and_wages_id' => :'salaryAndWagesID', + :'earnings_rate_id' => :'earningsRateID', + :'number_of_units_per_week' => :'numberOfUnitsPerWeek', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units_per_day' => :'numberOfUnitsPerDay', + :'days_per_week' => :'daysPerWeek', + :'effective_from' => :'effectiveFrom', + :'annual_salary' => :'annualSalary', + :'status' => :'status', + :'payment_type' => :'paymentType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'salary_and_wages_id' => :'String', + :'earnings_rate_id' => :'String', + :'number_of_units_per_week' => :'BigDecimal', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units_per_day' => :'BigDecimal', + :'days_per_week' => :'Integer', + :'effective_from' => :'Date', + :'annual_salary' => :'BigDecimal', + :'status' => :'String', + :'payment_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::SalaryAndWage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::SalaryAndWage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'salary_and_wages_id') + self.salary_and_wages_id = attributes[:'salary_and_wages_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'number_of_units_per_week') + self.number_of_units_per_week = attributes[:'number_of_units_per_week'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units_per_day') + self.number_of_units_per_day = attributes[:'number_of_units_per_day'] + end + + if attributes.key?(:'days_per_week') + self.days_per_week = attributes[:'days_per_week'] + end + + if attributes.key?(:'effective_from') + self.effective_from = attributes[:'effective_from'] + end + + if attributes.key?(:'annual_salary') + self.annual_salary = attributes[:'annual_salary'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'payment_type') + self.payment_type = attributes[:'payment_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @earnings_rate_id.nil? + invalid_properties.push('invalid value for "earnings_rate_id", earnings_rate_id cannot be nil.') + end + + if @number_of_units_per_week.nil? + invalid_properties.push('invalid value for "number_of_units_per_week", number_of_units_per_week cannot be nil.') + end + + if @rate_per_unit.nil? + invalid_properties.push('invalid value for "rate_per_unit", rate_per_unit cannot be nil.') + end + + if @number_of_units_per_day.nil? + invalid_properties.push('invalid value for "number_of_units_per_day", number_of_units_per_day cannot be nil.') + end + + if @effective_from.nil? + invalid_properties.push('invalid value for "effective_from", effective_from cannot be nil.') + end + + if @annual_salary.nil? + invalid_properties.push('invalid value for "annual_salary", annual_salary cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @payment_type.nil? + invalid_properties.push('invalid value for "payment_type", payment_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @earnings_rate_id.nil? + return false if @number_of_units_per_week.nil? + return false if @rate_per_unit.nil? + return false if @number_of_units_per_day.nil? + return false if @effective_from.nil? + return false if @annual_salary.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["Active", "Pending"]) + return false unless status_validator.valid?(@status) + return false if @payment_type.nil? + payment_type_validator = EnumAttributeValidator.new('String', ["Salary", "Hourly"]) + return false unless payment_type_validator.valid?(@payment_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Active", "Pending"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_type Object to be assigned + def payment_type=(payment_type) + validator = EnumAttributeValidator.new('String', ["Salary", "Hourly"]) + unless validator.valid?(payment_type) + fail ArgumentError, "invalid value for \"payment_type\", must be one of #{validator.allowable_values}." + end + @payment_type = payment_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + salary_and_wages_id == o.salary_and_wages_id && + earnings_rate_id == o.earnings_rate_id && + number_of_units_per_week == o.number_of_units_per_week && + rate_per_unit == o.rate_per_unit && + number_of_units_per_day == o.number_of_units_per_day && + days_per_week == o.days_per_week && + effective_from == o.effective_from && + annual_salary == o.annual_salary && + status == o.status && + payment_type == o.payment_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [salary_and_wages_id, earnings_rate_id, number_of_units_per_week, rate_per_unit, number_of_units_per_day, days_per_week, effective_from, annual_salary, status, payment_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb new file mode 100644 index 00000000..961d1eed --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class SalaryAndWageObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :salary_and_wages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'salary_and_wages' => :'salaryAndWages' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'salary_and_wages' => :'SalaryAndWage' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::SalaryAndWageObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::SalaryAndWageObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'salary_and_wages') + self.salary_and_wages = attributes[:'salary_and_wages'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + salary_and_wages == o.salary_and_wages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, salary_and_wages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb new file mode 100644 index 00000000..7d0a9695 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class SalaryAndWages + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :salary_and_wages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'salary_and_wages' => :'salaryAndWages' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'salary_and_wages' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::SalaryAndWages` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::SalaryAndWages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'salary_and_wages') + if (value = attributes[:'salary_and_wages']).is_a?(Array) + self.salary_and_wages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + salary_and_wages == o.salary_and_wages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, salary_and_wages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/settings.rb b/lib/xero-ruby/models/payroll_nz/settings.rb new file mode 100644 index 00000000..ebb8a24e --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/settings.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Settings + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'settings' => :'Accounts' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Settings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Settings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, settings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb new file mode 100644 index 00000000..16de1af1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class StatutoryDeduction + # The Xero identifier for earnings order + attr_accessor :id + + # Name of the earnings order + attr_accessor :name + + + attr_accessor :statutory_deduction_category + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'statutory_deduction_category' => :'statutoryDeductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'statutory_deduction_category' => :'StatutoryDeductionCategory', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::StatutoryDeduction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::StatutoryDeduction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'statutory_deduction_category') + self.statutory_deduction_category = attributes[:'statutory_deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + statutory_deduction_category == o.statutory_deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, statutory_deduction_category, liability_account_id, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb new file mode 100644 index 00000000..feac6f36 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb @@ -0,0 +1,46 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + class StatutoryDeductionCategory + PRIORITY_ORDER = "PriorityOrder".freeze + NON_PRIORITY_ORDER = "NonPriorityOrder".freeze + TABLE_BASED = "TableBased".freeze + CHILD_SUPPORT = "ChildSupport".freeze + COURT_FINES = "CourtFines".freeze + INLAND_REVENUE_ARREARS = "InlandRevenueArrears".freeze + MSD_REPAYMENTS = "MsdRepayments".freeze + STUDENT_LOAN = "StudentLoan".freeze + ADDITIONAL_STUDENT_LOAN = "AdditionalStudentLoan".freeze + VOLUNTARY_STUDENT_LOAN = "VoluntaryStudentLoan".freeze + KIWI_SAVER = "KiwiSaver".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = StatutoryDeductionCategory.constants.select { |c| StatutoryDeductionCategory::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #StatutoryDeductionCategory" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb new file mode 100644 index 00000000..cbd03426 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class StatutoryDeductionLine + # Xero identifier for payroll statutory deduction type + attr_accessor :statutory_deduction_type_id + + # The amount of the statutory deduction line + attr_accessor :amount + + # Fixed Amount + attr_accessor :fixed_amount + + # Identifies if the tax line is a manual adjustment + attr_accessor :manual_adjustment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_deduction_type_id' => :'statutoryDeductionTypeID', + :'amount' => :'amount', + :'fixed_amount' => :'fixedAmount', + :'manual_adjustment' => :'manualAdjustment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_deduction_type_id' => :'String', + :'amount' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'manual_adjustment' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::StatutoryDeductionLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::StatutoryDeductionLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_deduction_type_id') + self.statutory_deduction_type_id = attributes[:'statutory_deduction_type_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'manual_adjustment') + self.manual_adjustment = attributes[:'manual_adjustment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_deduction_type_id == o.statutory_deduction_type_id && + amount == o.amount && + fixed_amount == o.fixed_amount && + manual_adjustment == o.manual_adjustment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_deduction_type_id, amount, fixed_amount, manual_adjustment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb new file mode 100644 index 00000000..6b7b9f82 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class StatutoryDeductionObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deduction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deduction' => :'statutoryDeduction' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deduction' => :'StatutoryDeduction' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::StatutoryDeductionObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::StatutoryDeductionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deduction') + self.statutory_deduction = attributes[:'statutory_deduction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deduction == o.statutory_deduction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deduction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb b/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb new file mode 100644 index 00000000..efdf5d84 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class StatutoryDeductions + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deductions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deductions' => :'statutoryDeductions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deductions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::StatutoryDeductions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::StatutoryDeductions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deductions') + if (value = attributes[:'statutory_deductions']).is_a?(Array) + self.statutory_deductions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deductions == o.statutory_deductions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deductions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/superannuation_line.rb b/lib/xero-ruby/models/payroll_nz/superannuation_line.rb new file mode 100644 index 00000000..5c225dbe --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/superannuation_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class SuperannuationLine + # Xero identifier for payroll superannucation type + attr_accessor :superannuation_type_id + + # Benefit display name + attr_accessor :display_name + + # The amount of the superannuation line + attr_accessor :amount + + # Superannuation fixed amount + attr_accessor :fixed_amount + + # Superannuation rate percentage + attr_accessor :percentage + + # manual adjustment made + attr_accessor :manual_adjustment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'superannuation_type_id' => :'superannuationTypeID', + :'display_name' => :'displayName', + :'amount' => :'amount', + :'fixed_amount' => :'fixedAmount', + :'percentage' => :'percentage', + :'manual_adjustment' => :'manualAdjustment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'superannuation_type_id' => :'String', + :'display_name' => :'String', + :'amount' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'percentage' => :'BigDecimal', + :'manual_adjustment' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::SuperannuationLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::SuperannuationLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'superannuation_type_id') + self.superannuation_type_id = attributes[:'superannuation_type_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'manual_adjustment') + self.manual_adjustment = attributes[:'manual_adjustment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + superannuation_type_id == o.superannuation_type_id && + display_name == o.display_name && + amount == o.amount && + fixed_amount == o.fixed_amount && + percentage == o.percentage && + manual_adjustment == o.manual_adjustment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [superannuation_type_id, display_name, amount, fixed_amount, percentage, manual_adjustment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/superannuation_object.rb b/lib/xero-ruby/models/payroll_nz/superannuation_object.rb new file mode 100644 index 00000000..80354169 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/superannuation_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class SuperannuationObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :benefit + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'benefit' => :'benefit' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'benefit' => :'Benefit' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::SuperannuationObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::SuperannuationObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'benefit') + self.benefit = attributes[:'benefit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + benefit == o.benefit + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, benefit].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/superannuations.rb b/lib/xero-ruby/models/payroll_nz/superannuations.rb new file mode 100644 index 00000000..4aecde2e --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/superannuations.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Superannuations + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :benefits + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'benefits' => :'benefits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'benefits' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Superannuations` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Superannuations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'benefits') + if (value = attributes[:'benefits']).is_a?(Array) + self.benefits = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + benefits == o.benefits + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, benefits].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/tax_code.rb b/lib/xero-ruby/models/payroll_nz/tax_code.rb new file mode 100644 index 00000000..dc824c91 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/tax_code.rb @@ -0,0 +1,54 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + class TaxCode + ND = "ND".freeze + M = "M".freeze + ME = "ME".freeze + MSL = "MSL".freeze + MESL = "MESL".freeze + SB = "SB".freeze + S = "S".freeze + SH = "SH".freeze + ST = "ST".freeze + SBSL = "SBSL".freeze + SSL = "SSL".freeze + SHSL = "SHSL".freeze + STSL = "STSL".freeze + WT = "WT".freeze + CAE = "CAE".freeze + EDW = "EDW".freeze + NSW = "NSW".freeze + STC = "STC".freeze + STCSL = "STCSL".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TaxCode.constants.select { |c| TaxCode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TaxCode" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/tax_line.rb b/lib/xero-ruby/models/payroll_nz/tax_line.rb new file mode 100644 index 00000000..bb6548e5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/tax_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TaxLine + # Xero identifier for payroll tax line + attr_accessor :tax_line_id + + # Tax line description + attr_accessor :description + + # The amount of the tax line + attr_accessor :amount + + # Tax type ID + attr_accessor :global_tax_type_id + + # Identifies if the tax line is a manual adjustment + attr_accessor :manual_adjustment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tax_line_id' => :'taxLineID', + :'description' => :'description', + :'amount' => :'amount', + :'global_tax_type_id' => :'globalTaxTypeID', + :'manual_adjustment' => :'manualAdjustment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tax_line_id' => :'String', + :'description' => :'String', + :'amount' => :'BigDecimal', + :'global_tax_type_id' => :'String', + :'manual_adjustment' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TaxLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TaxLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tax_line_id') + self.tax_line_id = attributes[:'tax_line_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'global_tax_type_id') + self.global_tax_type_id = attributes[:'global_tax_type_id'] + end + + if attributes.key?(:'manual_adjustment') + self.manual_adjustment = attributes[:'manual_adjustment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tax_line_id == o.tax_line_id && + description == o.description && + amount == o.amount && + global_tax_type_id == o.global_tax_type_id && + manual_adjustment == o.manual_adjustment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tax_line_id, description, amount, global_tax_type_id, manual_adjustment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/tax_settings.rb b/lib/xero-ruby/models/payroll_nz/tax_settings.rb new file mode 100644 index 00000000..13be5ba9 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/tax_settings.rb @@ -0,0 +1,294 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TaxSettings + # The number of units for the period type + attr_accessor :period_units + + # The type of period (\"weeks\" or \"months\") + attr_accessor :period_type + WEEKS = "weeks".freeze + MONTHS = "months".freeze + + + attr_accessor :tax_code + + # Tax rate for STC and WT + attr_accessor :special_tax_rate + + # Tax code for a lump sum amount + attr_accessor :lump_sum_tax_code + + # The total of the lump sum amount + attr_accessor :lump_sum_amount + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_units' => :'periodUnits', + :'period_type' => :'periodType', + :'tax_code' => :'taxCode', + :'special_tax_rate' => :'specialTaxRate', + :'lump_sum_tax_code' => :'lumpSumTaxCode', + :'lump_sum_amount' => :'lumpSumAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_units' => :'Integer', + :'period_type' => :'String', + :'tax_code' => :'TaxCode', + :'special_tax_rate' => :'String', + :'lump_sum_tax_code' => :'String', + :'lump_sum_amount' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TaxSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TaxSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'period_units') + self.period_units = attributes[:'period_units'] + end + + if attributes.key?(:'period_type') + self.period_type = attributes[:'period_type'] + end + + if attributes.key?(:'tax_code') + self.tax_code = attributes[:'tax_code'] + end + + if attributes.key?(:'special_tax_rate') + self.special_tax_rate = attributes[:'special_tax_rate'] + end + + if attributes.key?(:'lump_sum_tax_code') + self.lump_sum_tax_code = attributes[:'lump_sum_tax_code'] + end + + if attributes.key?(:'lump_sum_amount') + self.lump_sum_amount = attributes[:'lump_sum_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + period_type_validator = EnumAttributeValidator.new('String', ["weeks", "months"]) + return false unless period_type_validator.valid?(@period_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] period_type Object to be assigned + def period_type=(period_type) + validator = EnumAttributeValidator.new('String', ["weeks", "months"]) + unless validator.valid?(period_type) + fail ArgumentError, "invalid value for \"period_type\", must be one of #{validator.allowable_values}." + end + @period_type = period_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_units == o.period_units && + period_type == o.period_type && + tax_code == o.tax_code && + special_tax_rate == o.special_tax_rate && + lump_sum_tax_code == o.lump_sum_tax_code && + lump_sum_amount == o.lump_sum_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_units, period_type, tax_code, special_tax_rate, lump_sum_tax_code, lump_sum_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheet.rb b/lib/xero-ruby/models/payroll_nz/timesheet.rb new file mode 100644 index 00000000..035dd1c9 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheet.rb @@ -0,0 +1,347 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Timesheet + # The Xero identifier for a Timesheet + attr_accessor :timesheet_id + + # The Xero identifier for the Payroll Calandar that the Timesheet applies to + attr_accessor :payroll_calendar_id + + # The Xero identifier for the Employee that the Timesheet is for + attr_accessor :employee_id + + # The Start Date of the Timesheet period (YYYY-MM-DD) + attr_accessor :start_date + + # The End Date of the Timesheet period (YYYY-MM-DD) + attr_accessor :end_date + + # Status of the timesheet + attr_accessor :status + DRAFT = "Draft".freeze + APPROVED = "Approved".freeze + COMPLETED = "Completed".freeze + + # The Total Hours of the Timesheet + attr_accessor :total_hours + + # The UTC date time that the Timesheet was last updated + attr_accessor :updated_date_utc + + + attr_accessor :timesheet_lines + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheet_id' => :'timesheetID', + :'payroll_calendar_id' => :'payrollCalendarID', + :'employee_id' => :'employeeID', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'status' => :'status', + :'total_hours' => :'totalHours', + :'updated_date_utc' => :'updatedDateUTC', + :'timesheet_lines' => :'timesheetLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheet_id' => :'String', + :'payroll_calendar_id' => :'String', + :'employee_id' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'status' => :'String', + :'total_hours' => :'BigDecimal', + :'updated_date_utc' => :'DateTime', + :'timesheet_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Timesheet` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Timesheet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheet_id') + self.timesheet_id = attributes[:'timesheet_id'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'total_hours') + self.total_hours = attributes[:'total_hours'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'timesheet_lines') + if (value = attributes[:'timesheet_lines']).is_a?(Array) + self.timesheet_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @payroll_calendar_id.nil? + invalid_properties.push('invalid value for "payroll_calendar_id", payroll_calendar_id cannot be nil.') + end + + if @employee_id.nil? + invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @payroll_calendar_id.nil? + return false if @employee_id.nil? + return false if @start_date.nil? + return false if @end_date.nil? + status_validator = EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheet_id == o.timesheet_id && + payroll_calendar_id == o.payroll_calendar_id && + employee_id == o.employee_id && + start_date == o.start_date && + end_date == o.end_date && + status == o.status && + total_hours == o.total_hours && + updated_date_utc == o.updated_date_utc && + timesheet_lines == o.timesheet_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheet_id, payroll_calendar_id, employee_id, start_date, end_date, status, total_hours, updated_date_utc, timesheet_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb b/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb new file mode 100644 index 00000000..6a1a9201 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb @@ -0,0 +1,298 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TimesheetEarningsLine + # Xero identifier for payroll earnings line + attr_accessor :earnings_line_id + + # Xero identifier for payroll leave earnings rate + attr_accessor :earnings_rate_id + + # name of earnings rate for display in UI + attr_accessor :display_name + + # Rate per unit for leave earnings line + attr_accessor :rate_per_unit + + # Leave earnings number of units + attr_accessor :number_of_units + + # Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the earnings line. + attr_accessor :amount + + # Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + attr_accessor :is_linked_to_timesheet + + # Identifies if the earnings is using an average daily pay rate + attr_accessor :is_average_daily_pay_rate + + # Flag to indentify whether the earnings line is system generated or not. + attr_accessor :is_system_generated + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_line_id' => :'earningsLineID', + :'earnings_rate_id' => :'earningsRateID', + :'display_name' => :'displayName', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet', + :'is_average_daily_pay_rate' => :'isAverageDailyPayRate', + :'is_system_generated' => :'isSystemGenerated' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_line_id' => :'String', + :'earnings_rate_id' => :'String', + :'display_name' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'amount' => :'BigDecimal', + :'is_linked_to_timesheet' => :'Boolean', + :'is_average_daily_pay_rate' => :'Boolean', + :'is_system_generated' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TimesheetEarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TimesheetEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_line_id') + self.earnings_line_id = attributes[:'earnings_line_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + + if attributes.key?(:'is_average_daily_pay_rate') + self.is_average_daily_pay_rate = attributes[:'is_average_daily_pay_rate'] + end + + if attributes.key?(:'is_system_generated') + self.is_system_generated = attributes[:'is_system_generated'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_line_id == o.earnings_line_id && + earnings_rate_id == o.earnings_rate_id && + display_name == o.display_name && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet && + is_average_daily_pay_rate == o.is_average_daily_pay_rate && + is_system_generated == o.is_system_generated + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_line_id, earnings_rate_id, display_name, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet, is_average_daily_pay_rate, is_system_generated].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_line.rb b/lib/xero-ruby/models/payroll_nz/timesheet_line.rb new file mode 100644 index 00000000..a1e0f57b --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheet_line.rb @@ -0,0 +1,263 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TimesheetLine + # The Xero identifier for a Timesheet Line + attr_accessor :timesheet_line_id + + # The Date that this Timesheet Line is for (YYYY-MM-DD) + attr_accessor :date + + # The Xero identifier for the Earnings Rate that the Timesheet is for + attr_accessor :earnings_rate_id + + # The Xero identifier for the Tracking Item that the Timesheet is for + attr_accessor :tracking_item_id + + # The Number of Units of the Timesheet Line + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheet_line_id' => :'timesheetLineID', + :'date' => :'date', + :'earnings_rate_id' => :'earningsRateID', + :'tracking_item_id' => :'trackingItemID', + :'number_of_units' => :'numberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheet_line_id' => :'String', + :'date' => :'Date', + :'earnings_rate_id' => :'String', + :'tracking_item_id' => :'String', + :'number_of_units' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TimesheetLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TimesheetLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheet_line_id') + self.timesheet_line_id = attributes[:'timesheet_line_id'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'tracking_item_id') + self.tracking_item_id = attributes[:'tracking_item_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + if @earnings_rate_id.nil? + invalid_properties.push('invalid value for "earnings_rate_id", earnings_rate_id cannot be nil.') + end + + if @number_of_units.nil? + invalid_properties.push('invalid value for "number_of_units", number_of_units cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @date.nil? + return false if @earnings_rate_id.nil? + return false if @number_of_units.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheet_line_id == o.timesheet_line_id && + date == o.date && + earnings_rate_id == o.earnings_rate_id && + tracking_item_id == o.tracking_item_id && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheet_line_id, date, earnings_rate_id, tracking_item_id, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb b/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb new file mode 100644 index 00000000..157ede58 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TimesheetLineObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheet_line + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheet_line' => :'timesheetLine' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheet_line' => :'TimesheetLine' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TimesheetLineObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TimesheetLineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheet_line') + self.timesheet_line = attributes[:'timesheet_line'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheet_line == o.timesheet_line + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheet_line].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_object.rb b/lib/xero-ruby/models/payroll_nz/timesheet_object.rb new file mode 100644 index 00000000..c443c060 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheet_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TimesheetObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheet + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheet' => :'timesheet' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheet' => :'Timesheet' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TimesheetObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TimesheetObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheet') + self.timesheet = attributes[:'timesheet'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheet == o.timesheet + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheet].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/timesheets.rb b/lib/xero-ruby/models/payroll_nz/timesheets.rb new file mode 100644 index 00000000..85573b36 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/timesheets.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class Timesheets + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheets + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheets' => :'timesheets' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheets' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::Timesheets` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::Timesheets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheets') + if (value = attributes[:'timesheets']).is_a?(Array) + self.timesheets = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheets == o.timesheets + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheets].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/tracking_categories.rb b/lib/xero-ruby/models/payroll_nz/tracking_categories.rb new file mode 100644 index 00000000..4339dfd4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/tracking_categories.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TrackingCategories + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :tracking_categories + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'tracking_categories' => :'trackingCategories' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'tracking_categories' => :'TrackingCategory' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TrackingCategories` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TrackingCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'tracking_categories') + self.tracking_categories = attributes[:'tracking_categories'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + tracking_categories == o.tracking_categories + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, tracking_categories].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/tracking_category.rb b/lib/xero-ruby/models/payroll_nz/tracking_category.rb new file mode 100644 index 00000000..53d3ce3a --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/tracking_category.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollNz + require 'bigdecimal' + + class TrackingCategory + # The Xero identifier for Employee groups tracking category. + attr_accessor :employee_groups_tracking_category_id + + # The Xero identifier for Timesheet tracking category. + attr_accessor :timesheet_tracking_category_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_groups_tracking_category_id' => :'employeeGroupsTrackingCategoryID', + :'timesheet_tracking_category_id' => :'timesheetTrackingCategoryID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_groups_tracking_category_id' => :'String', + :'timesheet_tracking_category_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::TrackingCategory` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::TrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_groups_tracking_category_id') + self.employee_groups_tracking_category_id = attributes[:'employee_groups_tracking_category_id'] + end + + if attributes.key?(:'timesheet_tracking_category_id') + self.timesheet_tracking_category_id = attributes[:'timesheet_tracking_category_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_groups_tracking_category_id == o.employee_groups_tracking_category_id && + timesheet_tracking_category_id == o.timesheet_tracking_category_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_groups_tracking_category_id, timesheet_tracking_category_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollNz.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/account.rb b/lib/xero-ruby/models/payroll_uk/account.rb new file mode 100644 index 00000000..ed3d6dd7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/account.rb @@ -0,0 +1,279 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Account + # The Xero identifier for Settings. + attr_accessor :account_id + + # The assigned AccountType + attr_accessor :type + BANK = "BANK".freeze + EMPLOYERSNIC = "EMPLOYERSNIC".freeze + NICLIABILITY = "NICLIABILITY".freeze + PAYEECONTRIBUTION = "PAYEECONTRIBUTION".freeze + PAYELIABILITY = "PAYELIABILITY".freeze + WAGESPAYABLE = "WAGESPAYABLE".freeze + WAGESEXPENSE = "WAGESEXPENSE".freeze + + # A unique 3 digit number for each Account + attr_accessor :code + + # Name of the Account. + attr_accessor :name + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_id' => :'accountID', + :'type' => :'type', + :'code' => :'code', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_id' => :'String', + :'type' => :'String', + :'code' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Account` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["BANK", "EMPLOYERSNIC", "NICLIABILITY", "PAYEECONTRIBUTION", "PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["BANK", "EMPLOYERSNIC", "NICLIABILITY", "PAYEECONTRIBUTION", "PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + type == o.type && + code == o.code && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_id, type, code, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/accounts.rb b/lib/xero-ruby/models/payroll_uk/accounts.rb new file mode 100644 index 00000000..0206e216 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/accounts.rb @@ -0,0 +1,210 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Accounts + + attr_accessor :accounts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'accounts' => :'accounts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'accounts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Accounts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Accounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [accounts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/address.rb b/lib/xero-ruby/models/payroll_uk/address.rb new file mode 100644 index 00000000..fc3adc11 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/address.rb @@ -0,0 +1,263 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Address + # Address line 1 for employee home address + attr_accessor :address_line1 + + # Address line 2 for employee home address + attr_accessor :address_line2 + + # Suburb for employee home address + attr_accessor :city + + # PostCode for employee home address + attr_accessor :post_code + + # Country of HomeAddress + attr_accessor :country_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'address_line1' => :'addressLine1', + :'address_line2' => :'addressLine2', + :'city' => :'city', + :'post_code' => :'postCode', + :'country_name' => :'countryName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'address_line1' => :'String', + :'address_line2' => :'String', + :'city' => :'String', + :'post_code' => :'String', + :'country_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Address` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'address_line1') + self.address_line1 = attributes[:'address_line1'] + end + + if attributes.key?(:'address_line2') + self.address_line2 = attributes[:'address_line2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'post_code') + self.post_code = attributes[:'post_code'] + end + + if attributes.key?(:'country_name') + self.country_name = attributes[:'country_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @address_line1.nil? + invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @post_code.nil? + invalid_properties.push('invalid value for "post_code", post_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @address_line1.nil? + return false if @city.nil? + return false if @post_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address_line1 == o.address_line1 && + address_line2 == o.address_line2 && + city == o.city && + post_code == o.post_code && + country_name == o.country_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [address_line1, address_line2, city, post_code, country_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/bank_account.rb b/lib/xero-ruby/models/payroll_uk/bank_account.rb new file mode 100644 index 00000000..5df99041 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/bank_account.rb @@ -0,0 +1,243 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class BankAccount + # Bank account name (max length = 32) + attr_accessor :account_name + + # Bank account number (digits only; max length = 8) + attr_accessor :account_number + + # Bank account sort code (6 digits) + attr_accessor :sort_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_name' => :'accountName', + :'account_number' => :'accountNumber', + :'sort_code' => :'sortCode' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_name' => :'String', + :'account_number' => :'String', + :'sort_code' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::BankAccount` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::BankAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'sort_code') + self.sort_code = attributes[:'sort_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @account_name.nil? + invalid_properties.push('invalid value for "account_name", account_name cannot be nil.') + end + + if @account_number.nil? + invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') + end + + if @sort_code.nil? + invalid_properties.push('invalid value for "sort_code", sort_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @account_name.nil? + return false if @account_number.nil? + return false if @sort_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_name == o.account_name && + account_number == o.account_number && + sort_code == o.sort_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_name, account_number, sort_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/benefit.rb b/lib/xero-ruby/models/payroll_uk/benefit.rb new file mode 100644 index 00000000..639f4474 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/benefit.rb @@ -0,0 +1,418 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Benefit + # unique identifier in Xero + attr_accessor :id + + # Name of the employer pension + attr_accessor :name + + # Category type of the employer pension + attr_accessor :category + STAKEHOLDER_PENSION = "StakeholderPension".freeze + OTHER = "Other".freeze + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Xero identifier for Expense Account + attr_accessor :expense_account_id + + # Standard amount of the employer pension + attr_accessor :standard_amount + + # Percentage of gross of the employer pension + attr_accessor :percentage + + # Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + attr_accessor :calculation_type + FIXED_AMOUNT = "FixedAmount".freeze + PERCENTAGE_OF_GROSS = "PercentageOfGross".freeze + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Identifier of subject To NIC + attr_accessor :subject_to_nic + + # Identifier of subject To pension + attr_accessor :subject_to_pension + + # Identifier of subject To Tax + attr_accessor :subject_to_tax + + # Identifier of calculating on qualifying earnings + attr_accessor :is_calculating_on_qualifying_earnings + + # display the balance to employee + attr_accessor :show_balance_to_employee + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'category' => :'category', + :'liability_account_id' => :'liabilityAccountId', + :'expense_account_id' => :'expenseAccountId', + :'standard_amount' => :'standardAmount', + :'percentage' => :'percentage', + :'calculation_type' => :'calculationType', + :'current_record' => :'currentRecord', + :'subject_to_nic' => :'subjectToNIC', + :'subject_to_pension' => :'subjectToPension', + :'subject_to_tax' => :'subjectToTax', + :'is_calculating_on_qualifying_earnings' => :'isCalculatingOnQualifyingEarnings', + :'show_balance_to_employee' => :'showBalanceToEmployee' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'category' => :'String', + :'liability_account_id' => :'String', + :'expense_account_id' => :'String', + :'standard_amount' => :'BigDecimal', + :'percentage' => :'BigDecimal', + :'calculation_type' => :'String', + :'current_record' => :'Boolean', + :'subject_to_nic' => :'Boolean', + :'subject_to_pension' => :'Boolean', + :'subject_to_tax' => :'Boolean', + :'is_calculating_on_qualifying_earnings' => :'Boolean', + :'show_balance_to_employee' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Benefit` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Benefit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'expense_account_id') + self.expense_account_id = attributes[:'expense_account_id'] + end + + if attributes.key?(:'standard_amount') + self.standard_amount = attributes[:'standard_amount'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'subject_to_nic') + self.subject_to_nic = attributes[:'subject_to_nic'] + end + + if attributes.key?(:'subject_to_pension') + self.subject_to_pension = attributes[:'subject_to_pension'] + end + + if attributes.key?(:'subject_to_tax') + self.subject_to_tax = attributes[:'subject_to_tax'] + end + + if attributes.key?(:'is_calculating_on_qualifying_earnings') + self.is_calculating_on_qualifying_earnings = attributes[:'is_calculating_on_qualifying_earnings'] + end + + if attributes.key?(:'show_balance_to_employee') + self.show_balance_to_employee = attributes[:'show_balance_to_employee'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @category.nil? + invalid_properties.push('invalid value for "category", category cannot be nil.') + end + + if @liability_account_id.nil? + invalid_properties.push('invalid value for "liability_account_id", liability_account_id cannot be nil.') + end + + if @expense_account_id.nil? + invalid_properties.push('invalid value for "expense_account_id", expense_account_id cannot be nil.') + end + + if @percentage.nil? + invalid_properties.push('invalid value for "percentage", percentage cannot be nil.') + end + + if @calculation_type.nil? + invalid_properties.push('invalid value for "calculation_type", calculation_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @category.nil? + category_validator = EnumAttributeValidator.new('String', ["StakeholderPension", "Other"]) + return false unless category_validator.valid?(@category) + return false if @liability_account_id.nil? + return false if @expense_account_id.nil? + return false if @percentage.nil? + return false if @calculation_type.nil? + calculation_type_validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + return false unless calculation_type_validator.valid?(@calculation_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] category Object to be assigned + def category=(category) + validator = EnumAttributeValidator.new('String', ["StakeholderPension", "Other"]) + unless validator.valid?(category) + fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}." + end + @category = category + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calculation_type Object to be assigned + def calculation_type=(calculation_type) + validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + unless validator.valid?(calculation_type) + fail ArgumentError, "invalid value for \"calculation_type\", must be one of #{validator.allowable_values}." + end + @calculation_type = calculation_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + category == o.category && + liability_account_id == o.liability_account_id && + expense_account_id == o.expense_account_id && + standard_amount == o.standard_amount && + percentage == o.percentage && + calculation_type == o.calculation_type && + current_record == o.current_record && + subject_to_nic == o.subject_to_nic && + subject_to_pension == o.subject_to_pension && + subject_to_tax == o.subject_to_tax && + is_calculating_on_qualifying_earnings == o.is_calculating_on_qualifying_earnings && + show_balance_to_employee == o.show_balance_to_employee + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, category, liability_account_id, expense_account_id, standard_amount, percentage, calculation_type, current_record, subject_to_nic, subject_to_pension, subject_to_tax, is_calculating_on_qualifying_earnings, show_balance_to_employee].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/benefit_line.rb b/lib/xero-ruby/models/payroll_uk/benefit_line.rb new file mode 100644 index 00000000..53584e82 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/benefit_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class BenefitLine + # Xero identifier for payroll benefit type + attr_accessor :benefit_type_id + + # Benefit display name + attr_accessor :display_name + + # The amount of the benefit line. + attr_accessor :amount + + # Benefit fixed amount + attr_accessor :fixed_amount + + # Benefit rate percentage + attr_accessor :percentage + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'benefit_type_id' => :'benefitTypeID', + :'display_name' => :'displayName', + :'amount' => :'amount', + :'fixed_amount' => :'fixedAmount', + :'percentage' => :'percentage' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'benefit_type_id' => :'String', + :'display_name' => :'String', + :'amount' => :'Float', + :'fixed_amount' => :'Float', + :'percentage' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::BenefitLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::BenefitLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'benefit_type_id') + self.benefit_type_id = attributes[:'benefit_type_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + benefit_type_id == o.benefit_type_id && + display_name == o.display_name && + amount == o.amount && + fixed_amount == o.fixed_amount && + percentage == o.percentage + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [benefit_type_id, display_name, amount, fixed_amount, percentage].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/benefit_object.rb b/lib/xero-ruby/models/payroll_uk/benefit_object.rb new file mode 100644 index 00000000..b74e341b --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/benefit_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class BenefitObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :benefit + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'benefit' => :'benefit' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'benefit' => :'Benefit' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::BenefitObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::BenefitObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'benefit') + self.benefit = attributes[:'benefit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + benefit == o.benefit + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, benefit].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/benefits.rb b/lib/xero-ruby/models/payroll_uk/benefits.rb new file mode 100644 index 00000000..d3d1603a --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/benefits.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Benefits + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :benefits + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'benefits' => :'benefits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'benefits' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Benefits` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Benefits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'benefits') + if (value = attributes[:'benefits']).is_a?(Array) + self.benefits = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + benefits == o.benefits + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, benefits].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/court_order_line.rb b/lib/xero-ruby/models/payroll_uk/court_order_line.rb new file mode 100644 index 00000000..b829f9bd --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/court_order_line.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class CourtOrderLine + # Xero identifier for payroll court order type + attr_accessor :court_order_type_id + + # Amount + attr_accessor :amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'court_order_type_id' => :'courtOrderTypeID', + :'amount' => :'amount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'court_order_type_id' => :'String', + :'amount' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::CourtOrderLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::CourtOrderLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'court_order_type_id') + self.court_order_type_id = attributes[:'court_order_type_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + court_order_type_id == o.court_order_type_id && + amount == o.amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [court_order_type_id, amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/deduction.rb b/lib/xero-ruby/models/payroll_uk/deduction.rb new file mode 100644 index 00000000..b6f2aed2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/deduction.rb @@ -0,0 +1,426 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Deduction + # The Xero identifier for Deduction + attr_accessor :deduction_id + + # Name of the deduction + attr_accessor :deduction_name + + # Deduction Category type + attr_accessor :deduction_category + CAPITAL_CONTRIBUTIONS = "CapitalContributions".freeze + CHILD_CARE_VOUCHER = "ChildCareVoucher".freeze + MAKING_GOOD = "MakingGood".freeze + POSTGRADUATE_LOAN_DEDUCTIONS = "PostgraduateLoanDeductions".freeze + PRIVATE_USE_PAYMENTS = "PrivateUsePayments".freeze + SALARY_SACRIFICE = "SalarySacrifice".freeze + STAKEHOLDER_PENSION = "StakeholderPension".freeze + STAKEHOLDER_PENSION_POST_TAX = "StakeholderPensionPostTax".freeze + STUDENT_LOAN_DEDUCTIONS = "StudentLoanDeductions".freeze + UK_OTHER = "UkOther".freeze + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Standard amount of the deduction + attr_accessor :standard_amount + + # Identifier of reduces super liability + attr_accessor :reduces_super_liability + + # Identifier of reduces tax liability + attr_accessor :reduces_tax_liability + + # determine the calculation type whether fixed amount or percentage of gross + attr_accessor :calculation_type + FIXED_AMOUNT = "FixedAmount".freeze + PERCENTAGE_OF_GROSS = "PercentageOfGross".freeze + + # Percentage of gross + attr_accessor :percentage + + # Identifier of subject To NIC + attr_accessor :subject_to_nic + + # Identifier of subject To Tax + attr_accessor :subject_to_tax + + # Identifier of reduced by basic rate applicable or not + attr_accessor :is_reduced_by_basic_rate + + # Identifier for apply to pension calculations + attr_accessor :apply_to_pension_calculations + + # Identifier of calculating on qualifying earnings + attr_accessor :is_calculating_on_qualifying_earnings + + # Identifier of applicable for pension or not + attr_accessor :is_pension + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deduction_id' => :'deductionId', + :'deduction_name' => :'deductionName', + :'deduction_category' => :'deductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord', + :'standard_amount' => :'standardAmount', + :'reduces_super_liability' => :'reducesSuperLiability', + :'reduces_tax_liability' => :'reducesTaxLiability', + :'calculation_type' => :'calculationType', + :'percentage' => :'percentage', + :'subject_to_nic' => :'subjectToNIC', + :'subject_to_tax' => :'subjectToTax', + :'is_reduced_by_basic_rate' => :'isReducedByBasicRate', + :'apply_to_pension_calculations' => :'applyToPensionCalculations', + :'is_calculating_on_qualifying_earnings' => :'isCalculatingOnQualifyingEarnings', + :'is_pension' => :'isPension' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'deduction_id' => :'String', + :'deduction_name' => :'String', + :'deduction_category' => :'String', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean', + :'standard_amount' => :'BigDecimal', + :'reduces_super_liability' => :'Boolean', + :'reduces_tax_liability' => :'Boolean', + :'calculation_type' => :'String', + :'percentage' => :'BigDecimal', + :'subject_to_nic' => :'Boolean', + :'subject_to_tax' => :'Boolean', + :'is_reduced_by_basic_rate' => :'Boolean', + :'apply_to_pension_calculations' => :'Boolean', + :'is_calculating_on_qualifying_earnings' => :'Boolean', + :'is_pension' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Deduction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Deduction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deduction_id') + self.deduction_id = attributes[:'deduction_id'] + end + + if attributes.key?(:'deduction_name') + self.deduction_name = attributes[:'deduction_name'] + end + + if attributes.key?(:'deduction_category') + self.deduction_category = attributes[:'deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'standard_amount') + self.standard_amount = attributes[:'standard_amount'] + end + + if attributes.key?(:'reduces_super_liability') + self.reduces_super_liability = attributes[:'reduces_super_liability'] + end + + if attributes.key?(:'reduces_tax_liability') + self.reduces_tax_liability = attributes[:'reduces_tax_liability'] + end + + if attributes.key?(:'calculation_type') + self.calculation_type = attributes[:'calculation_type'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'subject_to_nic') + self.subject_to_nic = attributes[:'subject_to_nic'] + end + + if attributes.key?(:'subject_to_tax') + self.subject_to_tax = attributes[:'subject_to_tax'] + end + + if attributes.key?(:'is_reduced_by_basic_rate') + self.is_reduced_by_basic_rate = attributes[:'is_reduced_by_basic_rate'] + end + + if attributes.key?(:'apply_to_pension_calculations') + self.apply_to_pension_calculations = attributes[:'apply_to_pension_calculations'] + end + + if attributes.key?(:'is_calculating_on_qualifying_earnings') + self.is_calculating_on_qualifying_earnings = attributes[:'is_calculating_on_qualifying_earnings'] + end + + if attributes.key?(:'is_pension') + self.is_pension = attributes[:'is_pension'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @deduction_name.nil? + invalid_properties.push('invalid value for "deduction_name", deduction_name cannot be nil.') + end + + if @liability_account_id.nil? + invalid_properties.push('invalid value for "liability_account_id", liability_account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @deduction_name.nil? + deduction_category_validator = EnumAttributeValidator.new('String', ["CapitalContributions", "ChildCareVoucher", "MakingGood", "PostgraduateLoanDeductions", "PrivateUsePayments", "SalarySacrifice", "StakeholderPension", "StakeholderPensionPostTax", "StudentLoanDeductions", "UkOther"]) + return false unless deduction_category_validator.valid?(@deduction_category) + return false if @liability_account_id.nil? + calculation_type_validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + return false unless calculation_type_validator.valid?(@calculation_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deduction_category Object to be assigned + def deduction_category=(deduction_category) + validator = EnumAttributeValidator.new('String', ["CapitalContributions", "ChildCareVoucher", "MakingGood", "PostgraduateLoanDeductions", "PrivateUsePayments", "SalarySacrifice", "StakeholderPension", "StakeholderPensionPostTax", "StudentLoanDeductions", "UkOther"]) + unless validator.valid?(deduction_category) + fail ArgumentError, "invalid value for \"deduction_category\", must be one of #{validator.allowable_values}." + end + @deduction_category = deduction_category + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calculation_type Object to be assigned + def calculation_type=(calculation_type) + validator = EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + unless validator.valid?(calculation_type) + fail ArgumentError, "invalid value for \"calculation_type\", must be one of #{validator.allowable_values}." + end + @calculation_type = calculation_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deduction_id == o.deduction_id && + deduction_name == o.deduction_name && + deduction_category == o.deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record && + standard_amount == o.standard_amount && + reduces_super_liability == o.reduces_super_liability && + reduces_tax_liability == o.reduces_tax_liability && + calculation_type == o.calculation_type && + percentage == o.percentage && + subject_to_nic == o.subject_to_nic && + subject_to_tax == o.subject_to_tax && + is_reduced_by_basic_rate == o.is_reduced_by_basic_rate && + apply_to_pension_calculations == o.apply_to_pension_calculations && + is_calculating_on_qualifying_earnings == o.is_calculating_on_qualifying_earnings && + is_pension == o.is_pension + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deduction_id, deduction_name, deduction_category, liability_account_id, current_record, standard_amount, reduces_super_liability, reduces_tax_liability, calculation_type, percentage, subject_to_nic, subject_to_tax, is_reduced_by_basic_rate, apply_to_pension_calculations, is_calculating_on_qualifying_earnings, is_pension].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/deduction_line.rb b/lib/xero-ruby/models/payroll_uk/deduction_line.rb new file mode 100644 index 00000000..7f6891f5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/deduction_line.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class DeductionLine + # Xero identifier for payroll deduction + attr_accessor :deduction_type_id + + # The amount of the deduction line + attr_accessor :amount + + # Identifies if the deduction is subject to tax + attr_accessor :subject_to_tax + + # Deduction rate percentage + attr_accessor :percentage + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deduction_type_id' => :'deductionTypeID', + :'amount' => :'amount', + :'subject_to_tax' => :'subjectToTax', + :'percentage' => :'percentage' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'deduction_type_id' => :'String', + :'amount' => :'Float', + :'subject_to_tax' => :'Boolean', + :'percentage' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::DeductionLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::DeductionLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deduction_type_id') + self.deduction_type_id = attributes[:'deduction_type_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'subject_to_tax') + self.subject_to_tax = attributes[:'subject_to_tax'] + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deduction_type_id == o.deduction_type_id && + amount == o.amount && + subject_to_tax == o.subject_to_tax && + percentage == o.percentage + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deduction_type_id, amount, subject_to_tax, percentage].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/deduction_object.rb b/lib/xero-ruby/models/payroll_uk/deduction_object.rb new file mode 100644 index 00000000..15a7e1f6 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/deduction_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class DeductionObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :deduction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'deduction' => :'deduction' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'deduction' => :'Deduction' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::DeductionObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::DeductionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'deduction') + self.deduction = attributes[:'deduction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + deduction == o.deduction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, deduction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/deductions.rb b/lib/xero-ruby/models/payroll_uk/deductions.rb new file mode 100644 index 00000000..6ac9c0b1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/deductions.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Deductions + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :deductions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'deductions' => :'deductions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'deductions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Deductions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Deductions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'deductions') + if (value = attributes[:'deductions']).is_a?(Array) + self.deductions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + deductions == o.deductions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, deductions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_line.rb b/lib/xero-ruby/models/payroll_uk/earnings_line.rb new file mode 100644 index 00000000..69c22bc5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_line.rb @@ -0,0 +1,288 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsLine + # Xero identifier for payroll earnings line + attr_accessor :earnings_line_id + + # Xero identifier for payroll earnings rate + attr_accessor :earnings_rate_id + + # name of earnings rate for display in UI + attr_accessor :display_name + + # Rate per unit for earnings line + attr_accessor :rate_per_unit + + # Earnings number of units + attr_accessor :number_of_units + + # Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the earnings line. + attr_accessor :amount + + # Identifies if the earnings is taken from the timesheet. False for earnings line + attr_accessor :is_linked_to_timesheet + + # Identifies if the earnings is using an average daily pay rate + attr_accessor :is_average_daily_pay_rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_line_id' => :'earningsLineID', + :'earnings_rate_id' => :'earningsRateID', + :'display_name' => :'displayName', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet', + :'is_average_daily_pay_rate' => :'isAverageDailyPayRate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_line_id' => :'String', + :'earnings_rate_id' => :'String', + :'display_name' => :'String', + :'rate_per_unit' => :'Float', + :'number_of_units' => :'Float', + :'fixed_amount' => :'Float', + :'amount' => :'Float', + :'is_linked_to_timesheet' => :'Boolean', + :'is_average_daily_pay_rate' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_line_id') + self.earnings_line_id = attributes[:'earnings_line_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + + if attributes.key?(:'is_average_daily_pay_rate') + self.is_average_daily_pay_rate = attributes[:'is_average_daily_pay_rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_line_id == o.earnings_line_id && + earnings_rate_id == o.earnings_rate_id && + display_name == o.display_name && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet && + is_average_daily_pay_rate == o.is_average_daily_pay_rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_line_id, earnings_rate_id, display_name, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet, is_average_daily_pay_rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_order.rb b/lib/xero-ruby/models/payroll_uk/earnings_order.rb new file mode 100644 index 00000000..4503a73a --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_order.rb @@ -0,0 +1,255 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsOrder + # Xero unique identifier for an earning rate + attr_accessor :id + + # Name of the earning order + attr_accessor :name + + + attr_accessor :statutory_deduction_category + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'statutory_deduction_category' => :'statutoryDeductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'statutory_deduction_category' => :'StatutoryDeductionCategory', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsOrder` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'statutory_deduction_category') + self.statutory_deduction_category = attributes[:'statutory_deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + else + self.current_record = true + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + statutory_deduction_category == o.statutory_deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, statutory_deduction_category, liability_account_id, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb new file mode 100644 index 00000000..a6e38e23 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsOrderObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deduction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deduction' => :'statutoryDeduction' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deduction' => :'EarningsOrder' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsOrderObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsOrderObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deduction') + self.statutory_deduction = attributes[:'statutory_deduction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deduction == o.statutory_deduction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deduction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_orders.rb b/lib/xero-ruby/models/payroll_uk/earnings_orders.rb new file mode 100644 index 00000000..ab4f138e --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_orders.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsOrders + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_deductions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_deductions' => :'statutoryDeductions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_deductions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsOrders` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsOrders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_deductions') + if (value = attributes[:'statutory_deductions']).is_a?(Array) + self.statutory_deductions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_deductions == o.statutory_deductions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_deductions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rate.rb b/lib/xero-ruby/models/payroll_uk/earnings_rate.rb new file mode 100644 index 00000000..7f4b1e40 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_rate.rb @@ -0,0 +1,387 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsRate + # Xero unique identifier for an earning rate + attr_accessor :earnings_rate_id + + # Name of the earning rate + attr_accessor :name + + # Indicates how an employee will be paid when taking this type of earning + attr_accessor :earnings_type + ALLOWANCE = "Allowance".freeze + BACKPAY = "Backpay".freeze + BONUS = "Bonus".freeze + COMMISSION = "Commission".freeze + LUMP_SUM = "LumpSum".freeze + OTHER_EARNINGS = "OtherEarnings".freeze + OVERTIME_EARNINGS = "OvertimeEarnings".freeze + REGULAR_EARNINGS = "RegularEarnings".freeze + STATUTORY_ADOPTION_PAY = "StatutoryAdoptionPay".freeze + STATUTORY_MATERNITY_PAY = "StatutoryMaternityPay".freeze + STATUTORY_PATERNITY_PAY = "StatutoryPaternityPay".freeze + STATUTORY_SHARED_PARENTAL_PAY = "StatutorySharedParentalPay".freeze + STATUTORY_SICK_PAY = "StatutorySickPay".freeze + TIPS_DIRECT = "Tips(Direct)".freeze + TIPS_NON_DIRECT = "Tips(Non-Direct)".freeze + + # Indicates the type of the earning rate + attr_accessor :rate_type + RATE_PER_UNIT = "RatePerUnit".freeze + MULTIPLE_OF_ORDINARY_EARNINGS_RATE = "MultipleOfOrdinaryEarningsRate".freeze + FIXED_AMOUNT = "FixedAmount".freeze + + # The type of units used to record earnings + attr_accessor :type_of_units + + # Indicates whether an earning type is active + attr_accessor :current_record + + # The account that will be used for the earnings rate + attr_accessor :expense_account_id + + # Default rate per unit (optional). Only applicable if RateType is RatePerUnit + attr_accessor :rate_per_unit + + # This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + attr_accessor :multiple_of_ordinary_earnings_rate + + # Optional Fixed Rate Amount. Applicable for FixedAmount Rate + attr_accessor :fixed_amount + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'earningsRateID', + :'name' => :'name', + :'earnings_type' => :'earningsType', + :'rate_type' => :'rateType', + :'type_of_units' => :'typeOfUnits', + :'current_record' => :'currentRecord', + :'expense_account_id' => :'expenseAccountID', + :'rate_per_unit' => :'ratePerUnit', + :'multiple_of_ordinary_earnings_rate' => :'multipleOfOrdinaryEarningsRate', + :'fixed_amount' => :'fixedAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'name' => :'String', + :'earnings_type' => :'String', + :'rate_type' => :'String', + :'type_of_units' => :'String', + :'current_record' => :'Boolean', + :'expense_account_id' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'multiple_of_ordinary_earnings_rate' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsRate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'earnings_type') + self.earnings_type = attributes[:'earnings_type'] + end + + if attributes.key?(:'rate_type') + self.rate_type = attributes[:'rate_type'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + + if attributes.key?(:'expense_account_id') + self.expense_account_id = attributes[:'expense_account_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'multiple_of_ordinary_earnings_rate') + self.multiple_of_ordinary_earnings_rate = attributes[:'multiple_of_ordinary_earnings_rate'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @earnings_type.nil? + invalid_properties.push('invalid value for "earnings_type", earnings_type cannot be nil.') + end + + if @rate_type.nil? + invalid_properties.push('invalid value for "rate_type", rate_type cannot be nil.') + end + + if @type_of_units.nil? + invalid_properties.push('invalid value for "type_of_units", type_of_units cannot be nil.') + end + + if @expense_account_id.nil? + invalid_properties.push('invalid value for "expense_account_id", expense_account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @earnings_type.nil? + earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"]) + return false unless earnings_type_validator.valid?(@earnings_type) + return false if @rate_type.nil? + rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + return false unless rate_type_validator.valid?(@rate_type) + return false if @type_of_units.nil? + return false if @expense_account_id.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] earnings_type Object to be assigned + def earnings_type=(earnings_type) + validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"]) + unless validator.valid?(earnings_type) + fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}." + end + @earnings_type = earnings_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] rate_type Object to be assigned + def rate_type=(rate_type) + validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + unless validator.valid?(rate_type) + fail ArgumentError, "invalid value for \"rate_type\", must be one of #{validator.allowable_values}." + end + @rate_type = rate_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + name == o.name && + earnings_type == o.earnings_type && + rate_type == o.rate_type && + type_of_units == o.type_of_units && + current_record == o.current_record && + expense_account_id == o.expense_account_id && + rate_per_unit == o.rate_per_unit && + multiple_of_ordinary_earnings_rate == o.multiple_of_ordinary_earnings_rate && + fixed_amount == o.fixed_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, name, earnings_type, rate_type, type_of_units, current_record, expense_account_id, rate_per_unit, multiple_of_ordinary_earnings_rate, fixed_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb new file mode 100644 index 00000000..5dde290e --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsRateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earnings_rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earnings_rate' => :'earningsRate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earnings_rate' => :'EarningsRate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsRateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsRateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earnings_rate') + self.earnings_rate = attributes[:'earnings_rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earnings_rate == o.earnings_rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earnings_rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rates.rb b/lib/xero-ruby/models/payroll_uk/earnings_rates.rb new file mode 100644 index 00000000..269edc1f --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_rates.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsRates + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earnings_rates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earnings_rates' => :'earningsRates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earnings_rates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsRates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsRates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earnings_rates') + if (value = attributes[:'earnings_rates']).is_a?(Array) + self.earnings_rates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earnings_rates == o.earnings_rates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earnings_rates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_template.rb b/lib/xero-ruby/models/payroll_uk/earnings_template.rb new file mode 100644 index 00000000..d7b87c12 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_template.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsTemplate + # The Xero identifier for the earnings template + attr_accessor :pay_template_earning_id + + # The rate per unit + attr_accessor :rate_per_unit + + # The rate per unit + attr_accessor :number_of_units + + # The fixed amount per period + attr_accessor :fixed_amount + + # The corresponding earnings rate identifier + attr_accessor :earnings_rate_id + + # The read-only name of the Earning Template. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_template_earning_id' => :'payTemplateEarningID', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'earnings_rate_id' => :'earningsRateID', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_template_earning_id' => :'String', + :'rate_per_unit' => :'BigDecimal', + :'number_of_units' => :'BigDecimal', + :'fixed_amount' => :'BigDecimal', + :'earnings_rate_id' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_template_earning_id') + self.pay_template_earning_id = attributes[:'pay_template_earning_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_template_earning_id == o.pay_template_earning_id && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + earnings_rate_id == o.earnings_rate_id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_template_earning_id, rate_per_unit, number_of_units, fixed_amount, earnings_rate_id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb new file mode 100644 index 00000000..f9fd8323 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EarningsTemplateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earning_template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earning_template' => :'earningTemplate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earning_template' => :'EarningsTemplate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EarningsTemplateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EarningsTemplateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earning_template') + self.earning_template = attributes[:'earning_template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earning_template == o.earning_template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earning_template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee.rb b/lib/xero-ruby/models/payroll_uk/employee.rb new file mode 100644 index 00000000..9dc67dbf --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee.rb @@ -0,0 +1,384 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Employee + # Xero unique identifier for the employee + attr_accessor :employee_id + + # Title of the employee + attr_accessor :title + + # First name of employee + attr_accessor :first_name + + # Last name of employee + attr_accessor :last_name + + # Date of birth of the employee (YYYY-MM-DD) + attr_accessor :date_of_birth + + + attr_accessor :address + + # The email address for the employee + attr_accessor :email + + # The employee’s gender + attr_accessor :gender + M = "M".freeze + F = "F".freeze + + # Employee phone number + attr_accessor :phone_number + + # Employment start date of the employee at the time it was requested + attr_accessor :start_date + + # Employment end date of the employee at the time it was requested + attr_accessor :end_date + + # Xero unique identifier for the payroll calendar of the employee + attr_accessor :payroll_calendar_id + + # UTC timestamp of last update to the employee + attr_accessor :updated_date_utc + + # UTC timestamp when the employee was created in Xero + attr_accessor :created_date_utc + + # National insurance number of the employee + attr_accessor :national_insurance_number + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'employeeID', + :'title' => :'title', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'date_of_birth' => :'dateOfBirth', + :'address' => :'address', + :'email' => :'email', + :'gender' => :'gender', + :'phone_number' => :'phoneNumber', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'payroll_calendar_id' => :'payrollCalendarID', + :'updated_date_utc' => :'updatedDateUTC', + :'created_date_utc' => :'createdDateUTC', + :'national_insurance_number' => :'nationalInsuranceNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'title' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'date_of_birth' => :'Date', + :'address' => :'Address', + :'email' => :'String', + :'gender' => :'String', + :'phone_number' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'payroll_calendar_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'created_date_utc' => :'DateTime', + :'national_insurance_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Employee` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'date_of_birth') + self.date_of_birth = attributes[:'date_of_birth'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'gender') + self.gender = attributes[:'gender'] + end + + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + + if attributes.key?(:'national_insurance_number') + self.national_insurance_number = attributes[:'national_insurance_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + gender_validator = EnumAttributeValidator.new('String', ["M", "F"]) + return false unless gender_validator.valid?(@gender) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] gender Object to be assigned + def gender=(gender) + validator = EnumAttributeValidator.new('String', ["M", "F"]) + unless validator.valid?(gender) + fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}." + end + @gender = gender + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + title == o.title && + first_name == o.first_name && + last_name == o.last_name && + date_of_birth == o.date_of_birth && + address == o.address && + email == o.email && + gender == o.gender && + phone_number == o.phone_number && + start_date == o.start_date && + end_date == o.end_date && + payroll_calendar_id == o.payroll_calendar_id && + updated_date_utc == o.updated_date_utc && + created_date_utc == o.created_date_utc && + national_insurance_number == o.national_insurance_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc, national_insurance_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave.rb b/lib/xero-ruby/models/payroll_uk/employee_leave.rb new file mode 100644 index 00000000..8ea6e481 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave.rb @@ -0,0 +1,290 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeave + # The Xero identifier for LeaveType + attr_accessor :leave_id + + # The Xero identifier for LeaveType + attr_accessor :leave_type_id + + # The description of the leave (max length = 50) + attr_accessor :description + + # Start date of the leave (YYYY-MM-DD) + attr_accessor :start_date + + # End date of the leave (YYYY-MM-DD) + attr_accessor :end_date + + # The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + attr_accessor :periods + + # UTC timestamp of last update to the leave type note + attr_accessor :updated_date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_id' => :'leaveID', + :'leave_type_id' => :'leaveTypeID', + :'description' => :'description', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'periods' => :'periods', + :'updated_date_utc' => :'updatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_id' => :'String', + :'leave_type_id' => :'String', + :'description' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'periods' => :'Array', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeave` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeave`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_id') + self.leave_id = attributes[:'leave_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'periods') + if (value = attributes[:'periods']).is_a?(Array) + self.periods = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @leave_type_id.nil? + invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @leave_type_id.nil? + return false if @description.nil? + return false if @start_date.nil? + return false if @end_date.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_id == o.leave_id && + leave_type_id == o.leave_type_id && + description == o.description && + start_date == o.start_date && + end_date == o.end_date && + periods == o.periods && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_id, leave_type_id, description, start_date, end_date, periods, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb new file mode 100644 index 00000000..b19edd3c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveBalance + # Name of the leave type. + attr_accessor :name + + # The Xero identifier for leave type + attr_accessor :leave_type_id + + # The employees current balance for the corresponding leave type. + attr_accessor :balance + + # The type of the units of the leave. + attr_accessor :type_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'leave_type_id' => :'leaveTypeID', + :'balance' => :'balance', + :'type_of_units' => :'typeOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'leave_type_id' => :'String', + :'balance' => :'Float', + :'type_of_units' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'balance') + self.balance = attributes[:'balance'] + end + + if attributes.key?(:'type_of_units') + self.type_of_units = attributes[:'type_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + leave_type_id == o.leave_type_id && + balance == o.balance && + type_of_units == o.type_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, leave_type_id, balance, type_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb new file mode 100644 index 00000000..df3fb4ef --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveBalances + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_balances + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_balances' => :'leaveBalances' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_balances' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveBalances` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_balances') + if (value = attributes[:'leave_balances']).is_a?(Array) + self.leave_balances = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_balances == o.leave_balances + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_balances].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb new file mode 100644 index 00000000..71987cda --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave' => :'leave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave' => :'EmployeeLeave' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave') + self.leave = attributes[:'leave'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave == o.leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb new file mode 100644 index 00000000..fec7e88c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb @@ -0,0 +1,306 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveType + # The Xero identifier for leave type + attr_accessor :leave_type_id + + # The schedule of accrual + attr_accessor :schedule_of_accrual + BEGINNING_OF_CALENDAR_YEAR = "BeginningOfCalendarYear".freeze + ON_ANNIVERSARY_DATE = "OnAnniversaryDate".freeze + EACH_PAY_PERIOD = "EachPayPeriod".freeze + ON_HOUR_WORKED = "OnHourWorked".freeze + + # The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" + attr_accessor :hours_accrued_annually + + # The maximum number of hours that can be accrued for the leave + attr_accessor :maximum_to_accrue + + # The initial number of hours assigned when the leave was added to the employee + attr_accessor :opening_balance + + # The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + attr_accessor :rate_accrued_hourly + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'leaveTypeID', + :'schedule_of_accrual' => :'scheduleOfAccrual', + :'hours_accrued_annually' => :'hoursAccruedAnnually', + :'maximum_to_accrue' => :'maximumToAccrue', + :'opening_balance' => :'openingBalance', + :'rate_accrued_hourly' => :'rateAccruedHourly' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'schedule_of_accrual' => :'String', + :'hours_accrued_annually' => :'Float', + :'maximum_to_accrue' => :'Float', + :'opening_balance' => :'Float', + :'rate_accrued_hourly' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'schedule_of_accrual') + self.schedule_of_accrual = attributes[:'schedule_of_accrual'] + end + + if attributes.key?(:'hours_accrued_annually') + self.hours_accrued_annually = attributes[:'hours_accrued_annually'] + end + + if attributes.key?(:'maximum_to_accrue') + self.maximum_to_accrue = attributes[:'maximum_to_accrue'] + end + + if attributes.key?(:'opening_balance') + self.opening_balance = attributes[:'opening_balance'] + end + + if attributes.key?(:'rate_accrued_hourly') + self.rate_accrued_hourly = attributes[:'rate_accrued_hourly'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @leave_type_id.nil? + invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.') + end + + if @schedule_of_accrual.nil? + invalid_properties.push('invalid value for "schedule_of_accrual", schedule_of_accrual cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @leave_type_id.nil? + return false if @schedule_of_accrual.nil? + schedule_of_accrual_validator = EnumAttributeValidator.new('String', ["BeginningOfCalendarYear", "OnAnniversaryDate", "EachPayPeriod", "OnHourWorked"]) + return false unless schedule_of_accrual_validator.valid?(@schedule_of_accrual) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] schedule_of_accrual Object to be assigned + def schedule_of_accrual=(schedule_of_accrual) + validator = EnumAttributeValidator.new('String', ["BeginningOfCalendarYear", "OnAnniversaryDate", "EachPayPeriod", "OnHourWorked"]) + unless validator.valid?(schedule_of_accrual) + fail ArgumentError, "invalid value for \"schedule_of_accrual\", must be one of #{validator.allowable_values}." + end + @schedule_of_accrual = schedule_of_accrual + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + schedule_of_accrual == o.schedule_of_accrual && + hours_accrued_annually == o.hours_accrued_annually && + maximum_to_accrue == o.maximum_to_accrue && + opening_balance == o.opening_balance && + rate_accrued_hourly == o.rate_accrued_hourly + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, schedule_of_accrual, hours_accrued_annually, maximum_to_accrue, opening_balance, rate_accrued_hourly].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb new file mode 100644 index 00000000..3833cded --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveTypeObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_type' => :'leaveType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_type' => :'EmployeeLeaveType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveTypeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveTypeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_type == o.leave_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb new file mode 100644 index 00000000..f043dcfe --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaveTypes + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_types + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_types' => :'leaveTypes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_types' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaveTypes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaveTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_types') + if (value = attributes[:'leave_types']).is_a?(Array) + self.leave_types = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_types == o.leave_types + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_types].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_leaves.rb b/lib/xero-ruby/models/payroll_uk/employee_leaves.rb new file mode 100644 index 00000000..0ed699f3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_leaves.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeLeaves + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave' => :'leave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeLeaves` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeLeaves`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave') + if (value = attributes[:'leave']).is_a?(Array) + self.leave = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave == o.leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_object.rb b/lib/xero-ruby/models/payroll_uk/employee_object.rb new file mode 100644 index 00000000..59be2d1e --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeObject + + attr_accessor :pagination + + + attr_accessor :employee + + + attr_accessor :problem + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'employee' => :'employee', + :'problem' => :'problem' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'employee' => :'Employee', + :'problem' => :'Problem' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'employee') + self.employee = attributes[:'employee'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + employee == o.employee && + problem == o.problem + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, employee, problem].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb b/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb new file mode 100644 index 00000000..a92e5918 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeOpeningBalances + # The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + attr_accessor :statutory_adoption_pay + + # The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + attr_accessor :statutory_maternity_pay + + # The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + attr_accessor :statutory_paternity_pay + + # The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + attr_accessor :statutory_shared_parental_pay + + # The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + attr_accessor :statutory_sick_pay + + # The unique employee number issued by the employee's former employer + attr_accessor :prior_employee_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_adoption_pay' => :'statutoryAdoptionPay', + :'statutory_maternity_pay' => :'statutoryMaternityPay', + :'statutory_paternity_pay' => :'statutoryPaternityPay', + :'statutory_shared_parental_pay' => :'statutorySharedParentalPay', + :'statutory_sick_pay' => :'statutorySickPay', + :'prior_employee_number' => :'priorEmployeeNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_adoption_pay' => :'BigDecimal', + :'statutory_maternity_pay' => :'BigDecimal', + :'statutory_paternity_pay' => :'BigDecimal', + :'statutory_shared_parental_pay' => :'BigDecimal', + :'statutory_sick_pay' => :'BigDecimal', + :'prior_employee_number' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeOpeningBalances` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeOpeningBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_adoption_pay') + self.statutory_adoption_pay = attributes[:'statutory_adoption_pay'] + end + + if attributes.key?(:'statutory_maternity_pay') + self.statutory_maternity_pay = attributes[:'statutory_maternity_pay'] + end + + if attributes.key?(:'statutory_paternity_pay') + self.statutory_paternity_pay = attributes[:'statutory_paternity_pay'] + end + + if attributes.key?(:'statutory_shared_parental_pay') + self.statutory_shared_parental_pay = attributes[:'statutory_shared_parental_pay'] + end + + if attributes.key?(:'statutory_sick_pay') + self.statutory_sick_pay = attributes[:'statutory_sick_pay'] + end + + if attributes.key?(:'prior_employee_number') + self.prior_employee_number = attributes[:'prior_employee_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_adoption_pay == o.statutory_adoption_pay && + statutory_maternity_pay == o.statutory_maternity_pay && + statutory_paternity_pay == o.statutory_paternity_pay && + statutory_shared_parental_pay == o.statutory_shared_parental_pay && + statutory_sick_pay == o.statutory_sick_pay && + prior_employee_number == o.prior_employee_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_adoption_pay, statutory_maternity_pay, statutory_paternity_pay, statutory_shared_parental_pay, statutory_sick_pay, prior_employee_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb b/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb new file mode 100644 index 00000000..9b0c4212 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeOpeningBalancesObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :opening_balances + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'opening_balances' => :'openingBalances' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'opening_balances' => :'EmployeeOpeningBalances' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeOpeningBalancesObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeOpeningBalancesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'opening_balances') + self.opening_balances = attributes[:'opening_balances'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + opening_balances == o.opening_balances + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, opening_balances].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb new file mode 100644 index 00000000..2cf164a7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb @@ -0,0 +1,220 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeePayTemplate + # Unique identifier for the employee + attr_accessor :employee_id + + + attr_accessor :earning_templates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'employeeID', + :'earning_templates' => :'earningTemplates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'earning_templates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeePayTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeePayTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'earning_templates') + if (value = attributes[:'earning_templates']).is_a?(Array) + self.earning_templates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + earning_templates == o.earning_templates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, earning_templates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb new file mode 100644 index 00000000..4c38be1c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeePayTemplateObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_template + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_template' => :'payTemplate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_template' => :'EmployeePayTemplate' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeePayTemplateObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeePayTemplateObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_template') + self.pay_template = attributes[:'pay_template'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_template == o.pay_template + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb new file mode 100644 index 00000000..3873b83d --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeePayTemplates + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :earning_templates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'earning_templates' => :'earningTemplates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'earning_templates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeePayTemplates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeePayTemplates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'earning_templates') + if (value = attributes[:'earning_templates']).is_a?(Array) + self.earning_templates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + earning_templates == o.earning_templates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, earning_templates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb new file mode 100644 index 00000000..7c4a6500 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb @@ -0,0 +1,280 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutoryLeaveBalance + # The type of statutory leave + attr_accessor :leave_type + SICK = "Sick".freeze + ADOPTION = "Adoption".freeze + MATERNITY = "Maternity".freeze + PATERNITY = "Paternity".freeze + SHAREDPARENTAL = "Sharedparental".freeze + + # The balance remaining for the corresponding leave type as of specified date. + attr_accessor :balance_remaining + + # The units will be \"Hours\" + attr_accessor :units + HOURS = "Hours".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type' => :'leaveType', + :'balance_remaining' => :'balanceRemaining', + :'units' => :'units' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type' => :'String', + :'balance_remaining' => :'Float', + :'units' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + + if attributes.key?(:'balance_remaining') + self.balance_remaining = attributes[:'balance_remaining'] + end + + if attributes.key?(:'units') + self.units = attributes[:'units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + return false unless leave_type_validator.valid?(@leave_type) + units_validator = EnumAttributeValidator.new('String', ["Hours"]) + return false unless units_validator.valid?(@units) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] leave_type Object to be assigned + def leave_type=(leave_type) + validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + unless validator.valid?(leave_type) + fail ArgumentError, "invalid value for \"leave_type\", must be one of #{validator.allowable_values}." + end + @leave_type = leave_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] units Object to be assigned + def units=(units) + validator = EnumAttributeValidator.new('String', ["Hours"]) + unless validator.valid?(units) + fail ArgumentError, "invalid value for \"units\", must be one of #{validator.allowable_values}." + end + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type == o.leave_type && + balance_remaining == o.balance_remaining && + units == o.units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type, balance_remaining, units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb new file mode 100644 index 00000000..c3f2200d --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutoryLeaveBalanceObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_balance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_balance' => :'leaveBalance' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_balance' => :'EmployeeStatutoryLeaveBalance' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_balance') + self.leave_balance = attributes[:'leave_balance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_balance == o.leave_balance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_balance].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb new file mode 100644 index 00000000..8606d8bf --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb @@ -0,0 +1,322 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutoryLeaveSummary + # The unique identifier (guid) of a statutory leave. + attr_accessor :statutory_leave_id + + # The unique identifier (guid) of the employee + attr_accessor :employee_id + + # The category of statutory leave + attr_accessor :type + SICK = "Sick".freeze + ADOPTION = "Adoption".freeze + MATERNITY = "Maternity".freeze + PATERNITY = "Paternity".freeze + SHAREDPARENTAL = "Sharedparental".freeze + + # The date when the leave starts + attr_accessor :start_date + + # The date when the leave ends + attr_accessor :end_date + + # Whether the leave was entitled to receive payment + attr_accessor :is_entitled + + # The status of the leave + attr_accessor :status + PENDING = "Pending".freeze + IN_PROGRESS = "In-Progress".freeze + COMPLETED = "Completed".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_leave_id' => :'statutoryLeaveID', + :'employee_id' => :'employeeID', + :'type' => :'type', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'is_entitled' => :'isEntitled', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_leave_id' => :'String', + :'employee_id' => :'String', + :'type' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'is_entitled' => :'Boolean', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_leave_id') + self.statutory_leave_id = attributes[:'statutory_leave_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'is_entitled') + self.is_entitled = attributes[:'is_entitled'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_leave_id == o.statutory_leave_id && + employee_id == o.employee_id && + type == o.type && + start_date == o.start_date && + end_date == o.end_date && + is_entitled == o.is_entitled && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_leave_id, employee_id, type, start_date, end_date, is_entitled, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb new file mode 100644 index 00000000..50ea0aa0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutoryLeavesSummaries + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_leaves + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_leaves' => :'statutoryLeaves' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_leaves' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_leaves') + if (value = attributes[:'statutory_leaves']).is_a?(Array) + self.statutory_leaves = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_leaves == o.statutory_leaves + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_leaves].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb new file mode 100644 index 00000000..86bb0f53 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb @@ -0,0 +1,419 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutorySickLeave + # The unique identifier (guid) of a statutory leave + attr_accessor :statutory_leave_id + + # The unique identifier (guid) of the employee + attr_accessor :employee_id + + # The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + attr_accessor :leave_type_id + + # The date when the leave starts + attr_accessor :start_date + + # The date when the leave ends + attr_accessor :end_date + + # the type of statutory leave + attr_accessor :type + + # the type of statutory leave + attr_accessor :status + + # The days of the work week the employee is scheduled to work at the time the leave is taken + attr_accessor :work_pattern + + # Whether the sick leave was pregnancy related + attr_accessor :is_pregnancy_related + + # Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request + attr_accessor :sufficient_notice + + # Whether the leave was entitled to receive payment + attr_accessor :is_entitled + + # The amount of requested time (in weeks) + attr_accessor :entitlement_weeks_requested + + # The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + attr_accessor :entitlement_weeks_qualified + + # A calculated amount of time (in weeks) that remains for the statutory sick leave period + attr_accessor :entitlement_weeks_remaining + + # Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + attr_accessor :overlaps_with_other_leave + + # If the leave requested was considered \"not entitled\", the reasons why are listed here. + attr_accessor :entitlement_failure_reasons + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statutory_leave_id' => :'statutoryLeaveID', + :'employee_id' => :'employeeID', + :'leave_type_id' => :'leaveTypeID', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'type' => :'type', + :'status' => :'status', + :'work_pattern' => :'workPattern', + :'is_pregnancy_related' => :'isPregnancyRelated', + :'sufficient_notice' => :'sufficientNotice', + :'is_entitled' => :'isEntitled', + :'entitlement_weeks_requested' => :'entitlementWeeksRequested', + :'entitlement_weeks_qualified' => :'entitlementWeeksQualified', + :'entitlement_weeks_remaining' => :'entitlementWeeksRemaining', + :'overlaps_with_other_leave' => :'overlapsWithOtherLeave', + :'entitlement_failure_reasons' => :'entitlementFailureReasons' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'statutory_leave_id' => :'String', + :'employee_id' => :'String', + :'leave_type_id' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'type' => :'String', + :'status' => :'String', + :'work_pattern' => :'Array', + :'is_pregnancy_related' => :'Boolean', + :'sufficient_notice' => :'Boolean', + :'is_entitled' => :'Boolean', + :'entitlement_weeks_requested' => :'Float', + :'entitlement_weeks_qualified' => :'Float', + :'entitlement_weeks_remaining' => :'Float', + :'overlaps_with_other_leave' => :'Boolean', + :'entitlement_failure_reasons' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutorySickLeave` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutorySickLeave`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statutory_leave_id') + self.statutory_leave_id = attributes[:'statutory_leave_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'work_pattern') + if (value = attributes[:'work_pattern']).is_a?(Array) + self.work_pattern = value + end + end + + if attributes.key?(:'is_pregnancy_related') + self.is_pregnancy_related = attributes[:'is_pregnancy_related'] + end + + if attributes.key?(:'sufficient_notice') + self.sufficient_notice = attributes[:'sufficient_notice'] + end + + if attributes.key?(:'is_entitled') + self.is_entitled = attributes[:'is_entitled'] + end + + if attributes.key?(:'entitlement_weeks_requested') + self.entitlement_weeks_requested = attributes[:'entitlement_weeks_requested'] + end + + if attributes.key?(:'entitlement_weeks_qualified') + self.entitlement_weeks_qualified = attributes[:'entitlement_weeks_qualified'] + end + + if attributes.key?(:'entitlement_weeks_remaining') + self.entitlement_weeks_remaining = attributes[:'entitlement_weeks_remaining'] + end + + if attributes.key?(:'overlaps_with_other_leave') + self.overlaps_with_other_leave = attributes[:'overlaps_with_other_leave'] + end + + if attributes.key?(:'entitlement_failure_reasons') + if (value = attributes[:'entitlement_failure_reasons']).is_a?(Array) + self.entitlement_failure_reasons = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @employee_id.nil? + invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.') + end + + if @leave_type_id.nil? + invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + if @work_pattern.nil? + invalid_properties.push('invalid value for "work_pattern", work_pattern cannot be nil.') + end + + if @is_pregnancy_related.nil? + invalid_properties.push('invalid value for "is_pregnancy_related", is_pregnancy_related cannot be nil.') + end + + if @sufficient_notice.nil? + invalid_properties.push('invalid value for "sufficient_notice", sufficient_notice cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @employee_id.nil? + return false if @leave_type_id.nil? + return false if @start_date.nil? + return false if @end_date.nil? + return false if @work_pattern.nil? + return false if @is_pregnancy_related.nil? + return false if @sufficient_notice.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statutory_leave_id == o.statutory_leave_id && + employee_id == o.employee_id && + leave_type_id == o.leave_type_id && + start_date == o.start_date && + end_date == o.end_date && + type == o.type && + status == o.status && + work_pattern == o.work_pattern && + is_pregnancy_related == o.is_pregnancy_related && + sufficient_notice == o.sufficient_notice && + is_entitled == o.is_entitled && + entitlement_weeks_requested == o.entitlement_weeks_requested && + entitlement_weeks_qualified == o.entitlement_weeks_qualified && + entitlement_weeks_remaining == o.entitlement_weeks_remaining && + overlaps_with_other_leave == o.overlaps_with_other_leave && + entitlement_failure_reasons == o.entitlement_failure_reasons + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statutory_leave_id, employee_id, leave_type_id, start_date, end_date, type, status, work_pattern, is_pregnancy_related, sufficient_notice, is_entitled, entitlement_weeks_requested, entitlement_weeks_qualified, entitlement_weeks_remaining, overlaps_with_other_leave, entitlement_failure_reasons].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb new file mode 100644 index 00000000..0c262834 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutorySickLeaveObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_sick_leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_sick_leave' => :'statutorySickLeave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_sick_leave' => :'EmployeeStatutorySickLeave' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_sick_leave') + self.statutory_sick_leave = attributes[:'statutory_sick_leave'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_sick_leave == o.statutory_sick_leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_sick_leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb new file mode 100644 index 00000000..3fed3ac9 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeStatutorySickLeaves + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :statutory_sick_leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'statutory_sick_leave' => :'statutorySickLeave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'statutory_sick_leave' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeStatutorySickLeaves` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeStatutorySickLeaves`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'statutory_sick_leave') + if (value = attributes[:'statutory_sick_leave']).is_a?(Array) + self.statutory_sick_leave = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + statutory_sick_leave == o.statutory_sick_leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, statutory_sick_leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_tax.rb b/lib/xero-ruby/models/payroll_uk/employee_tax.rb new file mode 100644 index 00000000..df8b524b --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_tax.rb @@ -0,0 +1,308 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeTax + # The Starter type. + attr_accessor :starter_type + + # Starter declaration. + attr_accessor :starter_declaration + + # The Tax code. + attr_accessor :tax_code + + # Describes whether the tax settings is W1M1 + attr_accessor :w1_m1 + + # The previous taxable pay + attr_accessor :previous_taxable_pay + + # The tax amount previously paid + attr_accessor :previous_tax_paid + + # The employee's student loan deduction type + attr_accessor :student_loan_deduction + + # Describes whether the employee has post graduate loans + attr_accessor :has_post_graduate_loans + + # Describes whether the employee is director + attr_accessor :is_director + + # The directorship start date + attr_accessor :directorship_start_date + + # NICs calculation method + attr_accessor :nic_calculation_method + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'starter_type' => :'starterType', + :'starter_declaration' => :'starterDeclaration', + :'tax_code' => :'taxCode', + :'w1_m1' => :'w1M1', + :'previous_taxable_pay' => :'previousTaxablePay', + :'previous_tax_paid' => :'previousTaxPaid', + :'student_loan_deduction' => :'studentLoanDeduction', + :'has_post_graduate_loans' => :'hasPostGraduateLoans', + :'is_director' => :'isDirector', + :'directorship_start_date' => :'directorshipStartDate', + :'nic_calculation_method' => :'nicCalculationMethod' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'starter_type' => :'String', + :'starter_declaration' => :'String', + :'tax_code' => :'String', + :'w1_m1' => :'Boolean', + :'previous_taxable_pay' => :'BigDecimal', + :'previous_tax_paid' => :'BigDecimal', + :'student_loan_deduction' => :'String', + :'has_post_graduate_loans' => :'Boolean', + :'is_director' => :'Boolean', + :'directorship_start_date' => :'Date', + :'nic_calculation_method' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeTax` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeTax`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'starter_type') + self.starter_type = attributes[:'starter_type'] + end + + if attributes.key?(:'starter_declaration') + self.starter_declaration = attributes[:'starter_declaration'] + end + + if attributes.key?(:'tax_code') + self.tax_code = attributes[:'tax_code'] + end + + if attributes.key?(:'w1_m1') + self.w1_m1 = attributes[:'w1_m1'] + end + + if attributes.key?(:'previous_taxable_pay') + self.previous_taxable_pay = attributes[:'previous_taxable_pay'] + end + + if attributes.key?(:'previous_tax_paid') + self.previous_tax_paid = attributes[:'previous_tax_paid'] + end + + if attributes.key?(:'student_loan_deduction') + self.student_loan_deduction = attributes[:'student_loan_deduction'] + end + + if attributes.key?(:'has_post_graduate_loans') + self.has_post_graduate_loans = attributes[:'has_post_graduate_loans'] + end + + if attributes.key?(:'is_director') + self.is_director = attributes[:'is_director'] + end + + if attributes.key?(:'directorship_start_date') + self.directorship_start_date = attributes[:'directorship_start_date'] + end + + if attributes.key?(:'nic_calculation_method') + self.nic_calculation_method = attributes[:'nic_calculation_method'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + starter_type == o.starter_type && + starter_declaration == o.starter_declaration && + tax_code == o.tax_code && + w1_m1 == o.w1_m1 && + previous_taxable_pay == o.previous_taxable_pay && + previous_tax_paid == o.previous_tax_paid && + student_loan_deduction == o.student_loan_deduction && + has_post_graduate_loans == o.has_post_graduate_loans && + is_director == o.is_director && + directorship_start_date == o.directorship_start_date && + nic_calculation_method == o.nic_calculation_method + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [starter_type, starter_declaration, tax_code, w1_m1, previous_taxable_pay, previous_tax_paid, student_loan_deduction, has_post_graduate_loans, is_director, directorship_start_date, nic_calculation_method].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb b/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb new file mode 100644 index 00000000..1d079c10 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmployeeTaxObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employee_tax + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employee_tax' => :'employeeTax' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employee_tax' => :'EmployeeTax' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmployeeTaxObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmployeeTaxObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employee_tax') + self.employee_tax = attributes[:'employee_tax'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employee_tax == o.employee_tax + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employee_tax].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employees.rb b/lib/xero-ruby/models/payroll_uk/employees.rb new file mode 100644 index 00000000..2c3613e0 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employees.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Employees + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employees + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employees' => :'employees' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employees' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Employees` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Employees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employees') + if (value = attributes[:'employees']).is_a?(Array) + self.employees = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employees == o.employees + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employees].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employment.rb b/lib/xero-ruby/models/payroll_uk/employment.rb new file mode 100644 index 00000000..1ba98062 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employment.rb @@ -0,0 +1,280 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Employment + # Xero unique identifier for the payroll calendar of the employee + attr_accessor :payroll_calendar_id + + # Start date of the employment (YYYY-MM-DD) + attr_accessor :start_date + + # The employment number of the employee + attr_accessor :employee_number + + # The NI Category of the employee + attr_accessor :ni_category + A = "A".freeze + B = "B".freeze + C = "C".freeze + H = "H".freeze + J = "J".freeze + M = "M".freeze + Z = "Z".freeze + X = "X".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendar_id' => :'payrollCalendarID', + :'start_date' => :'startDate', + :'employee_number' => :'employeeNumber', + :'ni_category' => :'niCategory' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendar_id' => :'String', + :'start_date' => :'Date', + :'employee_number' => :'String', + :'ni_category' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Employment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Employment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'employee_number') + self.employee_number = attributes[:'employee_number'] + end + + if attributes.key?(:'ni_category') + self.ni_category = attributes[:'ni_category'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + ni_category_validator = EnumAttributeValidator.new('String', ["A", "B", "C", "H", "J", "M", "Z", "X"]) + return false unless ni_category_validator.valid?(@ni_category) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] ni_category Object to be assigned + def ni_category=(ni_category) + validator = EnumAttributeValidator.new('String', ["A", "B", "C", "H", "J", "M", "Z", "X"]) + unless validator.valid?(ni_category) + fail ArgumentError, "invalid value for \"ni_category\", must be one of #{validator.allowable_values}." + end + @ni_category = ni_category + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendar_id == o.payroll_calendar_id && + start_date == o.start_date && + employee_number == o.employee_number && + ni_category == o.ni_category + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendar_id, start_date, employee_number, ni_category].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/employment_object.rb b/lib/xero-ruby/models/payroll_uk/employment_object.rb new file mode 100644 index 00000000..a3e69d88 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/employment_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class EmploymentObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :employment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'employment' => :'employment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'employment' => :'Employment' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::EmploymentObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::EmploymentObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'employment') + self.employment = attributes[:'employment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + employment == o.employment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, employment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/invalid_field.rb b/lib/xero-ruby/models/payroll_uk/invalid_field.rb new file mode 100644 index 00000000..671facdb --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/invalid_field.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class InvalidField + # The name of the field that caused the error + attr_accessor :name + + # The reason the error occurred + attr_accessor :reason + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'reason' => :'reason' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'reason' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::InvalidField` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::InvalidField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + reason == o.reason + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, reason].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb new file mode 100644 index 00000000..6f46913c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeaveAccrualLine + # Xero identifier for the Leave type + attr_accessor :leave_type_id + + # Leave accrual number of units + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_type_id' => :'leaveTypeID', + :'number_of_units' => :'numberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_type_id' => :'String', + :'number_of_units' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeaveAccrualLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeaveAccrualLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_type_id == o.leave_type_id && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_type_id, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb new file mode 100644 index 00000000..f17502f9 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeaveEarningsLine + # Xero identifier for payroll leave earnings rate + attr_accessor :earnings_rate_id + + # Rate per unit for leave earnings line + attr_accessor :rate_per_unit + + # Leave earnings number of units + attr_accessor :number_of_units + + # Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the earnings line. + attr_accessor :amount + + # Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + attr_accessor :is_linked_to_timesheet + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'earningsRateID', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'rate_per_unit' => :'Float', + :'number_of_units' => :'Float', + :'fixed_amount' => :'Float', + :'amount' => :'Float', + :'is_linked_to_timesheet' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeaveEarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeaveEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_period.rb b/lib/xero-ruby/models/payroll_uk/leave_period.rb new file mode 100644 index 00000000..05b64490 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_period.rb @@ -0,0 +1,274 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeavePeriod + # The Pay Period Start Date (YYYY-MM-DD) + attr_accessor :period_start_date + + # The Pay Period End Date (YYYY-MM-DD) + attr_accessor :period_end_date + + # The Number of Units for the leave + attr_accessor :number_of_units + + # Period Status + attr_accessor :period_status + APPROVED = "Approved".freeze + COMPLETED = "Completed".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'number_of_units' => :'numberOfUnits', + :'period_status' => :'periodStatus' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'number_of_units' => :'Float', + :'period_status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeavePeriod` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeavePeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'period_status') + self.period_status = attributes[:'period_status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + period_status_validator = EnumAttributeValidator.new('String', ["Approved", "Completed"]) + return false unless period_status_validator.valid?(@period_status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] period_status Object to be assigned + def period_status=(period_status) + validator = EnumAttributeValidator.new('String', ["Approved", "Completed"]) + unless validator.valid?(period_status) + fail ArgumentError, "invalid value for \"period_status\", must be one of #{validator.allowable_values}." + end + @period_status = period_status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + number_of_units == o.number_of_units && + period_status == o.period_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period_start_date, period_end_date, number_of_units, period_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_periods.rb b/lib/xero-ruby/models/payroll_uk/leave_periods.rb new file mode 100644 index 00000000..4451302c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_periods.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeavePeriods + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :periods + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'periods' => :'periods' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'periods' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeavePeriods` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeavePeriods`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'periods') + if (value = attributes[:'periods']).is_a?(Array) + self.periods = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + periods == o.periods + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, periods].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_type.rb b/lib/xero-ruby/models/payroll_uk/leave_type.rb new file mode 100644 index 00000000..93516725 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_type.rb @@ -0,0 +1,293 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeaveType + # Xero unique identifier for the leave + attr_accessor :leave_id + + # Xero unique identifier for the leave type + attr_accessor :leave_type_id + + # Name of the leave type + attr_accessor :name + + # Indicate that an employee will be paid when taking this type of leave + attr_accessor :is_paid_leave + + # Indicate that a balance for this leave type to be shown on the employee’s payslips + attr_accessor :show_on_payslip + + # UTC timestamp of last update to the leave type note + attr_accessor :updated_date_utc + + # Shows whether the leave type is active or not + attr_accessor :is_active + + # Shows whether the leave type is a statutory leave type or not + attr_accessor :is_statutory_leave + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'leave_id' => :'leaveID', + :'leave_type_id' => :'leaveTypeID', + :'name' => :'name', + :'is_paid_leave' => :'isPaidLeave', + :'show_on_payslip' => :'showOnPayslip', + :'updated_date_utc' => :'updatedDateUTC', + :'is_active' => :'isActive', + :'is_statutory_leave' => :'isStatutoryLeave' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'leave_id' => :'String', + :'leave_type_id' => :'String', + :'name' => :'String', + :'is_paid_leave' => :'Boolean', + :'show_on_payslip' => :'Boolean', + :'updated_date_utc' => :'DateTime', + :'is_active' => :'Boolean', + :'is_statutory_leave' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeaveType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeaveType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'leave_id') + self.leave_id = attributes[:'leave_id'] + end + + if attributes.key?(:'leave_type_id') + self.leave_type_id = attributes[:'leave_type_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'is_paid_leave') + self.is_paid_leave = attributes[:'is_paid_leave'] + end + + if attributes.key?(:'show_on_payslip') + self.show_on_payslip = attributes[:'show_on_payslip'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + + if attributes.key?(:'is_statutory_leave') + self.is_statutory_leave = attributes[:'is_statutory_leave'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @is_paid_leave.nil? + invalid_properties.push('invalid value for "is_paid_leave", is_paid_leave cannot be nil.') + end + + if @show_on_payslip.nil? + invalid_properties.push('invalid value for "show_on_payslip", show_on_payslip cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @is_paid_leave.nil? + return false if @show_on_payslip.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + leave_id == o.leave_id && + leave_type_id == o.leave_type_id && + name == o.name && + is_paid_leave == o.is_paid_leave && + show_on_payslip == o.show_on_payslip && + updated_date_utc == o.updated_date_utc && + is_active == o.is_active && + is_statutory_leave == o.is_statutory_leave + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [leave_id, leave_type_id, name, is_paid_leave, show_on_payslip, updated_date_utc, is_active, is_statutory_leave].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_type_object.rb b/lib/xero-ruby/models/payroll_uk/leave_type_object.rb new file mode 100644 index 00000000..6fa610a6 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_type_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeaveTypeObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_type' => :'leaveType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_type' => :'LeaveType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeaveTypeObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeaveTypeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_type') + self.leave_type = attributes[:'leave_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_type == o.leave_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/leave_types.rb b/lib/xero-ruby/models/payroll_uk/leave_types.rb new file mode 100644 index 00000000..debe4965 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/leave_types.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class LeaveTypes + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :leave_types + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'leave_types' => :'leaveTypes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'leave_types' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::LeaveTypes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::LeaveTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'leave_types') + if (value = attributes[:'leave_types']).is_a?(Array) + self.leave_types = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + leave_types == o.leave_types + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, leave_types].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pagination.rb b/lib/xero-ruby/models/payroll_uk/pagination.rb new file mode 100644 index 00000000..21d10b27 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pagination.rb @@ -0,0 +1,238 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Pagination + + attr_accessor :page + + + attr_accessor :page_size + + + attr_accessor :page_count + + + attr_accessor :item_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page' => :'page', + :'page_size' => :'pageSize', + :'page_count' => :'pageCount', + :'item_count' => :'itemCount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'page' => :'Integer', + :'page_size' => :'Integer', + :'page_count' => :'Integer', + :'item_count' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Pagination` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'page_count') + self.page_count = attributes[:'page_count'] + end + + if attributes.key?(:'item_count') + self.item_count = attributes[:'item_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + page_size == o.page_size && + page_count == o.page_count && + item_count == o.item_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page, page_size, page_count, item_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_run.rb b/lib/xero-ruby/models/payroll_uk/pay_run.rb new file mode 100644 index 00000000..f15eece3 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_run.rb @@ -0,0 +1,389 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRun + # Xero unique identifier for the pay run + attr_accessor :pay_run_id + + # Xero unique identifier for the payroll calendar + attr_accessor :payroll_calendar_id + + # Period start date of the payroll calendar + attr_accessor :period_start_date + + # Period end date of the payroll calendar + attr_accessor :period_end_date + + # Payment date of the pay run + attr_accessor :payment_date + + # Total cost of the pay run + attr_accessor :total_cost + + # Total pay of the pay run + attr_accessor :total_pay + + # Pay run status + attr_accessor :pay_run_status + DRAFT = "Draft".freeze + POSTED = "Posted".freeze + + # Pay run type + attr_accessor :pay_run_type + SCHEDULED = "Scheduled".freeze + UNSCHEDULED = "Unscheduled".freeze + EARLIER_YEAR_UPDATE = "EarlierYearUpdate".freeze + + # Calendar type of the pay run + attr_accessor :calendar_type + WEEKLY = "Weekly".freeze + FORTNIGHTLY = "Fortnightly".freeze + FOUR_WEEKLY = "FourWeekly".freeze + MONTHLY = "Monthly".freeze + ANNUAL = "Annual".freeze + QUARTERLY = "Quarterly".freeze + + # Posted date time of the pay run + attr_accessor :posted_date_time + + + attr_accessor :pay_slips + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_run_id' => :'payRunID', + :'payroll_calendar_id' => :'payrollCalendarID', + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'payment_date' => :'paymentDate', + :'total_cost' => :'totalCost', + :'total_pay' => :'totalPay', + :'pay_run_status' => :'payRunStatus', + :'pay_run_type' => :'payRunType', + :'calendar_type' => :'calendarType', + :'posted_date_time' => :'postedDateTime', + :'pay_slips' => :'paySlips' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_run_id' => :'String', + :'payroll_calendar_id' => :'String', + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'payment_date' => :'Date', + :'total_cost' => :'Float', + :'total_pay' => :'Float', + :'pay_run_status' => :'String', + :'pay_run_type' => :'String', + :'calendar_type' => :'String', + :'posted_date_time' => :'Date', + :'pay_slips' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRun` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRun`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_run_id') + self.pay_run_id = attributes[:'pay_run_id'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'total_cost') + self.total_cost = attributes[:'total_cost'] + end + + if attributes.key?(:'total_pay') + self.total_pay = attributes[:'total_pay'] + end + + if attributes.key?(:'pay_run_status') + self.pay_run_status = attributes[:'pay_run_status'] + end + + if attributes.key?(:'pay_run_type') + self.pay_run_type = attributes[:'pay_run_type'] + end + + if attributes.key?(:'calendar_type') + self.calendar_type = attributes[:'calendar_type'] + end + + if attributes.key?(:'posted_date_time') + self.posted_date_time = attributes[:'posted_date_time'] + end + + if attributes.key?(:'pay_slips') + if (value = attributes[:'pay_slips']).is_a?(Array) + self.pay_slips = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + pay_run_status_validator = EnumAttributeValidator.new('String', ["Draft", "Posted"]) + return false unless pay_run_status_validator.valid?(@pay_run_status) + pay_run_type_validator = EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + return false unless pay_run_type_validator.valid?(@pay_run_type) + calendar_type_validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + return false unless calendar_type_validator.valid?(@calendar_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] pay_run_status Object to be assigned + def pay_run_status=(pay_run_status) + validator = EnumAttributeValidator.new('String', ["Draft", "Posted"]) + unless validator.valid?(pay_run_status) + fail ArgumentError, "invalid value for \"pay_run_status\", must be one of #{validator.allowable_values}." + end + @pay_run_status = pay_run_status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] pay_run_type Object to be assigned + def pay_run_type=(pay_run_type) + validator = EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + unless validator.valid?(pay_run_type) + fail ArgumentError, "invalid value for \"pay_run_type\", must be one of #{validator.allowable_values}." + end + @pay_run_type = pay_run_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calendar_type Object to be assigned + def calendar_type=(calendar_type) + validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + unless validator.valid?(calendar_type) + fail ArgumentError, "invalid value for \"calendar_type\", must be one of #{validator.allowable_values}." + end + @calendar_type = calendar_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_run_id == o.pay_run_id && + payroll_calendar_id == o.payroll_calendar_id && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + payment_date == o.payment_date && + total_cost == o.total_cost && + total_pay == o.total_pay && + pay_run_status == o.pay_run_status && + pay_run_type == o.pay_run_type && + calendar_type == o.calendar_type && + posted_date_time == o.posted_date_time && + pay_slips == o.pay_slips + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_run_id, payroll_calendar_id, period_start_date, period_end_date, payment_date, total_cost, total_pay, pay_run_status, pay_run_type, calendar_type, posted_date_time, pay_slips].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb new file mode 100644 index 00000000..1bf529e7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb @@ -0,0 +1,328 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRunCalendar + # Xero unique identifier for the payroll calendar + attr_accessor :payroll_calendar_id + + # Name of the calendar + attr_accessor :name + + # Type of the calendar + attr_accessor :calendar_type + WEEKLY = "Weekly".freeze + FORTNIGHTLY = "Fortnightly".freeze + FOUR_WEEKLY = "FourWeekly".freeze + MONTHLY = "Monthly".freeze + ANNUAL = "Annual".freeze + QUARTERLY = "Quarterly".freeze + + # Period start date of the calendar + attr_accessor :period_start_date + + # Period end date of the calendar + attr_accessor :period_end_date + + # Payment date of the calendar + attr_accessor :payment_date + + # UTC timestamp of the last update to the pay run calendar + attr_accessor :updated_date_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payroll_calendar_id' => :'payrollCalendarID', + :'name' => :'name', + :'calendar_type' => :'calendarType', + :'period_start_date' => :'periodStartDate', + :'period_end_date' => :'periodEndDate', + :'payment_date' => :'paymentDate', + :'updated_date_utc' => :'updatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payroll_calendar_id' => :'String', + :'name' => :'String', + :'calendar_type' => :'String', + :'period_start_date' => :'Date', + :'period_end_date' => :'Date', + :'payment_date' => :'Date', + :'updated_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRunCalendar` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRunCalendar`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'calendar_type') + self.calendar_type = attributes[:'calendar_type'] + end + + if attributes.key?(:'period_start_date') + self.period_start_date = attributes[:'period_start_date'] + end + + if attributes.key?(:'period_end_date') + self.period_end_date = attributes[:'period_end_date'] + end + + if attributes.key?(:'payment_date') + self.payment_date = attributes[:'payment_date'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @calendar_type.nil? + invalid_properties.push('invalid value for "calendar_type", calendar_type cannot be nil.') + end + + if @period_start_date.nil? + invalid_properties.push('invalid value for "period_start_date", period_start_date cannot be nil.') + end + + if @payment_date.nil? + invalid_properties.push('invalid value for "payment_date", payment_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @calendar_type.nil? + calendar_type_validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + return false unless calendar_type_validator.valid?(@calendar_type) + return false if @period_start_date.nil? + return false if @payment_date.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] calendar_type Object to be assigned + def calendar_type=(calendar_type) + validator = EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + unless validator.valid?(calendar_type) + fail ArgumentError, "invalid value for \"calendar_type\", must be one of #{validator.allowable_values}." + end + @calendar_type = calendar_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payroll_calendar_id == o.payroll_calendar_id && + name == o.name && + calendar_type == o.calendar_type && + period_start_date == o.period_start_date && + period_end_date == o.period_end_date && + payment_date == o.payment_date && + updated_date_utc == o.updated_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payroll_calendar_id, name, calendar_type, period_start_date, period_end_date, payment_date, updated_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb new file mode 100644 index 00000000..e293a700 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRunCalendarObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run_calendar + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run_calendar' => :'payRunCalendar' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run_calendar' => :'PayRunCalendar' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRunCalendarObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRunCalendarObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run_calendar') + self.pay_run_calendar = attributes[:'pay_run_calendar'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run_calendar == o.pay_run_calendar + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run_calendar].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb new file mode 100644 index 00000000..5d4e4226 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRunCalendars + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run_calendars + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run_calendars' => :'payRunCalendars' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run_calendars' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRunCalendars` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRunCalendars`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run_calendars') + if (value = attributes[:'pay_run_calendars']).is_a?(Array) + self.pay_run_calendars = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run_calendars == o.pay_run_calendars + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run_calendars].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_object.rb b/lib/xero-ruby/models/payroll_uk/pay_run_object.rb new file mode 100644 index 00000000..a77619a4 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_run_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRunObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_run + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_run' => :'payRun' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_run' => :'PayRun' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRunObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRunObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_run') + self.pay_run = attributes[:'pay_run'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_run == o.pay_run + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_run].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/pay_runs.rb b/lib/xero-ruby/models/payroll_uk/pay_runs.rb new file mode 100644 index 00000000..ecd7936c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/pay_runs.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayRuns + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_runs + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_runs' => :'payRuns' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_runs' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayRuns` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayRuns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_runs') + if (value = attributes[:'pay_runs']).is_a?(Array) + self.pay_runs = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_runs == o.pay_runs + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_runs].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payment_line.rb b/lib/xero-ruby/models/payroll_uk/payment_line.rb new file mode 100644 index 00000000..1b394d29 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payment_line.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PaymentLine + # Xero identifier for payroll payment line + attr_accessor :payment_line_id + + # The amount of the payment line + attr_accessor :amount + + # The account number + attr_accessor :account_number + + # The account sort code + attr_accessor :sort_code + + # The account name + attr_accessor :account_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_line_id' => :'paymentLineID', + :'amount' => :'amount', + :'account_number' => :'accountNumber', + :'sort_code' => :'sortCode', + :'account_name' => :'accountName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_line_id' => :'String', + :'amount' => :'Float', + :'account_number' => :'String', + :'sort_code' => :'String', + :'account_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PaymentLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PaymentLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_line_id') + self.payment_line_id = attributes[:'payment_line_id'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'sort_code') + self.sort_code = attributes[:'sort_code'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_line_id == o.payment_line_id && + amount == o.amount && + account_number == o.account_number && + sort_code == o.sort_code && + account_name == o.account_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_line_id, amount, account_number, sort_code, account_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payment_method.rb b/lib/xero-ruby/models/payroll_uk/payment_method.rb new file mode 100644 index 00000000..eb74888b --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payment_method.rb @@ -0,0 +1,262 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PaymentMethod + # The payment method code + attr_accessor :payment_method + CHEQUE = "Cheque".freeze + ELECTRONICALLY = "Electronically".freeze + MANUAL = "Manual".freeze + + + attr_accessor :bank_accounts + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_method' => :'paymentMethod', + :'bank_accounts' => :'bankAccounts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_method' => :'String', + :'bank_accounts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PaymentMethod` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PaymentMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + + if attributes.key?(:'bank_accounts') + if (value = attributes[:'bank_accounts']).is_a?(Array) + self.bank_accounts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @payment_method.nil? + invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @payment_method.nil? + payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + return false unless payment_method_validator.valid?(@payment_method) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_method Object to be assigned + def payment_method=(payment_method) + validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + unless validator.valid?(payment_method) + fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." + end + @payment_method = payment_method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_method == o.payment_method && + bank_accounts == o.bank_accounts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_method, bank_accounts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payment_method_object.rb b/lib/xero-ruby/models/payroll_uk/payment_method_object.rb new file mode 100644 index 00000000..7568ee12 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payment_method_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PaymentMethodObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :payment_method + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'payment_method' => :'paymentMethod' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'payment_method' => :'PaymentMethod' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PaymentMethodObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PaymentMethodObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + payment_method == o.payment_method + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, payment_method].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payslip.rb b/lib/xero-ruby/models/payroll_uk/payslip.rb new file mode 100644 index 00000000..67dcc9ad --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payslip.rb @@ -0,0 +1,525 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Payslip + # The Xero identifier for a Payslip + attr_accessor :pay_slip_id + + # The Xero identifier for payroll employee + attr_accessor :employee_id + + # The Xero identifier for the associated payrun + attr_accessor :pay_run_id + + # The date payslip was last updated + attr_accessor :last_edited + + # Employee first name + attr_accessor :first_name + + # Employee last name + attr_accessor :last_name + + # Total earnings before any deductions. Same as gross earnings for UK. + attr_accessor :total_earnings + + # Total earnings before any deductions. Same as total earnings for UK. + attr_accessor :gross_earnings + + # The employee net pay + attr_accessor :total_pay + + # The employer's tax obligation + attr_accessor :total_employer_taxes + + # The part of an employee's earnings that is deducted for tax purposes + attr_accessor :total_employee_taxes + + # Total amount subtracted from an employee's earnings to reach total pay + attr_accessor :total_deductions + + # Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + attr_accessor :total_reimbursements + + # Total amounts required by law to subtract from the employee's earnings + attr_accessor :total_court_orders + + # Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + attr_accessor :total_benefits + + # BACS Service User Number + attr_accessor :bacs_hash + + # The payment method code + attr_accessor :payment_method + CHEQUE = "Cheque".freeze + ELECTRONICALLY = "Electronically".freeze + MANUAL = "Manual".freeze + + + attr_accessor :earnings_lines + + + attr_accessor :leave_earnings_lines + + + attr_accessor :timesheet_earnings_lines + + + attr_accessor :deduction_lines + + + attr_accessor :reimbursement_lines + + + attr_accessor :leave_accrual_lines + + + attr_accessor :benefit_lines + + + attr_accessor :payment_lines + + + attr_accessor :employee_tax_lines + + + attr_accessor :court_order_lines + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pay_slip_id' => :'paySlipID', + :'employee_id' => :'employeeID', + :'pay_run_id' => :'payRunID', + :'last_edited' => :'lastEdited', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'total_earnings' => :'totalEarnings', + :'gross_earnings' => :'grossEarnings', + :'total_pay' => :'totalPay', + :'total_employer_taxes' => :'totalEmployerTaxes', + :'total_employee_taxes' => :'totalEmployeeTaxes', + :'total_deductions' => :'totalDeductions', + :'total_reimbursements' => :'totalReimbursements', + :'total_court_orders' => :'totalCourtOrders', + :'total_benefits' => :'totalBenefits', + :'bacs_hash' => :'bacsHash', + :'payment_method' => :'paymentMethod', + :'earnings_lines' => :'earningsLines', + :'leave_earnings_lines' => :'leaveEarningsLines', + :'timesheet_earnings_lines' => :'timesheetEarningsLines', + :'deduction_lines' => :'deductionLines', + :'reimbursement_lines' => :'reimbursementLines', + :'leave_accrual_lines' => :'leaveAccrualLines', + :'benefit_lines' => :'benefitLines', + :'payment_lines' => :'paymentLines', + :'employee_tax_lines' => :'employeeTaxLines', + :'court_order_lines' => :'courtOrderLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pay_slip_id' => :'String', + :'employee_id' => :'String', + :'pay_run_id' => :'String', + :'last_edited' => :'Date', + :'first_name' => :'String', + :'last_name' => :'String', + :'total_earnings' => :'Float', + :'gross_earnings' => :'Float', + :'total_pay' => :'Float', + :'total_employer_taxes' => :'Float', + :'total_employee_taxes' => :'Float', + :'total_deductions' => :'Float', + :'total_reimbursements' => :'Float', + :'total_court_orders' => :'Float', + :'total_benefits' => :'Float', + :'bacs_hash' => :'String', + :'payment_method' => :'String', + :'earnings_lines' => :'Array', + :'leave_earnings_lines' => :'Array', + :'timesheet_earnings_lines' => :'Array', + :'deduction_lines' => :'Array', + :'reimbursement_lines' => :'Array', + :'leave_accrual_lines' => :'Array', + :'benefit_lines' => :'Array', + :'payment_lines' => :'Array', + :'employee_tax_lines' => :'Array', + :'court_order_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Payslip` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Payslip`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pay_slip_id') + self.pay_slip_id = attributes[:'pay_slip_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'pay_run_id') + self.pay_run_id = attributes[:'pay_run_id'] + end + + if attributes.key?(:'last_edited') + self.last_edited = attributes[:'last_edited'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'total_earnings') + self.total_earnings = attributes[:'total_earnings'] + end + + if attributes.key?(:'gross_earnings') + self.gross_earnings = attributes[:'gross_earnings'] + end + + if attributes.key?(:'total_pay') + self.total_pay = attributes[:'total_pay'] + end + + if attributes.key?(:'total_employer_taxes') + self.total_employer_taxes = attributes[:'total_employer_taxes'] + end + + if attributes.key?(:'total_employee_taxes') + self.total_employee_taxes = attributes[:'total_employee_taxes'] + end + + if attributes.key?(:'total_deductions') + self.total_deductions = attributes[:'total_deductions'] + end + + if attributes.key?(:'total_reimbursements') + self.total_reimbursements = attributes[:'total_reimbursements'] + end + + if attributes.key?(:'total_court_orders') + self.total_court_orders = attributes[:'total_court_orders'] + end + + if attributes.key?(:'total_benefits') + self.total_benefits = attributes[:'total_benefits'] + end + + if attributes.key?(:'bacs_hash') + self.bacs_hash = attributes[:'bacs_hash'] + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + end + + if attributes.key?(:'earnings_lines') + if (value = attributes[:'earnings_lines']).is_a?(Array) + self.earnings_lines = value + end + end + + if attributes.key?(:'leave_earnings_lines') + if (value = attributes[:'leave_earnings_lines']).is_a?(Array) + self.leave_earnings_lines = value + end + end + + if attributes.key?(:'timesheet_earnings_lines') + if (value = attributes[:'timesheet_earnings_lines']).is_a?(Array) + self.timesheet_earnings_lines = value + end + end + + if attributes.key?(:'deduction_lines') + if (value = attributes[:'deduction_lines']).is_a?(Array) + self.deduction_lines = value + end + end + + if attributes.key?(:'reimbursement_lines') + if (value = attributes[:'reimbursement_lines']).is_a?(Array) + self.reimbursement_lines = value + end + end + + if attributes.key?(:'leave_accrual_lines') + if (value = attributes[:'leave_accrual_lines']).is_a?(Array) + self.leave_accrual_lines = value + end + end + + if attributes.key?(:'benefit_lines') + if (value = attributes[:'benefit_lines']).is_a?(Array) + self.benefit_lines = value + end + end + + if attributes.key?(:'payment_lines') + if (value = attributes[:'payment_lines']).is_a?(Array) + self.payment_lines = value + end + end + + if attributes.key?(:'employee_tax_lines') + if (value = attributes[:'employee_tax_lines']).is_a?(Array) + self.employee_tax_lines = value + end + end + + if attributes.key?(:'court_order_lines') + if (value = attributes[:'court_order_lines']).is_a?(Array) + self.court_order_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + return false unless payment_method_validator.valid?(@payment_method) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_method Object to be assigned + def payment_method=(payment_method) + validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + unless validator.valid?(payment_method) + fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." + end + @payment_method = payment_method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pay_slip_id == o.pay_slip_id && + employee_id == o.employee_id && + pay_run_id == o.pay_run_id && + last_edited == o.last_edited && + first_name == o.first_name && + last_name == o.last_name && + total_earnings == o.total_earnings && + gross_earnings == o.gross_earnings && + total_pay == o.total_pay && + total_employer_taxes == o.total_employer_taxes && + total_employee_taxes == o.total_employee_taxes && + total_deductions == o.total_deductions && + total_reimbursements == o.total_reimbursements && + total_court_orders == o.total_court_orders && + total_benefits == o.total_benefits && + bacs_hash == o.bacs_hash && + payment_method == o.payment_method && + earnings_lines == o.earnings_lines && + leave_earnings_lines == o.leave_earnings_lines && + timesheet_earnings_lines == o.timesheet_earnings_lines && + deduction_lines == o.deduction_lines && + reimbursement_lines == o.reimbursement_lines && + leave_accrual_lines == o.leave_accrual_lines && + benefit_lines == o.benefit_lines && + payment_lines == o.payment_lines && + employee_tax_lines == o.employee_tax_lines && + court_order_lines == o.court_order_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pay_slip_id, employee_id, pay_run_id, last_edited, first_name, last_name, total_earnings, gross_earnings, total_pay, total_employer_taxes, total_employee_taxes, total_deductions, total_reimbursements, total_court_orders, total_benefits, bacs_hash, payment_method, earnings_lines, leave_earnings_lines, timesheet_earnings_lines, deduction_lines, reimbursement_lines, leave_accrual_lines, benefit_lines, payment_lines, employee_tax_lines, court_order_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payslip_object.rb b/lib/xero-ruby/models/payroll_uk/payslip_object.rb new file mode 100644 index 00000000..2e5e4c46 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payslip_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class PayslipObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_slip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_slip' => :'paySlip' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_slip' => :'Payslip' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::PayslipObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::PayslipObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_slip') + self.pay_slip = attributes[:'pay_slip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_slip == o.pay_slip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_slip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/payslips.rb b/lib/xero-ruby/models/payroll_uk/payslips.rb new file mode 100644 index 00000000..a8bc76e8 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/payslips.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Payslips + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :pay_slips + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'pay_slips' => :'paySlips' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'pay_slips' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Payslips` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Payslips`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'pay_slips') + if (value = attributes[:'pay_slips']).is_a?(Array) + self.pay_slips = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + pay_slips == o.pay_slips + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, pay_slips].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/problem.rb b/lib/xero-ruby/models/payroll_uk/problem.rb new file mode 100644 index 00000000..ea889697 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/problem.rb @@ -0,0 +1,261 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + # The object returned for a bad request + require 'bigdecimal' + + class Problem + # The type of error format + attr_accessor :type + + # The type of the error + attr_accessor :title + + # The error status code + attr_accessor :status + + # A description of the error + attr_accessor :detail + + + attr_accessor :instance + + + attr_accessor :invalid_fields + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'title' => :'title', + :'status' => :'status', + :'detail' => :'detail', + :'instance' => :'instance', + :'invalid_fields' => :'invalidFields' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'title' => :'String', + :'status' => :'String', + :'detail' => :'String', + :'instance' => :'String', + :'invalid_fields' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Problem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Problem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + end + + if attributes.key?(:'invalid_fields') + if (value = attributes[:'invalid_fields']).is_a?(Array) + self.invalid_fields = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + title == o.title && + status == o.status && + detail == o.detail && + instance == o.instance && + invalid_fields == o.invalid_fields + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, title, status, detail, instance, invalid_fields].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement.rb b/lib/xero-ruby/models/payroll_uk/reimbursement.rb new file mode 100644 index 00000000..5465a76f --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/reimbursement.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Reimbursement + # Xero unique identifier for a reimbursement + attr_accessor :reimbursement_id + + # Name of the reimbursement + attr_accessor :name + + # Xero unique identifier for the account used for the reimbursement + attr_accessor :account_id + + # Indicates that whether the reimbursement is active + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_id' => :'reimbursementID', + :'name' => :'name', + :'account_id' => :'accountID', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_id' => :'String', + :'name' => :'String', + :'account_id' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Reimbursement` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Reimbursement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_id') + self.reimbursement_id = attributes[:'reimbursement_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @account_id.nil? + invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @account_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_id == o.reimbursement_id && + name == o.name && + account_id == o.account_id && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_id, name, account_id, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb b/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb new file mode 100644 index 00000000..4bfc93f2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class ReimbursementLine + # Xero identifier for payroll reimbursement + attr_accessor :reimbursement_type_id + + # Reimbursement line description + attr_accessor :description + + # Reimbursement amount + attr_accessor :amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reimbursement_type_id' => :'reimbursementTypeID', + :'description' => :'description', + :'amount' => :'amount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reimbursement_type_id' => :'String', + :'description' => :'String', + :'amount' => :'BigDecimal' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::ReimbursementLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::ReimbursementLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reimbursement_type_id') + self.reimbursement_type_id = attributes[:'reimbursement_type_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reimbursement_type_id == o.reimbursement_type_id && + description == o.description && + amount == o.amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reimbursement_type_id, description, amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb b/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb new file mode 100644 index 00000000..5441620f --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class ReimbursementObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :reimbursement + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'reimbursement' => :'reimbursement' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'reimbursement' => :'Reimbursement' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::ReimbursementObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::ReimbursementObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'reimbursement') + self.reimbursement = attributes[:'reimbursement'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + reimbursement == o.reimbursement + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, reimbursement].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/reimbursements.rb b/lib/xero-ruby/models/payroll_uk/reimbursements.rb new file mode 100644 index 00000000..6556f186 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/reimbursements.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Reimbursements + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :reimbursements + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'reimbursements' => :'reimbursements' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'reimbursements' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Reimbursements` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Reimbursements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'reimbursements') + if (value = attributes[:'reimbursements']).is_a?(Array) + self.reimbursements = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + reimbursements == o.reimbursements + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, reimbursements].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb new file mode 100644 index 00000000..54e62a9a --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb @@ -0,0 +1,368 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class SalaryAndWage + # Xero unique identifier for a salary and wages record + attr_accessor :salary_and_wages_id + + # Xero unique identifier for an earnings rate + attr_accessor :earnings_rate_id + + # The Number of Units per week for the corresponding salary and wages + attr_accessor :number_of_units_per_week + + # The rate of each unit for the corresponding salary and wages + attr_accessor :rate_per_unit + + # The Number of Units per day for the corresponding salary and wages + attr_accessor :number_of_units_per_day + + # The effective date of the corresponding salary and wages + attr_accessor :effective_from + + # The annual salary + attr_accessor :annual_salary + + # The current status of the corresponding salary and wages + attr_accessor :status + ACTIVE = "Active".freeze + PENDING = "Pending".freeze + HISTORY = "History".freeze + + # The type of the payment of the corresponding salary and wages + attr_accessor :payment_type + SALARY = "Salary".freeze + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'salary_and_wages_id' => :'salaryAndWagesID', + :'earnings_rate_id' => :'earningsRateID', + :'number_of_units_per_week' => :'numberOfUnitsPerWeek', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units_per_day' => :'numberOfUnitsPerDay', + :'effective_from' => :'effectiveFrom', + :'annual_salary' => :'annualSalary', + :'status' => :'status', + :'payment_type' => :'paymentType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'salary_and_wages_id' => :'String', + :'earnings_rate_id' => :'String', + :'number_of_units_per_week' => :'Float', + :'rate_per_unit' => :'Float', + :'number_of_units_per_day' => :'Float', + :'effective_from' => :'Date', + :'annual_salary' => :'Float', + :'status' => :'String', + :'payment_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::SalaryAndWage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::SalaryAndWage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'salary_and_wages_id') + self.salary_and_wages_id = attributes[:'salary_and_wages_id'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'number_of_units_per_week') + self.number_of_units_per_week = attributes[:'number_of_units_per_week'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units_per_day') + self.number_of_units_per_day = attributes[:'number_of_units_per_day'] + end + + if attributes.key?(:'effective_from') + self.effective_from = attributes[:'effective_from'] + end + + if attributes.key?(:'annual_salary') + self.annual_salary = attributes[:'annual_salary'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'payment_type') + self.payment_type = attributes[:'payment_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @earnings_rate_id.nil? + invalid_properties.push('invalid value for "earnings_rate_id", earnings_rate_id cannot be nil.') + end + + if @number_of_units_per_week.nil? + invalid_properties.push('invalid value for "number_of_units_per_week", number_of_units_per_week cannot be nil.') + end + + if @effective_from.nil? + invalid_properties.push('invalid value for "effective_from", effective_from cannot be nil.') + end + + if @annual_salary.nil? + invalid_properties.push('invalid value for "annual_salary", annual_salary cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @payment_type.nil? + invalid_properties.push('invalid value for "payment_type", payment_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @earnings_rate_id.nil? + return false if @number_of_units_per_week.nil? + return false if @effective_from.nil? + return false if @annual_salary.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["Active", "Pending", "History"]) + return false unless status_validator.valid?(@status) + return false if @payment_type.nil? + payment_type_validator = EnumAttributeValidator.new('String', ["Salary"]) + return false unless payment_type_validator.valid?(@payment_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Active", "Pending", "History"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_type Object to be assigned + def payment_type=(payment_type) + validator = EnumAttributeValidator.new('String', ["Salary"]) + unless validator.valid?(payment_type) + fail ArgumentError, "invalid value for \"payment_type\", must be one of #{validator.allowable_values}." + end + @payment_type = payment_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + salary_and_wages_id == o.salary_and_wages_id && + earnings_rate_id == o.earnings_rate_id && + number_of_units_per_week == o.number_of_units_per_week && + rate_per_unit == o.rate_per_unit && + number_of_units_per_day == o.number_of_units_per_day && + effective_from == o.effective_from && + annual_salary == o.annual_salary && + status == o.status && + payment_type == o.payment_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [salary_and_wages_id, earnings_rate_id, number_of_units_per_week, rate_per_unit, number_of_units_per_day, effective_from, annual_salary, status, payment_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb new file mode 100644 index 00000000..a6ebe8e2 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class SalaryAndWageObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :salary_and_wages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'salary_and_wages' => :'salaryAndWages' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'salary_and_wages' => :'SalaryAndWage' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::SalaryAndWageObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::SalaryAndWageObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'salary_and_wages') + self.salary_and_wages = attributes[:'salary_and_wages'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + salary_and_wages == o.salary_and_wages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, salary_and_wages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb new file mode 100644 index 00000000..5e5741b5 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class SalaryAndWages + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :salary_and_wages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'salary_and_wages' => :'salaryAndWages' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'salary_and_wages' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::SalaryAndWages` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::SalaryAndWages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'salary_and_wages') + if (value = attributes[:'salary_and_wages']).is_a?(Array) + self.salary_and_wages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + salary_and_wages == o.salary_and_wages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, salary_and_wages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/settings.rb b/lib/xero-ruby/models/payroll_uk/settings.rb new file mode 100644 index 00000000..652bf3c7 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/settings.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Settings + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'settings' => :'Accounts' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Settings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Settings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, settings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb b/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb new file mode 100644 index 00000000..800133b1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb @@ -0,0 +1,248 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class StatutoryDeduction + # The Xero identifier for earnings order + attr_accessor :id + + # Name of the earnings order + attr_accessor :name + + + attr_accessor :statutory_deduction_category + + # Xero identifier for Liability Account + attr_accessor :liability_account_id + + # Identifier of a record is active or not. + attr_accessor :current_record + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'statutory_deduction_category' => :'statutoryDeductionCategory', + :'liability_account_id' => :'liabilityAccountId', + :'current_record' => :'currentRecord' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'statutory_deduction_category' => :'StatutoryDeductionCategory', + :'liability_account_id' => :'String', + :'current_record' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::StatutoryDeduction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::StatutoryDeduction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'statutory_deduction_category') + self.statutory_deduction_category = attributes[:'statutory_deduction_category'] + end + + if attributes.key?(:'liability_account_id') + self.liability_account_id = attributes[:'liability_account_id'] + end + + if attributes.key?(:'current_record') + self.current_record = attributes[:'current_record'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + statutory_deduction_category == o.statutory_deduction_category && + liability_account_id == o.liability_account_id && + current_record == o.current_record + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, statutory_deduction_category, liability_account_id, current_record].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb b/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb new file mode 100644 index 00000000..94361ec1 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb @@ -0,0 +1,49 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + class StatutoryDeductionCategory + ADDITIONAL_STUDENT_LOAN = "AdditionalStudentLoan".freeze + CHILD_SUPPORT = "ChildSupport".freeze + COURT_FINES = "CourtFines".freeze + CREDITOR = "Creditor".freeze + FEDERAL_LEVY = "FederalLevy".freeze + INLAND_REVENUE_ARREARS = "InlandRevenueArrears".freeze + KIWI_SAVER = "KiwiSaver".freeze + MSD_REPAYMENTS = "MsdRepayments".freeze + NON_PRIORITY_ORDER = "NonPriorityOrder".freeze + PRIORITY_ORDER = "PriorityOrder".freeze + TABLE_BASED = "TableBased".freeze + STUDENT_LOAN = "StudentLoan".freeze + VOLUNTARY_STUDENT_LOAN = "VoluntaryStudentLoan".freeze + US_CHILD_SUPPORT = "USChildSupport".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = StatutoryDeductionCategory.constants.select { |c| StatutoryDeductionCategory::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #StatutoryDeductionCategory" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/tax_line.rb b/lib/xero-ruby/models/payroll_uk/tax_line.rb new file mode 100644 index 00000000..7b040884 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/tax_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TaxLine + # Xero identifier for payroll tax line + attr_accessor :tax_line_id + + # Tax line description + attr_accessor :description + + # Identifies if the amount is paid for by the employee or employer. True if employer pays the tax + attr_accessor :is_employer_tax + + # The amount of the tax line + attr_accessor :amount + + # Tax type ID + attr_accessor :global_tax_type_id + + # Identifies if the tax line is a manual adjustment + attr_accessor :manual_adjustment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tax_line_id' => :'taxLineID', + :'description' => :'description', + :'is_employer_tax' => :'isEmployerTax', + :'amount' => :'amount', + :'global_tax_type_id' => :'globalTaxTypeID', + :'manual_adjustment' => :'manualAdjustment' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tax_line_id' => :'String', + :'description' => :'String', + :'is_employer_tax' => :'Boolean', + :'amount' => :'Float', + :'global_tax_type_id' => :'String', + :'manual_adjustment' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TaxLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TaxLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tax_line_id') + self.tax_line_id = attributes[:'tax_line_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'is_employer_tax') + self.is_employer_tax = attributes[:'is_employer_tax'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'global_tax_type_id') + self.global_tax_type_id = attributes[:'global_tax_type_id'] + end + + if attributes.key?(:'manual_adjustment') + self.manual_adjustment = attributes[:'manual_adjustment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tax_line_id == o.tax_line_id && + description == o.description && + is_employer_tax == o.is_employer_tax && + amount == o.amount && + global_tax_type_id == o.global_tax_type_id && + manual_adjustment == o.manual_adjustment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tax_line_id, description, is_employer_tax, amount, global_tax_type_id, manual_adjustment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheet.rb b/lib/xero-ruby/models/payroll_uk/timesheet.rb new file mode 100644 index 00000000..a0e2b57b --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheet.rb @@ -0,0 +1,347 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Timesheet + # The Xero identifier for a Timesheet + attr_accessor :timesheet_id + + # The Xero identifier for the Payroll Calandar that the Timesheet applies to + attr_accessor :payroll_calendar_id + + # The Xero identifier for the Employee that the Timesheet is for + attr_accessor :employee_id + + # The Start Date of the Timesheet period (YYYY-MM-DD) + attr_accessor :start_date + + # The End Date of the Timesheet period (YYYY-MM-DD) + attr_accessor :end_date + + # Status of the timesheet + attr_accessor :status + DRAFT = "Draft".freeze + APPROVED = "Approved".freeze + COMPLETED = "Completed".freeze + + # The Total Hours of the Timesheet + attr_accessor :total_hours + + # The UTC date time that the Timesheet was last updated + attr_accessor :updated_date_utc + + + attr_accessor :timesheet_lines + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheet_id' => :'timesheetID', + :'payroll_calendar_id' => :'payrollCalendarID', + :'employee_id' => :'employeeID', + :'start_date' => :'startDate', + :'end_date' => :'endDate', + :'status' => :'status', + :'total_hours' => :'totalHours', + :'updated_date_utc' => :'updatedDateUTC', + :'timesheet_lines' => :'timesheetLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheet_id' => :'String', + :'payroll_calendar_id' => :'String', + :'employee_id' => :'String', + :'start_date' => :'Date', + :'end_date' => :'Date', + :'status' => :'String', + :'total_hours' => :'Float', + :'updated_date_utc' => :'DateTime', + :'timesheet_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Timesheet` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Timesheet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheet_id') + self.timesheet_id = attributes[:'timesheet_id'] + end + + if attributes.key?(:'payroll_calendar_id') + self.payroll_calendar_id = attributes[:'payroll_calendar_id'] + end + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'total_hours') + self.total_hours = attributes[:'total_hours'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'timesheet_lines') + if (value = attributes[:'timesheet_lines']).is_a?(Array) + self.timesheet_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @payroll_calendar_id.nil? + invalid_properties.push('invalid value for "payroll_calendar_id", payroll_calendar_id cannot be nil.') + end + + if @employee_id.nil? + invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.') + end + + if @start_date.nil? + invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') + end + + if @end_date.nil? + invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @payroll_calendar_id.nil? + return false if @employee_id.nil? + return false if @start_date.nil? + return false if @end_date.nil? + status_validator = EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheet_id == o.timesheet_id && + payroll_calendar_id == o.payroll_calendar_id && + employee_id == o.employee_id && + start_date == o.start_date && + end_date == o.end_date && + status == o.status && + total_hours == o.total_hours && + updated_date_utc == o.updated_date_utc && + timesheet_lines == o.timesheet_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheet_id, payroll_calendar_id, employee_id, start_date, end_date, status, total_hours, updated_date_utc, timesheet_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb b/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb new file mode 100644 index 00000000..69b7dd65 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb @@ -0,0 +1,258 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TimesheetEarningsLine + # Xero identifier for payroll timesheet earnings rate + attr_accessor :earnings_rate_id + + # Rate per unit for timesheet earnings line + attr_accessor :rate_per_unit + + # Timesheet earnings number of units + attr_accessor :number_of_units + + # Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + attr_accessor :fixed_amount + + # The amount of the timesheet earnings line. + attr_accessor :amount + + # Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line + attr_accessor :is_linked_to_timesheet + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'earnings_rate_id' => :'earningsRateID', + :'rate_per_unit' => :'ratePerUnit', + :'number_of_units' => :'numberOfUnits', + :'fixed_amount' => :'fixedAmount', + :'amount' => :'amount', + :'is_linked_to_timesheet' => :'isLinkedToTimesheet' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'earnings_rate_id' => :'String', + :'rate_per_unit' => :'Float', + :'number_of_units' => :'Float', + :'fixed_amount' => :'Float', + :'amount' => :'Float', + :'is_linked_to_timesheet' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TimesheetEarningsLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TimesheetEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'rate_per_unit') + self.rate_per_unit = attributes[:'rate_per_unit'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + + if attributes.key?(:'fixed_amount') + self.fixed_amount = attributes[:'fixed_amount'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'is_linked_to_timesheet') + self.is_linked_to_timesheet = attributes[:'is_linked_to_timesheet'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + earnings_rate_id == o.earnings_rate_id && + rate_per_unit == o.rate_per_unit && + number_of_units == o.number_of_units && + fixed_amount == o.fixed_amount && + amount == o.amount && + is_linked_to_timesheet == o.is_linked_to_timesheet + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [earnings_rate_id, rate_per_unit, number_of_units, fixed_amount, amount, is_linked_to_timesheet].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_line.rb b/lib/xero-ruby/models/payroll_uk/timesheet_line.rb new file mode 100644 index 00000000..b0226057 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheet_line.rb @@ -0,0 +1,263 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TimesheetLine + # The Xero identifier for a Timesheet Line + attr_accessor :timesheet_line_id + + # The Date that this Timesheet Line is for (YYYY-MM-DD) + attr_accessor :date + + # The Xero identifier for the Earnings Rate that the Timesheet is for + attr_accessor :earnings_rate_id + + # The Xero identifier for the Tracking Item that the Timesheet is for + attr_accessor :tracking_item_id + + # The Number of Units of the Timesheet Line + attr_accessor :number_of_units + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'timesheet_line_id' => :'timesheetLineID', + :'date' => :'date', + :'earnings_rate_id' => :'earningsRateID', + :'tracking_item_id' => :'trackingItemID', + :'number_of_units' => :'numberOfUnits' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'timesheet_line_id' => :'String', + :'date' => :'Date', + :'earnings_rate_id' => :'String', + :'tracking_item_id' => :'String', + :'number_of_units' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TimesheetLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TimesheetLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'timesheet_line_id') + self.timesheet_line_id = attributes[:'timesheet_line_id'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'earnings_rate_id') + self.earnings_rate_id = attributes[:'earnings_rate_id'] + end + + if attributes.key?(:'tracking_item_id') + self.tracking_item_id = attributes[:'tracking_item_id'] + end + + if attributes.key?(:'number_of_units') + self.number_of_units = attributes[:'number_of_units'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + if @earnings_rate_id.nil? + invalid_properties.push('invalid value for "earnings_rate_id", earnings_rate_id cannot be nil.') + end + + if @number_of_units.nil? + invalid_properties.push('invalid value for "number_of_units", number_of_units cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @date.nil? + return false if @earnings_rate_id.nil? + return false if @number_of_units.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timesheet_line_id == o.timesheet_line_id && + date == o.date && + earnings_rate_id == o.earnings_rate_id && + tracking_item_id == o.tracking_item_id && + number_of_units == o.number_of_units + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [timesheet_line_id, date, earnings_rate_id, tracking_item_id, number_of_units].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb b/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb new file mode 100644 index 00000000..671f515c --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TimesheetLineObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheet_line + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheet_line' => :'timesheetLine' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheet_line' => :'TimesheetLine' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TimesheetLineObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TimesheetLineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheet_line') + self.timesheet_line = attributes[:'timesheet_line'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheet_line == o.timesheet_line + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheet_line].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_object.rb b/lib/xero-ruby/models/payroll_uk/timesheet_object.rb new file mode 100644 index 00000000..74349b08 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheet_object.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TimesheetObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheet + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheet' => :'timesheet' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheet' => :'Timesheet' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TimesheetObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TimesheetObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheet') + self.timesheet = attributes[:'timesheet'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheet == o.timesheet + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheet].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/timesheets.rb b/lib/xero-ruby/models/payroll_uk/timesheets.rb new file mode 100644 index 00000000..0ecaf13a --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/timesheets.rb @@ -0,0 +1,230 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class Timesheets + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :timesheets + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'timesheets' => :'timesheets' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'timesheets' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Timesheets` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Timesheets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'timesheets') + if (value = attributes[:'timesheets']).is_a?(Array) + self.timesheets = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + timesheets == o.timesheets + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, timesheets].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/tracking_categories.rb b/lib/xero-ruby/models/payroll_uk/tracking_categories.rb new file mode 100644 index 00000000..d6079870 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/tracking_categories.rb @@ -0,0 +1,228 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TrackingCategories + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :tracking_categories + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'tracking_categories' => :'trackingCategories' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'tracking_categories' => :'TrackingCategory' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TrackingCategories` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TrackingCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'problem') + self.problem = attributes[:'problem'] + end + + if attributes.key?(:'tracking_categories') + self.tracking_categories = attributes[:'tracking_categories'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + problem == o.problem && + tracking_categories == o.tracking_categories + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, problem, tracking_categories].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/payroll_uk/tracking_category.rb b/lib/xero-ruby/models/payroll_uk/tracking_category.rb new file mode 100644 index 00000000..c143fe92 --- /dev/null +++ b/lib/xero-ruby/models/payroll_uk/tracking_category.rb @@ -0,0 +1,218 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::PayrollUk + require 'bigdecimal' + + class TrackingCategory + # The Xero identifier for Employee groups tracking category. + attr_accessor :employee_groups_tracking_category_id + + # The Xero identifier for Timesheet tracking category. + attr_accessor :timesheet_tracking_category_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_groups_tracking_category_id' => :'employeeGroupsTrackingCategoryID', + :'timesheet_tracking_category_id' => :'timesheetTrackingCategoryID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_groups_tracking_category_id' => :'String', + :'timesheet_tracking_category_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::TrackingCategory` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::TrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_groups_tracking_category_id') + self.employee_groups_tracking_category_id = attributes[:'employee_groups_tracking_category_id'] + end + + if attributes.key?(:'timesheet_tracking_category_id') + self.timesheet_tracking_category_id = attributes[:'timesheet_tracking_category_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_groups_tracking_category_id == o.employee_groups_tracking_category_id && + timesheet_tracking_category_id == o.timesheet_tracking_category_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_groups_tracking_category_id, timesheet_tracking_category_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BigDecimal + BigDecimal(value.to_s) + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::PayrollUk.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/amount.rb b/lib/xero-ruby/models/projects/amount.rb index 9f974745..fa6984ab 100644 --- a/lib/xero-ruby/models/projects/amount.rb +++ b/lib/xero-ruby/models/projects/amount.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/charge_type.rb b/lib/xero-ruby/models/projects/charge_type.rb index aca7bb7b..fa4df5da 100644 --- a/lib/xero-ruby/models/projects/charge_type.rb +++ b/lib/xero-ruby/models/projects/charge_type.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/currency_code.rb b/lib/xero-ruby/models/projects/currency_code.rb index e475b204..d80b44c3 100644 --- a/lib/xero-ruby/models/projects/currency_code.rb +++ b/lib/xero-ruby/models/projects/currency_code.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/error.rb b/lib/xero-ruby/models/projects/error.rb index c4ef06a9..986ae7b5 100644 --- a/lib/xero-ruby/models/projects/error.rb +++ b/lib/xero-ruby/models/projects/error.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/pagination.rb b/lib/xero-ruby/models/projects/pagination.rb index 48b91d15..619c839f 100644 --- a/lib/xero-ruby/models/projects/pagination.rb +++ b/lib/xero-ruby/models/projects/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project.rb b/lib/xero-ruby/models/projects/project.rb index 40121fe4..529994b2 100644 --- a/lib/xero-ruby/models/projects/project.rb +++ b/lib/xero-ruby/models/projects/project.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_create_or_update.rb b/lib/xero-ruby/models/projects/project_create_or_update.rb index 128bff83..a873b80f 100644 --- a/lib/xero-ruby/models/projects/project_create_or_update.rb +++ b/lib/xero-ruby/models/projects/project_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_patch.rb b/lib/xero-ruby/models/projects/project_patch.rb index fcf437ab..ee6cc671 100644 --- a/lib/xero-ruby/models/projects/project_patch.rb +++ b/lib/xero-ruby/models/projects/project_patch.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_status.rb b/lib/xero-ruby/models/projects/project_status.rb index 4c47b4d0..f5841dcb 100644 --- a/lib/xero-ruby/models/projects/project_status.rb +++ b/lib/xero-ruby/models/projects/project_status.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_user.rb b/lib/xero-ruby/models/projects/project_user.rb index 72447a3f..75a36aa0 100644 --- a/lib/xero-ruby/models/projects/project_user.rb +++ b/lib/xero-ruby/models/projects/project_user.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_users.rb b/lib/xero-ruby/models/projects/project_users.rb index a1470347..010f41c6 100644 --- a/lib/xero-ruby/models/projects/project_users.rb +++ b/lib/xero-ruby/models/projects/project_users.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/projects.rb b/lib/xero-ruby/models/projects/projects.rb index d1c48891..f8046314 100644 --- a/lib/xero-ruby/models/projects/projects.rb +++ b/lib/xero-ruby/models/projects/projects.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task.rb b/lib/xero-ruby/models/projects/task.rb index a241da5b..f14880da 100644 --- a/lib/xero-ruby/models/projects/task.rb +++ b/lib/xero-ruby/models/projects/task.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task_create_or_update.rb b/lib/xero-ruby/models/projects/task_create_or_update.rb index 2a40884b..495fa2b6 100644 --- a/lib/xero-ruby/models/projects/task_create_or_update.rb +++ b/lib/xero-ruby/models/projects/task_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/tasks.rb b/lib/xero-ruby/models/projects/tasks.rb index ae9e2c2b..9411d9db 100644 --- a/lib/xero-ruby/models/projects/tasks.rb +++ b/lib/xero-ruby/models/projects/tasks.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entries.rb b/lib/xero-ruby/models/projects/time_entries.rb index 80106d73..b8b18acd 100644 --- a/lib/xero-ruby/models/projects/time_entries.rb +++ b/lib/xero-ruby/models/projects/time_entries.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry.rb b/lib/xero-ruby/models/projects/time_entry.rb index 6a03d3f2..da17cc51 100644 --- a/lib/xero-ruby/models/projects/time_entry.rb +++ b/lib/xero-ruby/models/projects/time_entry.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb index ac59091d..0bd72b49 100644 --- a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +++ b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index bfb54c0f..fa9f002b 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -11,5 +11,5 @@ =end module XeroRuby - VERSION = '2.2.4' + VERSION = '2.3.0' end diff --git a/spec/files/api/files_api_spec.rb b/spec/files/api/files_api_spec.rb new file mode 100644 index 00000000..8aeb57c0 --- /dev/null +++ b/spec/files/api/files_api_spec.rb @@ -0,0 +1,249 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for XeroRuby::Files::FilesApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FilesApi' do + before do + # run before each test + @api_instance = XeroRuby::Files::FilesApi.new + end + + after do + # run after each test + end + + describe 'test an instance of FilesApi' do + it 'should create an instance of FilesApi' do + expect(@api_instance).to be_instance_of(XeroRuby::Files::FilesApi) + end + end + + # unit tests for create_file_association + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @option opts [Association] :association + # @return [Association] + describe 'create_file_association test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_folder + # create a new folder + # By passing in the appropriate properties, you can create a new folder + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Folder] :folder + # @return [Folder] + describe 'create_folder test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_file + # delete a file + # Delete a specific file + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + describe 'delete_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_file_association + # create a new association + # By passing in the appropriate options, you can create a new folder + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param object_id Object id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + describe 'delete_file_association test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_folder + # delete a folder + # By passing in the appropriate ID, you can delete a folder + # @param xero_tenant_id Xero identifier for Tenant + # @param folder_id Folder id for single object + # @param [Hash] opts the optional parameters + # @return [FileResponse204] + describe 'delete_folder test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_associations_by_object + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id Xero identifier for Tenant + # @param object_id Object id for single object + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'get_associations_by_object test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_file + # searches for file by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @return [FileObject] + describe 'get_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_file_associations + # searches files + # By passing in the appropriate options, + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'get_file_associations test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_file_content + # searches files to retrieve the data + # By passing in the appropriate options, retrieve data for specific file + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @return [File] + describe 'get_file_content test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_files + # searches files + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :pagesize pass an optional page size value + # @option opts [Integer] :page number of records to skip for pagination + # @option opts [String] :sort values to sort by + # @return [Files] + describe 'get_files test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_folder + # searches specific folder by id + # By passing in the appropriate ID, you can search for specific folder + # @param xero_tenant_id Xero identifier for Tenant + # @param folder_id Folder id for single object + # @param [Hash] opts the optional parameters + # @return [Folder] + describe 'get_folder test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_folders + # searches folder + # By passing in the appropriate options, you can search for available folders + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :sort values to sort by + # @return [Array] + describe 'get_folders test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_inbox + # searches inbox folder + # Search for the user inbox + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Folder] + describe 'get_inbox test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_file + # Update a file + # Update properties on a single file + # @param xero_tenant_id Xero identifier for Tenant + # @param file_id File id for single object + # @param [Hash] opts the optional parameters + # @option opts [FileObject] :file_object + # @return [FileObject] + describe 'update_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_folder + # update folder + # By passing in the appropriate ID and properties, you can update a folder + # @param xero_tenant_id Xero identifier for Tenant + # @param folder_id Folder id for single object + # @param folder + # @param [Hash] opts the optional parameters + # @return [Folder] + describe 'update_folder test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_file + # upload an File + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :folder_id pass an optional folder id to save file to specific folder + # @option opts [String] :body + # @option opts [String] :name exact name of the file you are uploading + # @option opts [String] :filename + # @option opts [String] :mime_type + # @return [FileObject] + describe 'upload_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/association_spec.rb b/spec/files/models/association_spec.rb new file mode 100644 index 00000000..b8097d69 --- /dev/null +++ b/spec/files/models/association_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::Association +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Association' do + before do + # run before each test + @instance = XeroRuby::Files::Association.new + end + + after do + # run after each test + end + + describe 'test an instance of Association' do + it 'should create an instance of Association' do + expect(@instance).to be_instance_of(XeroRuby::Files::Association) + end + end + describe 'test attribute "file_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_group"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/file_object_spec.rb b/spec/files/models/file_object_spec.rb new file mode 100644 index 00000000..452556ff --- /dev/null +++ b/spec/files/models/file_object_spec.rb @@ -0,0 +1,83 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::FileObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FileObject' do + before do + # run before each test + @instance = XeroRuby::Files::FileObject.new + end + + after do + # run after each test + end + + describe 'test an instance of FileObject' do + it 'should create an instance of FileObject' do + expect(@instance).to be_instance_of(XeroRuby::Files::FileObject) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mime_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "user"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "folder_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/file_response204_spec.rb b/spec/files/models/file_response204_spec.rb new file mode 100644 index 00000000..2e227873 --- /dev/null +++ b/spec/files/models/file_response204_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::FileResponse204 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FileResponse204' do + before do + # run before each test + @instance = XeroRuby::Files::FileResponse204.new + end + + after do + # run after each test + end + + describe 'test an instance of FileResponse204' do + it 'should create an instance of FileResponse204' do + expect(@instance).to be_instance_of(XeroRuby::Files::FileResponse204) + end + end + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/files_spec.rb b/spec/files/models/files_spec.rb new file mode 100644 index 00000000..ff179b69 --- /dev/null +++ b/spec/files/models/files_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::Files +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Files' do + before do + # run before each test + @instance = XeroRuby::Files::Files.new + end + + after do + # run after each test + end + + describe 'test an instance of Files' do + it 'should create an instance of Files' do + expect(@instance).to be_instance_of(XeroRuby::Files::Files) + end + end + describe 'test attribute "total_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "per_page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/folder_spec.rb b/spec/files/models/folder_spec.rb new file mode 100644 index 00000000..3d20ba9d --- /dev/null +++ b/spec/files/models/folder_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::Folder +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Folder' do + before do + # run before each test + @instance = XeroRuby::Files::Folder.new + end + + after do + # run after each test + end + + describe 'test an instance of Folder' do + it 'should create an instance of Folder' do + expect(@instance).to be_instance_of(XeroRuby::Files::Folder) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_inbox"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/folders_spec.rb b/spec/files/models/folders_spec.rb new file mode 100644 index 00000000..bdaa0da4 --- /dev/null +++ b/spec/files/models/folders_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::Folders +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Folders' do + before do + # run before each test + @instance = XeroRuby::Files::Folders.new + end + + after do + # run after each test + end + + describe 'test an instance of Folders' do + it 'should create an instance of Folders' do + expect(@instance).to be_instance_of(XeroRuby::Files::Folders) + end + end + describe 'test attribute "folders"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/inline_object_spec.rb b/spec/files/models/inline_object_spec.rb new file mode 100644 index 00000000..9aea65ee --- /dev/null +++ b/spec/files/models/inline_object_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::InlineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject' do + before do + # run before each test + @instance = XeroRuby::Files::InlineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject' do + it 'should create an instance of InlineObject' do + expect(@instance).to be_instance_of(XeroRuby::Files::InlineObject) + end + end + describe 'test attribute "body"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "filename"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mime_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/files/models/object_group_spec.rb b/spec/files/models/object_group_spec.rb new file mode 100644 index 00000000..44b798bb --- /dev/null +++ b/spec/files/models/object_group_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::ObjectGroup +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ObjectGroup' do + before do + # run before each test + @instance = XeroRuby::Files::ObjectGroup.new + end + + after do + # run after each test + end + + describe 'test an instance of ObjectGroup' do + it 'should create an instance of ObjectGroup' do + expect(@instance).to be_instance_of(XeroRuby::Files::ObjectGroup) + end + end +end diff --git a/spec/files/models/object_type_spec.rb b/spec/files/models/object_type_spec.rb new file mode 100644 index 00000000..9fc5eda1 --- /dev/null +++ b/spec/files/models/object_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::ObjectType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ObjectType' do + before do + # run before each test + @instance = XeroRuby::Files::ObjectType.new + end + + after do + # run after each test + end + + describe 'test an instance of ObjectType' do + it 'should create an instance of ObjectType' do + expect(@instance).to be_instance_of(XeroRuby::Files::ObjectType) + end + end +end diff --git a/spec/files/models/user_spec.rb b/spec/files/models/user_spec.rb new file mode 100644 index 00000000..80efdd4a --- /dev/null +++ b/spec/files/models/user_spec.rb @@ -0,0 +1,81 @@ +=begin +#Xero Files API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Files::User +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'User' do + before do + # run before each test + @instance = XeroRuby::Files::User.new + end + + after do + # run after each test + end + + describe 'test an instance of User' do + it 'should create an instance of User' do + expect(@instance).to be_instance_of(XeroRuby::Files::User) + end + end + describe 'test attribute "user_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email_address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_subscriber"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "organisation_role"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT"]) + # validator.allowable_values.each do |value| + # expect { @instance.organisation_role = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_au/api/payroll_au_api_spec.rb b/spec/payroll_au/api/payroll_au_api_spec.rb new file mode 100644 index 00000000..fe414205 --- /dev/null +++ b/spec/payroll_au/api/payroll_au_api_spec.rb @@ -0,0 +1,415 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for XeroRuby::PayrollAu::PayrollAuApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayrollAuApi' do + before do + # run before each test + @api_instance = XeroRuby::PayrollAu::PayrollAuApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PayrollAuApi' do + it 'should create an instance of PayrollAuApi' do + expect(@api_instance).to be_instance_of(XeroRuby::PayrollAu::PayrollAuApi) + end + end + + # unit tests for create_employee + # Use this method to create a payroll employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee + # @param [Hash] opts the optional parameters + # @return [Employees] + describe 'create_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_leave_application + # Use this method to create a Leave Application + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_application + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + describe 'create_leave_application test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_pay_item + # Use this method to create a Pay Item + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_item + # @param [Hash] opts the optional parameters + # @return [PayItems] + describe 'create_pay_item test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_pay_run + # Use this method to create a PayRun + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run + # @param [Hash] opts the optional parameters + # @return [PayRuns] + describe 'create_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_payroll_calendar + # Use this method to create a Payroll Calendars + # @param xero_tenant_id Xero identifier for Tenant + # @param payroll_calendar + # @param [Hash] opts the optional parameters + # @return [PayrollCalendars] + describe 'create_payroll_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_superfund + # Use this method to create a super fund + # @param xero_tenant_id Xero identifier for Tenant + # @param super_fund + # @param [Hash] opts the optional parameters + # @return [SuperFunds] + describe 'create_superfund test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_timesheet + # Use this method to create a timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet + # @param [Hash] opts the optional parameters + # @return [Timesheets] + describe 'create_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee + # searches for an employee by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [Employees] + describe 'get_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employees + # searches employees + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 employees will be returned in a single API call + # @return [Employees] + describe 'get_employees test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_application + # searches for an Leave Application by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_application_id Leave Application id for single object + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + describe 'get_leave_application test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_applications + # searches Leave Applications + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [LeaveApplications] + describe 'get_leave_applications test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_items + # searches Pay Items + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [PayItems] + describe 'get_pay_items test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run + # searches for an payrun by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id PayRun id for single object + # @param [Hash] opts the optional parameters + # @return [PayRuns] + describe 'get_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_runs + # searches PayRuns + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + # @return [PayRuns] + describe 'get_pay_runs test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_payroll_calendar + # searches Payroll Calendars + # @param xero_tenant_id Xero identifier for Tenant + # @param payroll_calendar_id Payroll Calendar id for single object + # @param [Hash] opts the optional parameters + # @return [PayrollCalendars] + describe 'get_payroll_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_payroll_calendars + # searches Payroll Calendars + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 objects will be returned in a single API call + # @return [PayrollCalendars] + describe 'get_payroll_calendars test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_payslip + # searches for an payslip by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param payslip_id Payslip id for single object + # @param [Hash] opts the optional parameters + # @return [PayslipObject] + describe 'get_payslip test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_settings + # retrieve settings + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [SettingsObject] + describe 'get_settings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_superfund + # searches for an Superfund by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param super_fund_id Superfund id for single object + # @param [Hash] opts the optional parameters + # @return [SuperFunds] + describe 'get_superfund test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_superfund_products + # searches SuperfundProducts + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :abn The ABN of the Regulated SuperFund + # @option opts [String] :usi The USI of the Regulated SuperFund + # @return [SuperFundProducts] + describe 'get_superfund_products test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_superfunds + # searches SuperFunds + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + # @return [SuperFunds] + describe 'get_superfunds test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheet + # searches for an timesheet by unique id + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Timesheet id for single object + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'get_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheets + # searches timesheets + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + # @return [Timesheets] + describe 'get_timesheets test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee + # Update an Employee + # Update properties on a single employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :employee + # @return [Employees] + describe 'update_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_leave_application + # Use this method to update a Leave Application + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_application_id Leave Application id for single object + # @param leave_application + # @param [Hash] opts the optional parameters + # @return [LeaveApplications] + describe 'update_leave_application test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pay_run + # Update a PayRun + # Update properties on a single PayRun + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id PayRun id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :pay_run + # @return [PayRuns] + describe 'update_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_payslip + # Update a Payslip + # Update lines on a single payslips + # @param xero_tenant_id Xero identifier for Tenant + # @param payslip_id Payslip id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :payslip_lines + # @return [Payslips] + describe 'update_payslip test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_superfund + # Update a Superfund + # Update properties on a single Superfund + # @param xero_tenant_id Xero identifier for Tenant + # @param super_fund_id Superfund id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :super_fund + # @return [SuperFunds] + describe 'update_superfund test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_timesheet + # Update a Timesheet + # Update properties on a single timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Timesheet id for single object + # @param [Hash] opts the optional parameters + # @option opts [Array] :timesheet + # @return [Timesheets] + describe 'update_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/account_spec.rb b/spec/payroll_au/models/account_spec.rb new file mode 100644 index 00000000..9ab27d85 --- /dev/null +++ b/spec/payroll_au/models/account_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Account +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Account' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Account.new + end + + after do + # run after each test + end + + describe 'test an instance of Account' do + it 'should create an instance of Account' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Account) + end + end + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/account_type_spec.rb b/spec/payroll_au/models/account_type_spec.rb new file mode 100644 index 00000000..2fe41be4 --- /dev/null +++ b/spec/payroll_au/models/account_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::AccountType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AccountType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::AccountType.new + end + + after do + # run after each test + end + + describe 'test an instance of AccountType' do + it 'should create an instance of AccountType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::AccountType) + end + end +end diff --git a/spec/payroll_au/models/allowance_type_spec.rb b/spec/payroll_au/models/allowance_type_spec.rb new file mode 100644 index 00000000..703009b6 --- /dev/null +++ b/spec/payroll_au/models/allowance_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::AllowanceType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AllowanceType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::AllowanceType.new + end + + after do + # run after each test + end + + describe 'test an instance of AllowanceType' do + it 'should create an instance of AllowanceType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::AllowanceType) + end + end +end diff --git a/spec/payroll_au/models/api_exception_spec.rb b/spec/payroll_au/models/api_exception_spec.rb new file mode 100644 index 00000000..941b1393 --- /dev/null +++ b/spec/payroll_au/models/api_exception_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::APIException +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'APIException' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::APIException.new + end + + after do + # run after each test + end + + describe 'test an instance of APIException' do + it 'should create an instance of APIException' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::APIException) + end + end + describe 'test attribute "error_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/bank_account_spec.rb b/spec/payroll_au/models/bank_account_spec.rb new file mode 100644 index 00000000..0c5ce4c5 --- /dev/null +++ b/spec/payroll_au/models/bank_account_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::BankAccount +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BankAccount' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::BankAccount.new + end + + after do + # run after each test + end + + describe 'test an instance of BankAccount' do + it 'should create an instance of BankAccount' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::BankAccount) + end + end + describe 'test attribute "statement_text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bsb"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "remainder"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/calendar_type_spec.rb b/spec/payroll_au/models/calendar_type_spec.rb new file mode 100644 index 00000000..02648f3a --- /dev/null +++ b/spec/payroll_au/models/calendar_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::CalendarType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CalendarType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::CalendarType.new + end + + after do + # run after each test + end + + describe 'test an instance of CalendarType' do + it 'should create an instance of CalendarType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::CalendarType) + end + end +end diff --git a/spec/payroll_au/models/deduction_line_spec.rb b/spec/payroll_au/models/deduction_line_spec.rb new file mode 100644 index 00000000..500fe113 --- /dev/null +++ b/spec/payroll_au/models/deduction_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::DeductionLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::DeductionLine.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionLine' do + it 'should create an instance of DeductionLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::DeductionLine) + end + end + describe 'test attribute "deduction_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/deduction_type_calculation_type_spec.rb b/spec/payroll_au/models/deduction_type_calculation_type_spec.rb new file mode 100644 index 00000000..34116708 --- /dev/null +++ b/spec/payroll_au/models/deduction_type_calculation_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::DeductionTypeCalculationType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionTypeCalculationType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::DeductionTypeCalculationType.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionTypeCalculationType' do + it 'should create an instance of DeductionTypeCalculationType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::DeductionTypeCalculationType) + end + end +end diff --git a/spec/payroll_au/models/deduction_type_spec.rb b/spec/payroll_au/models/deduction_type_spec.rb new file mode 100644 index 00000000..506d91ca --- /dev/null +++ b/spec/payroll_au/models/deduction_type_spec.rb @@ -0,0 +1,93 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::DeductionType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::DeductionType.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionType' do + it 'should create an instance of DeductionType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::DeductionType) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reduces_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reduces_super"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_exempt_from_w1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["NONE", "UNIONFEES", "WORKPLACEGIVING"]) + # validator.allowable_values.each do |value| + # expect { @instance.deduction_category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/earnings_line_spec.rb b/spec/payroll_au/models/earnings_line_spec.rb new file mode 100644 index 00000000..5901e6a7 --- /dev/null +++ b/spec/payroll_au/models/earnings_line_spec.rb @@ -0,0 +1,89 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsLine' do + it 'should create an instance of EarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EarningsLine) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_salary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units_per_week"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "normal_number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/earnings_rate_calculation_type_spec.rb b/spec/payroll_au/models/earnings_rate_calculation_type_spec.rb new file mode 100644 index 00000000..9b0c952f --- /dev/null +++ b/spec/payroll_au/models/earnings_rate_calculation_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EarningsRateCalculationType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRateCalculationType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EarningsRateCalculationType.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRateCalculationType' do + it 'should create an instance of EarningsRateCalculationType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EarningsRateCalculationType) + end + end +end diff --git a/spec/payroll_au/models/earnings_rate_spec.rb b/spec/payroll_au/models/earnings_rate_spec.rb new file mode 100644 index 00000000..a21a3c75 --- /dev/null +++ b/spec/payroll_au/models/earnings_rate_spec.rb @@ -0,0 +1,137 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EarningsRate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRate' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EarningsRate.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRate' do + it 'should create an instance of EarningsRate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EarningsRate) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_exempt_from_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_exempt_from_super"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_reportable_as_w1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "multiplier"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "accrue_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employment_termination_payment_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "allowance_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/earnings_type_spec.rb b/spec/payroll_au/models/earnings_type_spec.rb new file mode 100644 index 00000000..05c6f8f2 --- /dev/null +++ b/spec/payroll_au/models/earnings_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EarningsType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EarningsType.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsType' do + it 'should create an instance of EarningsType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EarningsType) + end + end +end diff --git a/spec/payroll_au/models/employee_spec.rb b/spec/payroll_au/models/employee_spec.rb new file mode 100644 index 00000000..40231a45 --- /dev/null +++ b/spec/payroll_au/models/employee_spec.rb @@ -0,0 +1,225 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Employee +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employee' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Employee.new + end + + after do + # run after each test + end + + describe 'test an instance of Employee' do + it 'should create an instance of Employee' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Employee) + end + end + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_of_birth"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "home_address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "middle_names"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gender"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["N", "M", "F", "I"]) + # validator.allowable_values.each do |value| + # expect { @instance.gender = value }.not_to raise_error + # end + end + end + + describe 'test attribute "phone"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mobile"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "twitter_user_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_authorised_to_approve_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_authorised_to_approve_timesheets"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "job_title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "classification"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ordinary_earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_group_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "termination_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bank_accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opening_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_declaration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "super_memberships"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/employee_status_spec.rb b/spec/payroll_au/models/employee_status_spec.rb new file mode 100644 index 00000000..d2fef027 --- /dev/null +++ b/spec/payroll_au/models/employee_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EmployeeStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatus' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EmployeeStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatus' do + it 'should create an instance of EmployeeStatus' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EmployeeStatus) + end + end +end diff --git a/spec/payroll_au/models/employees_spec.rb b/spec/payroll_au/models/employees_spec.rb new file mode 100644 index 00000000..1523ae13 --- /dev/null +++ b/spec/payroll_au/models/employees_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Employees +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employees' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Employees.new + end + + after do + # run after each test + end + + describe 'test an instance of Employees' do + it 'should create an instance of Employees' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Employees) + end + end + describe 'test attribute "employees"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/employment_basis_spec.rb b/spec/payroll_au/models/employment_basis_spec.rb new file mode 100644 index 00000000..a64acdc7 --- /dev/null +++ b/spec/payroll_au/models/employment_basis_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EmploymentBasis +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmploymentBasis' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EmploymentBasis.new + end + + after do + # run after each test + end + + describe 'test an instance of EmploymentBasis' do + it 'should create an instance of EmploymentBasis' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EmploymentBasis) + end + end +end diff --git a/spec/payroll_au/models/employment_termination_payment_type_spec.rb b/spec/payroll_au/models/employment_termination_payment_type_spec.rb new file mode 100644 index 00000000..b658f3c5 --- /dev/null +++ b/spec/payroll_au/models/employment_termination_payment_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EmploymentTerminationPaymentType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmploymentTerminationPaymentType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EmploymentTerminationPaymentType.new + end + + after do + # run after each test + end + + describe 'test an instance of EmploymentTerminationPaymentType' do + it 'should create an instance of EmploymentTerminationPaymentType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EmploymentTerminationPaymentType) + end + end +end diff --git a/spec/payroll_au/models/entitlement_final_pay_payout_type_spec.rb b/spec/payroll_au/models/entitlement_final_pay_payout_type_spec.rb new file mode 100644 index 00000000..fd31003c --- /dev/null +++ b/spec/payroll_au/models/entitlement_final_pay_payout_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::EntitlementFinalPayPayoutType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EntitlementFinalPayPayoutType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::EntitlementFinalPayPayoutType.new + end + + after do + # run after each test + end + + describe 'test an instance of EntitlementFinalPayPayoutType' do + it 'should create an instance of EntitlementFinalPayPayoutType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::EntitlementFinalPayPayoutType) + end + end +end diff --git a/spec/payroll_au/models/home_address_spec.rb b/spec/payroll_au/models/home_address_spec.rb new file mode 100644 index 00000000..e7d55043 --- /dev/null +++ b/spec/payroll_au/models/home_address_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::HomeAddress +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'HomeAddress' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::HomeAddress.new + end + + after do + # run after each test + end + + describe 'test an instance of HomeAddress' do + it 'should create an instance of HomeAddress' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::HomeAddress) + end + end + describe 'test attribute "address_line1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address_line2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "city"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "region"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "postal_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "country"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_accrual_line_spec.rb b/spec/payroll_au/models/leave_accrual_line_spec.rb new file mode 100644 index 00000000..d68a5a95 --- /dev/null +++ b/spec/payroll_au/models/leave_accrual_line_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveAccrualLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveAccrualLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveAccrualLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveAccrualLine' do + it 'should create an instance of LeaveAccrualLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveAccrualLine) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "auto_calculate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_application_spec.rb b/spec/payroll_au/models/leave_application_spec.rb new file mode 100644 index 00000000..1653e9d9 --- /dev/null +++ b/spec/payroll_au/models/leave_application_spec.rb @@ -0,0 +1,95 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveApplication +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveApplication' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveApplication.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveApplication' do + it 'should create an instance of LeaveApplication' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveApplication) + end + end + describe 'test attribute "leave_application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_periods"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_applications_spec.rb b/spec/payroll_au/models/leave_applications_spec.rb new file mode 100644 index 00000000..6c4d35e9 --- /dev/null +++ b/spec/payroll_au/models/leave_applications_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveApplications +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveApplications' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveApplications.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveApplications' do + it 'should create an instance of LeaveApplications' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveApplications) + end + end + describe 'test attribute "leave_applications"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_balance_spec.rb b/spec/payroll_au/models/leave_balance_spec.rb new file mode 100644 index 00000000..7d55f855 --- /dev/null +++ b/spec/payroll_au/models/leave_balance_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveBalance' do + it 'should create an instance of LeaveBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveBalance) + end + end + describe 'test attribute "leave_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_earnings_line_spec.rb b/spec/payroll_au/models/leave_earnings_line_spec.rb new file mode 100644 index 00000000..0846258f --- /dev/null +++ b/spec/payroll_au/models/leave_earnings_line_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveEarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveEarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveEarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveEarningsLine' do + it 'should create an instance of LeaveEarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveEarningsLine) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_line_calculation_type_spec.rb b/spec/payroll_au/models/leave_line_calculation_type_spec.rb new file mode 100644 index 00000000..d3126b90 --- /dev/null +++ b/spec/payroll_au/models/leave_line_calculation_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveLineCalculationType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveLineCalculationType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveLineCalculationType.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveLineCalculationType' do + it 'should create an instance of LeaveLineCalculationType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveLineCalculationType) + end + end +end diff --git a/spec/payroll_au/models/leave_line_spec.rb b/spec/payroll_au/models/leave_line_spec.rb new file mode 100644 index 00000000..9afbb6ef --- /dev/null +++ b/spec/payroll_au/models/leave_line_spec.rb @@ -0,0 +1,83 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveLine' do + it 'should create an instance of LeaveLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveLine) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_final_pay_payout_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employment_termination_payment_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "include_superannuation_guarantee_contribution"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "full_time_number_of_units_per_period"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_lines_spec.rb b/spec/payroll_au/models/leave_lines_spec.rb new file mode 100644 index 00000000..91c40159 --- /dev/null +++ b/spec/payroll_au/models/leave_lines_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveLines +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveLines' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveLines.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveLines' do + it 'should create an instance of LeaveLines' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveLines) + end + end + describe 'test attribute "employee"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_period_spec.rb b/spec/payroll_au/models/leave_period_spec.rb new file mode 100644 index 00000000..02154841 --- /dev/null +++ b/spec/payroll_au/models/leave_period_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeavePeriod +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriod' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeavePeriod.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriod' do + it 'should create an instance of LeavePeriod' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeavePeriod) + end + end + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_period_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/leave_period_status_spec.rb b/spec/payroll_au/models/leave_period_status_spec.rb new file mode 100644 index 00000000..a40ac5cb --- /dev/null +++ b/spec/payroll_au/models/leave_period_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeavePeriodStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriodStatus' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeavePeriodStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriodStatus' do + it 'should create an instance of LeavePeriodStatus' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeavePeriodStatus) + end + end +end diff --git a/spec/payroll_au/models/leave_type_contribution_type_spec.rb b/spec/payroll_au/models/leave_type_contribution_type_spec.rb new file mode 100644 index 00000000..bc8d0959 --- /dev/null +++ b/spec/payroll_au/models/leave_type_contribution_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveTypeContributionType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveTypeContributionType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveTypeContributionType.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveTypeContributionType' do + it 'should create an instance of LeaveTypeContributionType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveTypeContributionType) + end + end +end diff --git a/spec/payroll_au/models/leave_type_spec.rb b/spec/payroll_au/models/leave_type_spec.rb new file mode 100644 index 00000000..e4a6d866 --- /dev/null +++ b/spec/payroll_au/models/leave_type_spec.rb @@ -0,0 +1,89 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::LeaveType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::LeaveType.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveType' do + it 'should create an instance of LeaveType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::LeaveType) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "normal_entitlement"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_loading_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_paid_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "show_on_payslip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/manual_tax_type_spec.rb b/spec/payroll_au/models/manual_tax_type_spec.rb new file mode 100644 index 00000000..579161b0 --- /dev/null +++ b/spec/payroll_au/models/manual_tax_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ManualTaxType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ManualTaxType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ManualTaxType.new + end + + after do + # run after each test + end + + describe 'test an instance of ManualTaxType' do + it 'should create an instance of ManualTaxType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ManualTaxType) + end + end +end diff --git a/spec/payroll_au/models/opening_balances_spec.rb b/spec/payroll_au/models/opening_balances_spec.rb new file mode 100644 index 00000000..fbf7ae8f --- /dev/null +++ b/spec/payroll_au/models/opening_balances_spec.rb @@ -0,0 +1,77 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::OpeningBalances +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OpeningBalances' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::OpeningBalances.new + end + + after do + # run after each test + end + + describe 'test an instance of OpeningBalances' do + it 'should create an instance of OpeningBalances' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::OpeningBalances) + end + end + describe 'test attribute "opening_balance_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "super_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/pay_item_spec.rb b/spec/payroll_au/models/pay_item_spec.rb new file mode 100644 index 00000000..7318c9f4 --- /dev/null +++ b/spec/payroll_au/models/pay_item_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayItem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayItem' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayItem.new + end + + after do + # run after each test + end + + describe 'test an instance of PayItem' do + it 'should create an instance of PayItem' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayItem) + end + end + describe 'test attribute "earnings_rates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/pay_items_spec.rb b/spec/payroll_au/models/pay_items_spec.rb new file mode 100644 index 00000000..2a13b159 --- /dev/null +++ b/spec/payroll_au/models/pay_items_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayItems +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayItems' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayItems.new + end + + after do + # run after each test + end + + describe 'test an instance of PayItems' do + it 'should create an instance of PayItems' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayItems) + end + end + describe 'test attribute "pay_items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/pay_run_spec.rb b/spec/payroll_au/models/pay_run_spec.rb new file mode 100644 index 00000000..d56e8620 --- /dev/null +++ b/spec/payroll_au/models/pay_run_spec.rb @@ -0,0 +1,131 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayRun +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRun' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayRun.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRun' do + it 'should create an instance of PayRun' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayRun) + end + end + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payslip_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payslips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_super"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "net_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/pay_run_status_spec.rb b/spec/payroll_au/models/pay_run_status_spec.rb new file mode 100644 index 00000000..7ade404c --- /dev/null +++ b/spec/payroll_au/models/pay_run_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayRunStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunStatus' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayRunStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunStatus' do + it 'should create an instance of PayRunStatus' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayRunStatus) + end + end +end diff --git a/spec/payroll_au/models/pay_runs_spec.rb b/spec/payroll_au/models/pay_runs_spec.rb new file mode 100644 index 00000000..e4a4ec46 --- /dev/null +++ b/spec/payroll_au/models/pay_runs_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayRuns +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRuns' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayRuns.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRuns' do + it 'should create an instance of PayRuns' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayRuns) + end + end + describe 'test attribute "pay_runs"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/pay_template_spec.rb b/spec/payroll_au/models/pay_template_spec.rb new file mode 100644 index 00000000..3b2f1c51 --- /dev/null +++ b/spec/payroll_au/models/pay_template_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayTemplate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayTemplate' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayTemplate.new + end + + after do + # run after each test + end + + describe 'test an instance of PayTemplate' do + it 'should create an instance of PayTemplate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayTemplate) + end + end + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "super_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payment_frequency_type_spec.rb b/spec/payroll_au/models/payment_frequency_type_spec.rb new file mode 100644 index 00000000..5336df88 --- /dev/null +++ b/spec/payroll_au/models/payment_frequency_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PaymentFrequencyType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentFrequencyType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PaymentFrequencyType.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentFrequencyType' do + it 'should create an instance of PaymentFrequencyType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PaymentFrequencyType) + end + end +end diff --git a/spec/payroll_au/models/payroll_calendar_spec.rb b/spec/payroll_au/models/payroll_calendar_spec.rb new file mode 100644 index 00000000..31d7e74d --- /dev/null +++ b/spec/payroll_au/models/payroll_calendar_spec.rb @@ -0,0 +1,77 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayrollCalendar +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayrollCalendar' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayrollCalendar.new + end + + after do + # run after each test + end + + describe 'test an instance of PayrollCalendar' do + it 'should create an instance of PayrollCalendar' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayrollCalendar) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calendar_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payroll_calendars_spec.rb b/spec/payroll_au/models/payroll_calendars_spec.rb new file mode 100644 index 00000000..7f3550c6 --- /dev/null +++ b/spec/payroll_au/models/payroll_calendars_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayrollCalendars +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayrollCalendars' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayrollCalendars.new + end + + after do + # run after each test + end + + describe 'test an instance of PayrollCalendars' do + it 'should create an instance of PayrollCalendars' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayrollCalendars) + end + end + describe 'test attribute "payroll_calendars"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payslip_lines_spec.rb b/spec/payroll_au/models/payslip_lines_spec.rb new file mode 100644 index 00000000..ad6fd2cf --- /dev/null +++ b/spec/payroll_au/models/payslip_lines_spec.rb @@ -0,0 +1,83 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayslipLines +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayslipLines' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayslipLines.new + end + + after do + # run after each test + end + + describe 'test an instance of PayslipLines' do + it 'should create an instance of PayslipLines' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayslipLines) + end + end + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_accrual_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "superannuation_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payslip_object_spec.rb b/spec/payroll_au/models/payslip_object_spec.rb new file mode 100644 index 00000000..b7468a88 --- /dev/null +++ b/spec/payroll_au/models/payslip_object_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayslipObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayslipObject' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayslipObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayslipObject' do + it 'should create an instance of PayslipObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayslipObject) + end + end + describe 'test attribute "payslip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payslip_spec.rb b/spec/payroll_au/models/payslip_spec.rb new file mode 100644 index 00000000..a9d4948f --- /dev/null +++ b/spec/payroll_au/models/payslip_spec.rb @@ -0,0 +1,149 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Payslip +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Payslip' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Payslip.new + end + + after do + # run after each test + end + + describe 'test an instance of Payslip' do + it 'should create an instance of Payslip' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Payslip) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payslip_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_super"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "net_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_accrual_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "superannuation_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payslip_summary_spec.rb b/spec/payroll_au/models/payslip_summary_spec.rb new file mode 100644 index 00000000..8dec53b2 --- /dev/null +++ b/spec/payroll_au/models/payslip_summary_spec.rb @@ -0,0 +1,107 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::PayslipSummary +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayslipSummary' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::PayslipSummary.new + end + + after do + # run after each test + end + + describe 'test an instance of PayslipSummary' do + it 'should create an instance of PayslipSummary' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::PayslipSummary) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payslip_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_group"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_super"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "net_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/payslips_spec.rb b/spec/payroll_au/models/payslips_spec.rb new file mode 100644 index 00000000..c2fff036 --- /dev/null +++ b/spec/payroll_au/models/payslips_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Payslips +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Payslips' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Payslips.new + end + + after do + # run after each test + end + + describe 'test an instance of Payslips' do + it 'should create an instance of Payslips' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Payslips) + end + end + describe 'test attribute "payslips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/rate_type_spec.rb b/spec/payroll_au/models/rate_type_spec.rb new file mode 100644 index 00000000..1b1439ab --- /dev/null +++ b/spec/payroll_au/models/rate_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::RateType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'RateType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::RateType.new + end + + after do + # run after each test + end + + describe 'test an instance of RateType' do + it 'should create an instance of RateType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::RateType) + end + end +end diff --git a/spec/payroll_au/models/reimbursement_line_spec.rb b/spec/payroll_au/models/reimbursement_line_spec.rb new file mode 100644 index 00000000..c956fd20 --- /dev/null +++ b/spec/payroll_au/models/reimbursement_line_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ReimbursementLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ReimbursementLine.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementLine' do + it 'should create an instance of ReimbursementLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ReimbursementLine) + end + end + describe 'test attribute "reimbursement_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/reimbursement_lines_spec.rb b/spec/payroll_au/models/reimbursement_lines_spec.rb new file mode 100644 index 00000000..a2b1a80f --- /dev/null +++ b/spec/payroll_au/models/reimbursement_lines_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ReimbursementLines +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementLines' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ReimbursementLines.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementLines' do + it 'should create an instance of ReimbursementLines' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ReimbursementLines) + end + end + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/reimbursement_type_spec.rb b/spec/payroll_au/models/reimbursement_type_spec.rb new file mode 100644 index 00000000..d6961ff8 --- /dev/null +++ b/spec/payroll_au/models/reimbursement_type_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ReimbursementType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ReimbursementType.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementType' do + it 'should create an instance of ReimbursementType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ReimbursementType) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/residency_status_spec.rb b/spec/payroll_au/models/residency_status_spec.rb new file mode 100644 index 00000000..e5b58d71 --- /dev/null +++ b/spec/payroll_au/models/residency_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ResidencyStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ResidencyStatus' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ResidencyStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of ResidencyStatus' do + it 'should create an instance of ResidencyStatus' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ResidencyStatus) + end + end +end diff --git a/spec/payroll_au/models/settings_object_spec.rb b/spec/payroll_au/models/settings_object_spec.rb new file mode 100644 index 00000000..fae5b36d --- /dev/null +++ b/spec/payroll_au/models/settings_object_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SettingsObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SettingsObject' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SettingsObject.new + end + + after do + # run after each test + end + + describe 'test an instance of SettingsObject' do + it 'should create an instance of SettingsObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SettingsObject) + end + end + describe 'test attribute "settings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/settings_spec.rb b/spec/payroll_au/models/settings_spec.rb new file mode 100644 index 00000000..7ea851db --- /dev/null +++ b/spec/payroll_au/models/settings_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Settings +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Settings' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Settings.new + end + + after do + # run after each test + end + + describe 'test an instance of Settings' do + it 'should create an instance of Settings' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Settings) + end + end + describe 'test attribute "accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_categories"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "days_in_payroll_year"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/settings_tracking_categories_employee_groups_spec.rb b/spec/payroll_au/models/settings_tracking_categories_employee_groups_spec.rb new file mode 100644 index 00000000..6d400520 --- /dev/null +++ b/spec/payroll_au/models/settings_tracking_categories_employee_groups_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SettingsTrackingCategoriesEmployeeGroups' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups.new + end + + after do + # run after each test + end + + describe 'test an instance of SettingsTrackingCategoriesEmployeeGroups' do + it 'should create an instance of SettingsTrackingCategoriesEmployeeGroups' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SettingsTrackingCategoriesEmployeeGroups) + end + end + describe 'test attribute "tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_category_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/settings_tracking_categories_spec.rb b/spec/payroll_au/models/settings_tracking_categories_spec.rb new file mode 100644 index 00000000..04819444 --- /dev/null +++ b/spec/payroll_au/models/settings_tracking_categories_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SettingsTrackingCategories +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SettingsTrackingCategories' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SettingsTrackingCategories.new + end + + after do + # run after each test + end + + describe 'test an instance of SettingsTrackingCategories' do + it 'should create an instance of SettingsTrackingCategories' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SettingsTrackingCategories) + end + end + describe 'test attribute "employee_groups"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_categories"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/settings_tracking_categories_timesheet_categories_spec.rb b/spec/payroll_au/models/settings_tracking_categories_timesheet_categories_spec.rb new file mode 100644 index 00000000..01dd88f8 --- /dev/null +++ b/spec/payroll_au/models/settings_tracking_categories_timesheet_categories_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SettingsTrackingCategoriesTimesheetCategories' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories.new + end + + after do + # run after each test + end + + describe 'test an instance of SettingsTrackingCategoriesTimesheetCategories' do + it 'should create an instance of SettingsTrackingCategoriesTimesheetCategories' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SettingsTrackingCategoriesTimesheetCategories) + end + end + describe 'test attribute "tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_category_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/state_spec.rb b/spec/payroll_au/models/state_spec.rb new file mode 100644 index 00000000..9d85f183 --- /dev/null +++ b/spec/payroll_au/models/state_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::State +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'State' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::State.new + end + + after do + # run after each test + end + + describe 'test an instance of State' do + it 'should create an instance of State' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::State) + end + end +end diff --git a/spec/payroll_au/models/super_fund_product_spec.rb b/spec/payroll_au/models/super_fund_product_spec.rb new file mode 100644 index 00000000..83ea858b --- /dev/null +++ b/spec/payroll_au/models/super_fund_product_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperFundProduct +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperFundProduct' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperFundProduct.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperFundProduct' do + it 'should create an instance of SuperFundProduct' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperFundProduct) + end + end + describe 'test attribute "abn"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "usi"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "spin"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "product_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/super_fund_products_spec.rb b/spec/payroll_au/models/super_fund_products_spec.rb new file mode 100644 index 00000000..45e0d507 --- /dev/null +++ b/spec/payroll_au/models/super_fund_products_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperFundProducts +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperFundProducts' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperFundProducts.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperFundProducts' do + it 'should create an instance of SuperFundProducts' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperFundProducts) + end + end + describe 'test attribute "super_fund_products"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/super_fund_spec.rb b/spec/payroll_au/models/super_fund_spec.rb new file mode 100644 index 00000000..3436cb2d --- /dev/null +++ b/spec/payroll_au/models/super_fund_spec.rb @@ -0,0 +1,113 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperFund +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperFund' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperFund.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperFund' do + it 'should create an instance of SuperFund' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperFund) + end + end + describe 'test attribute "super_fund_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "abn"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bsb"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "electronic_service_address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employer_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "spin"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "usi"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/super_fund_type_spec.rb b/spec/payroll_au/models/super_fund_type_spec.rb new file mode 100644 index 00000000..2716212f --- /dev/null +++ b/spec/payroll_au/models/super_fund_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperFundType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperFundType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperFundType.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperFundType' do + it 'should create an instance of SuperFundType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperFundType) + end + end +end diff --git a/spec/payroll_au/models/super_funds_spec.rb b/spec/payroll_au/models/super_funds_spec.rb new file mode 100644 index 00000000..1c02fdc2 --- /dev/null +++ b/spec/payroll_au/models/super_funds_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperFunds +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperFunds' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperFunds.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperFunds' do + it 'should create an instance of SuperFunds' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperFunds) + end + end + describe 'test attribute "super_funds"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/super_line_spec.rb b/spec/payroll_au/models/super_line_spec.rb new file mode 100644 index 00000000..5e520fab --- /dev/null +++ b/spec/payroll_au/models/super_line_spec.rb @@ -0,0 +1,83 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperLine.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperLine' do + it 'should create an instance of SuperLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperLine) + end + end + describe 'test attribute "super_membership_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contribution_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minimum_monthly_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/super_membership_spec.rb b/spec/payroll_au/models/super_membership_spec.rb new file mode 100644 index 00000000..11196917 --- /dev/null +++ b/spec/payroll_au/models/super_membership_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperMembership +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperMembership' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperMembership.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperMembership' do + it 'should create an instance of SuperMembership' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperMembership) + end + end + describe 'test attribute "super_membership_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "super_fund_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/superannuation_calculation_type_spec.rb b/spec/payroll_au/models/superannuation_calculation_type_spec.rb new file mode 100644 index 00000000..c3c47714 --- /dev/null +++ b/spec/payroll_au/models/superannuation_calculation_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperannuationCalculationType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperannuationCalculationType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperannuationCalculationType.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperannuationCalculationType' do + it 'should create an instance of SuperannuationCalculationType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperannuationCalculationType) + end + end +end diff --git a/spec/payroll_au/models/superannuation_contribution_type_spec.rb b/spec/payroll_au/models/superannuation_contribution_type_spec.rb new file mode 100644 index 00000000..3b07652a --- /dev/null +++ b/spec/payroll_au/models/superannuation_contribution_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperannuationContributionType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperannuationContributionType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperannuationContributionType.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperannuationContributionType' do + it 'should create an instance of SuperannuationContributionType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperannuationContributionType) + end + end +end diff --git a/spec/payroll_au/models/superannuation_line_spec.rb b/spec/payroll_au/models/superannuation_line_spec.rb new file mode 100644 index 00000000..252b4c8b --- /dev/null +++ b/spec/payroll_au/models/superannuation_line_spec.rb @@ -0,0 +1,89 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::SuperannuationLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperannuationLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::SuperannuationLine.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperannuationLine' do + it 'should create an instance of SuperannuationLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::SuperannuationLine) + end + end + describe 'test attribute "super_membership_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contribution_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minimum_monthly_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date_for_this_period"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/tax_declaration_spec.rb b/spec/payroll_au/models/tax_declaration_spec.rb new file mode 100644 index 00000000..ee35ad09 --- /dev/null +++ b/spec/payroll_au/models/tax_declaration_spec.rb @@ -0,0 +1,131 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TaxDeclaration +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxDeclaration' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TaxDeclaration.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxDeclaration' do + it 'should create an instance of TaxDeclaration' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TaxDeclaration) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employment_basis"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tfn_exemption_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_file_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "australian_resident_for_tax_purposes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "residency_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_free_threshold_claimed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_offset_estimated_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_help_debt"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_sfss_debt"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_trade_support_loan_debt"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "upward_variation_tax_withholding_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "eligible_to_receive_leave_loading"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "approved_withholding_variation_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_student_startup_loan"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/tax_line_spec.rb b/spec/payroll_au/models/tax_line_spec.rb new file mode 100644 index 00000000..71cef2a9 --- /dev/null +++ b/spec/payroll_au/models/tax_line_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TaxLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TaxLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxLine' do + it 'should create an instance of TaxLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TaxLine) + end + end + describe 'test attribute "payslip_tax_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_type_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "manual_tax_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/tfn_exemption_type_spec.rb b/spec/payroll_au/models/tfn_exemption_type_spec.rb new file mode 100644 index 00000000..b3edb35e --- /dev/null +++ b/spec/payroll_au/models/tfn_exemption_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TFNExemptionType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TFNExemptionType' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TFNExemptionType.new + end + + after do + # run after each test + end + + describe 'test an instance of TFNExemptionType' do + it 'should create an instance of TFNExemptionType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TFNExemptionType) + end + end +end diff --git a/spec/payroll_au/models/timesheet_line_spec.rb b/spec/payroll_au/models/timesheet_line_spec.rb new file mode 100644 index 00000000..1bb5d733 --- /dev/null +++ b/spec/payroll_au/models/timesheet_line_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TimesheetLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetLine' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TimesheetLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetLine' do + it 'should create an instance of TimesheetLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TimesheetLine) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_item_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/timesheet_object_spec.rb b/spec/payroll_au/models/timesheet_object_spec.rb new file mode 100644 index 00000000..44284e52 --- /dev/null +++ b/spec/payroll_au/models/timesheet_object_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TimesheetObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetObject' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TimesheetObject.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetObject' do + it 'should create an instance of TimesheetObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TimesheetObject) + end + end + describe 'test attribute "timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/timesheet_spec.rb b/spec/payroll_au/models/timesheet_spec.rb new file mode 100644 index 00000000..0ca56206 --- /dev/null +++ b/spec/payroll_au/models/timesheet_spec.rb @@ -0,0 +1,89 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Timesheet +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheet' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Timesheet.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheet' do + it 'should create an instance of Timesheet' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Timesheet) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "hours"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "validation_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/timesheet_status_spec.rb b/spec/payroll_au/models/timesheet_status_spec.rb new file mode 100644 index 00000000..cecd0add --- /dev/null +++ b/spec/payroll_au/models/timesheet_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::TimesheetStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetStatus' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::TimesheetStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetStatus' do + it 'should create an instance of TimesheetStatus' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::TimesheetStatus) + end + end +end diff --git a/spec/payroll_au/models/timesheets_spec.rb b/spec/payroll_au/models/timesheets_spec.rb new file mode 100644 index 00000000..8fb10f2c --- /dev/null +++ b/spec/payroll_au/models/timesheets_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::Timesheets +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheets' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::Timesheets.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheets' do + it 'should create an instance of Timesheets' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::Timesheets) + end + end + describe 'test attribute "timesheets"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_au/models/validation_error_spec.rb b/spec/payroll_au/models/validation_error_spec.rb new file mode 100644 index 00000000..b3b76370 --- /dev/null +++ b/spec/payroll_au/models/validation_error_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll AU + +#This is the Xero Payroll API for orgs in Australia region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollAu::ValidationError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ValidationError' do + before do + # run before each test + @instance = XeroRuby::PayrollAu::ValidationError.new + end + + after do + # run after each test + end + + describe 'test an instance of ValidationError' do + it 'should create an instance of ValidationError' do + expect(@instance).to be_instance_of(XeroRuby::PayrollAu::ValidationError) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/api/payroll_nz_api_spec.rb b/spec/payroll_nz/api/payroll_nz_api_spec.rb new file mode 100644 index 00000000..233070e4 --- /dev/null +++ b/spec/payroll_nz/api/payroll_nz_api_spec.rb @@ -0,0 +1,886 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for XeroRuby::PayrollNz::PayrollNzApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayrollNzApi' do + before do + # run before each test + @api_instance = XeroRuby::PayrollNz::PayrollNzApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PayrollNzApi' do + it 'should create an instance of PayrollNzApi' do + expect(@api_instance).to be_instance_of(XeroRuby::PayrollNz::PayrollNzApi) + end + end + + # unit tests for approve_timesheet + # approve a timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'approve_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_deduction + # create a new deduction + # @param xero_tenant_id Xero identifier for Tenant + # @param deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + describe 'create_deduction test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_earnings_rate + # create a new earnings rate + # @param xero_tenant_id Xero identifier for Tenant + # @param earnings_rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + describe 'create_earnings_rate test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee + # creates employees + # @param xero_tenant_id Xero identifier for Tenant + # @param employee + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'create_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_earnings_template + # creates employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + describe 'create_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_leave + # creates employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_leave + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'create_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_leave_setup + # Allows you to set-up leave for a specific employee. This is required before viewing, configuring and requesting leave for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_leave_setup + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveSetupObject] + describe 'create_employee_leave_setup test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_leave_type + # creates employee leave type records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_leave_type + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypeObject] + describe 'create_employee_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_opening_balances + # creates employee opening balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_opening_balance + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + describe 'create_employee_opening_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_payment_method + # creates employee payment method + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param payment_method + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + describe 'create_employee_payment_method test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_salary_and_wage + # creates employee salary and wage record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wage + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + describe 'create_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employment + # creates employment + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employment + # @param [Hash] opts the optional parameters + # @return [EmploymentObject] + describe 'create_employment test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_leave_type + # create a new leave type + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + describe 'create_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_multiple_employee_earnings_template + # creates multiple employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EmployeeEarningsTemplates] + describe 'create_multiple_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_pay_run + # create a pay run + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + describe 'create_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_pay_run_calendar + # create a new payrun calendar + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_calendar + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + describe 'create_pay_run_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_reimbursement + # create a new reimbursement + # @param xero_tenant_id Xero identifier for Tenant + # @param reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + describe 'create_reimbursement test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_superannuation + # create a new superannuation + # @param xero_tenant_id Xero identifier for Tenant + # @param benefit + # @param [Hash] opts the optional parameters + # @return [SuperannuationObject] + describe 'create_superannuation test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_timesheet + # create a new timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'create_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_timesheet_line + # create a new timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + describe 'create_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_earnings_template + # deletes an employee earnings template record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param pay_template_earning_id Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + describe 'delete_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_leave + # deletes an employee leave record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param leave_id Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'delete_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_salary_and_wage + # deletes an employee salary and wages record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + describe 'delete_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_timesheet + # delete a timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + describe 'delete_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_timesheet_line + # delete a timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line_id Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + describe 'delete_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_deduction + # retrieve a single deduction by id + # @param xero_tenant_id Xero identifier for Tenant + # @param deduction_id Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + describe 'get_deduction test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_deductions + # searches deductions + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Deductions] + describe 'get_deductions test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_rate + # retrieve a single earnings rates by id + # @param xero_tenant_id Xero identifier for Tenant + # @param earnings_rate_id Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + describe 'get_earnings_rate test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_rates + # searches earnings rates + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsRates] + describe 'get_earnings_rates test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee + # searches employees + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'get_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_balances + # search employee leave balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveBalances] + describe 'get_employee_leave_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_periods + # searches employee leave periods + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [LeavePeriods] + describe 'get_employee_leave_periods test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_types + # searches employee leave types + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypes] + describe 'get_employee_leave_types test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leaves + # search employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaves] + describe 'get_employee_leaves test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_opening_balances + # retrieve employee openingbalances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + describe 'get_employee_opening_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_pay_templates + # searches employee pay templates + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplates] + describe 'get_employee_pay_templates test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_payment_method + # retrieves an employee's payment method + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + describe 'get_employee_payment_method test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_salary_and_wage + # get employee salary and wages record by id + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWages] + describe 'get_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_salary_and_wages + # retrieves an employee's salary and wages + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [SalaryAndWages] + describe 'get_employee_salary_and_wages test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_tax + # searches tax records for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + describe 'get_employee_tax test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employees + # searches employees + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Employees] + describe 'get_employees test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_type + # retrieve a single leave type by id + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_type_id Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + describe 'get_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_types + # searches leave types + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [LeaveTypes] + describe 'get_leave_types test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run + # retrieve a single pay run by id + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + describe 'get_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run_calendar + # retrieve a single payrun calendar by id + # @param xero_tenant_id Xero identifier for Tenant + # @param payroll_calendar_id Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + describe 'get_pay_run_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run_calendars + # searches payrun calendars + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PayRunCalendars] + describe 'get_pay_run_calendars test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_runs + # searches pay runs + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [PayRuns] + describe 'get_pay_runs test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_slip + # retrieve a single payslip by id + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_slip_id Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [PaySlipObject] + describe 'get_pay_slip test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_slips + # searches payslips + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PaySlips] + describe 'get_pay_slips test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_reimbursement + # retrieve a single reimbursement by id + # @param xero_tenant_id Xero identifier for Tenant + # @param reimbursement_id Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + describe 'get_reimbursement test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_reimbursements + # searches reimbursements + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Reimbursements] + describe 'get_reimbursements test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_settings + # searches settings + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Settings] + describe 'get_settings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_statutory_deduction + # retrieve a single statutory deduction by id + # @param xero_tenant_id Xero identifier for Tenant + # @param id Identifier for the statutory deduction + # @param [Hash] opts the optional parameters + # @return [StatutoryDeductionObject] + describe 'get_statutory_deduction test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_statutory_deductions + # searches statutory deductions + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [StatutoryDeductions] + describe 'get_statutory_deductions test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_superannuation + # searches for a unique superannuation + # @param xero_tenant_id Xero identifier for Tenant + # @param superannuation_id Identifier for the superannuation + # @param [Hash] opts the optional parameters + # @return [SuperannuationObject] + describe 'get_superannuation test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_superannuations + # searches statutory deductions + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Superannuations] + describe 'get_superannuations test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheet + # retrieve a single timesheet by id + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'get_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheets + # searches timesheets + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Timesheets] + describe 'get_timesheets test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_tracking_categories + # searches tracking categories + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + describe 'get_tracking_categories test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for revert_timesheet + # revert a timesheet to draft + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'revert_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee + # updates employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'update_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_earnings_template + # updates employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param pay_template_earning_id Id for single pay template earnings object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + describe 'update_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_leave + # updates employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param leave_id Leave id for single object + # @param employee_leave + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'update_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_salary_and_wage + # updates employee salary and wages record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single pay template earnings object + # @param salary_and_wage + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + describe 'update_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_tax + # updates the tax records for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_tax + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + describe 'update_employee_tax test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pay_run + # update a pay run + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id Identifier for the pay run + # @param pay_run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + describe 'update_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pay_slip_line_items + # creates employee pay slip + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_slip_id Identifier for the payslip + # @param pay_slip + # @param [Hash] opts the optional parameters + # @return [PaySlipObject] + describe 'update_pay_slip_line_items test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_timesheet_line + # update a timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line_id Identifier for the timesheet line + # @param timesheet_line + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + describe 'update_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/account_spec.rb b/spec/payroll_nz/models/account_spec.rb new file mode 100644 index 00000000..c8a14423 --- /dev/null +++ b/spec/payroll_nz/models/account_spec.rb @@ -0,0 +1,63 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Account +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Account' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Account.new + end + + after do + # run after each test + end + + describe 'test an instance of Account' do + it 'should create an instance of Account' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Account) + end + end + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE", "BANK"]) + # validator.allowable_values.each do |value| + # expect { @instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/accounts_spec.rb b/spec/payroll_nz/models/accounts_spec.rb new file mode 100644 index 00000000..673c0d2b --- /dev/null +++ b/spec/payroll_nz/models/accounts_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Accounts +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Accounts' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Accounts.new + end + + after do + # run after each test + end + + describe 'test an instance of Accounts' do + it 'should create an instance of Accounts' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Accounts) + end + end + describe 'test attribute "accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/address_spec.rb b/spec/payroll_nz/models/address_spec.rb new file mode 100644 index 00000000..beb16315 --- /dev/null +++ b/spec/payroll_nz/models/address_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Address +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Address' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Address.new + end + + after do + # run after each test + end + + describe 'test an instance of Address' do + it 'should create an instance of Address' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Address) + end + end + describe 'test attribute "address_line1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address_line2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "city"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "suburb"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "post_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "country_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/bank_account_spec.rb b/spec/payroll_nz/models/bank_account_spec.rb new file mode 100644 index 00000000..1e676554 --- /dev/null +++ b/spec/payroll_nz/models/bank_account_spec.rb @@ -0,0 +1,87 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::BankAccount +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BankAccount' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::BankAccount.new + end + + after do + # run after each test + end + + describe 'test an instance of BankAccount' do + it 'should create an instance of BankAccount' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::BankAccount) + end + end + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "particulars"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "dollar_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reference"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["FixedAmount", "Balance"]) + # validator.allowable_values.each do |value| + # expect { @instance.calculation_type = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/benefit_spec.rb b/spec/payroll_nz/models/benefit_spec.rb new file mode 100644 index 00000000..ebca7f94 --- /dev/null +++ b/spec/payroll_nz/models/benefit_spec.rb @@ -0,0 +1,103 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Benefit +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Benefit' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Benefit.new + end + + after do + # run after each test + end + + describe 'test an instance of Benefit' do + it 'should create an instance of Benefit' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Benefit) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["KiwiSaver", "ComplyingFund", "Other"]) + # validator.allowable_values.each do |value| + # expect { @instance.category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type_nz"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfTaxableEarnings"]) + # validator.allowable_values.each do |value| + # expect { @instance.calculation_type_nz = value }.not_to raise_error + # end + end + end + + describe 'test attribute "standard_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "company_max"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/deduction_line_spec.rb b/spec/payroll_nz/models/deduction_line_spec.rb new file mode 100644 index 00000000..6d9bfc58 --- /dev/null +++ b/spec/payroll_nz/models/deduction_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::DeductionLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::DeductionLine.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionLine' do + it 'should create an instance of DeductionLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::DeductionLine) + end + end + describe 'test attribute "deduction_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/deduction_object_spec.rb b/spec/payroll_nz/models/deduction_object_spec.rb new file mode 100644 index 00000000..eb1e73c9 --- /dev/null +++ b/spec/payroll_nz/models/deduction_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::DeductionObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::DeductionObject.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionObject' do + it 'should create an instance of DeductionObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::DeductionObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/deduction_spec.rb b/spec/payroll_nz/models/deduction_spec.rb new file mode 100644 index 00000000..417d37ca --- /dev/null +++ b/spec/payroll_nz/models/deduction_spec.rb @@ -0,0 +1,75 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Deduction +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Deduction' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Deduction.new + end + + after do + # run after each test + end + + describe 'test an instance of Deduction' do + it 'should create an instance of Deduction' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Deduction) + end + end + describe 'test attribute "deduction_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PayrollGiving", "KiwiSaverVoluntaryContributions", "Superannuation", "NzOther"]) + # validator.allowable_values.each do |value| + # expect { @instance.deduction_category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "standard_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/deductions_spec.rb b/spec/payroll_nz/models/deductions_spec.rb new file mode 100644 index 00000000..bf9c0ef8 --- /dev/null +++ b/spec/payroll_nz/models/deductions_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Deductions +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Deductions' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Deductions.new + end + + after do + # run after each test + end + + describe 'test an instance of Deductions' do + it 'should create an instance of Deductions' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Deductions) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_line_spec.rb b/spec/payroll_nz/models/earnings_line_spec.rb new file mode 100644 index 00000000..749adbdd --- /dev/null +++ b/spec/payroll_nz/models/earnings_line_spec.rb @@ -0,0 +1,95 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsLine' do + it 'should create an instance of EarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsLine) + end + end + describe 'test attribute "earnings_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_average_daily_pay_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_system_generated"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_order_object_spec.rb b/spec/payroll_nz/models/earnings_order_object_spec.rb new file mode 100644 index 00000000..9d024149 --- /dev/null +++ b/spec/payroll_nz/models/earnings_order_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsOrderObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrderObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsOrderObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrderObject' do + it 'should create an instance of EarningsOrderObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsOrderObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_order_spec.rb b/spec/payroll_nz/models/earnings_order_spec.rb new file mode 100644 index 00000000..e137e94f --- /dev/null +++ b/spec/payroll_nz/models/earnings_order_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsOrder +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrder' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsOrder.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrder' do + it 'should create an instance of EarningsOrder' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsOrder) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_orders_spec.rb b/spec/payroll_nz/models/earnings_orders_spec.rb new file mode 100644 index 00000000..f1303d4a --- /dev/null +++ b/spec/payroll_nz/models/earnings_orders_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsOrders +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrders' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsOrders.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrders' do + it 'should create an instance of EarningsOrders' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsOrders) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_rate_object_spec.rb b/spec/payroll_nz/models/earnings_rate_object_spec.rb new file mode 100644 index 00000000..62b595cb --- /dev/null +++ b/spec/payroll_nz/models/earnings_rate_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsRateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsRateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRateObject' do + it 'should create an instance of EarningsRateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsRateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_rate_spec.rb b/spec/payroll_nz/models/earnings_rate_spec.rb new file mode 100644 index 00000000..6243e2f6 --- /dev/null +++ b/spec/payroll_nz/models/earnings_rate_spec.rb @@ -0,0 +1,103 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsRate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRate' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsRate.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRate' do + it 'should create an instance of EarningsRate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsRate) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["OvertimeEarnings", "Allowance", "RegularEarnings", "Commission", "Bonus", "Tips(Direct)", "Tips(Non-Direct)", "Backpay", "OtherEarnings", "LumpSum"]) + # validator.allowable_values.each do |value| + # expect { @instance.earnings_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "rate_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + # validator.allowable_values.each do |value| + # expect { @instance.rate_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "multiple_of_ordinary_earnings_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_rates_spec.rb b/spec/payroll_nz/models/earnings_rates_spec.rb new file mode 100644 index 00000000..49083ffa --- /dev/null +++ b/spec/payroll_nz/models/earnings_rates_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsRates +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRates' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsRates.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRates' do + it 'should create an instance of EarningsRates' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsRates) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_template_object_spec.rb b/spec/payroll_nz/models/earnings_template_object_spec.rb new file mode 100644 index 00000000..b98f57ca --- /dev/null +++ b/spec/payroll_nz/models/earnings_template_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsTemplateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsTemplateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsTemplateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsTemplateObject' do + it 'should create an instance of EarningsTemplateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsTemplateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/earnings_template_spec.rb b/spec/payroll_nz/models/earnings_template_spec.rb new file mode 100644 index 00000000..6061b188 --- /dev/null +++ b/spec/payroll_nz/models/earnings_template_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EarningsTemplate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsTemplate' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EarningsTemplate.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsTemplate' do + it 'should create an instance of EarningsTemplate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EarningsTemplate) + end + end + describe 'test attribute "pay_template_earning_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_earnings_templates_spec.rb b/spec/payroll_nz/models/employee_earnings_templates_spec.rb new file mode 100644 index 00000000..4c04ff6c --- /dev/null +++ b/spec/payroll_nz/models/employee_earnings_templates_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeEarningsTemplates +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeEarningsTemplates' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeEarningsTemplates.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeEarningsTemplates' do + it 'should create an instance of EmployeeEarningsTemplates' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeEarningsTemplates) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_templates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_balance_spec.rb b/spec/payroll_nz/models/employee_leave_balance_spec.rb new file mode 100644 index 00000000..4499d432 --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_balance_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveBalance' do + it 'should create an instance of EmployeeLeaveBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveBalance) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_balances_spec.rb b/spec/payroll_nz/models/employee_leave_balances_spec.rb new file mode 100644 index 00000000..41d80c2f --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_balances_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveBalances +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveBalances' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveBalances.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveBalances' do + it 'should create an instance of EmployeeLeaveBalances' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveBalances) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_object_spec.rb b/spec/payroll_nz/models/employee_leave_object_spec.rb new file mode 100644 index 00000000..cb9de612 --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveObject' do + it 'should create an instance of EmployeeLeaveObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_setup_object_spec.rb b/spec/payroll_nz/models/employee_leave_setup_object_spec.rb new file mode 100644 index 00000000..03ea122c --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_setup_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveSetupObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveSetupObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveSetupObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveSetupObject' do + it 'should create an instance of EmployeeLeaveSetupObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveSetupObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_setup"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_setup_spec.rb b/spec/payroll_nz/models/employee_leave_setup_spec.rb new file mode 100644 index 00000000..568b4ed1 --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_setup_spec.rb @@ -0,0 +1,77 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveSetup +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveSetup' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveSetup.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveSetup' do + it 'should create an instance of EmployeeLeaveSetup' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveSetup) + end + end + describe 'test attribute "include_holiday_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "holiday_pay_opening_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_leave_opening_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "negative_annual_leave_balance_paid_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sick_leave_hours_to_accrue_annually"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sick_leave_maximum_hours_to_accrue"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sick_leave_opening_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_spec.rb b/spec/payroll_nz/models/employee_leave_spec.rb new file mode 100644 index 00000000..68274d3e --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_spec.rb @@ -0,0 +1,77 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeave +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeave' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeave.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeave' do + it 'should create an instance of EmployeeLeave' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeave) + end + end + describe 'test attribute "leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "periods"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_type_object_spec.rb b/spec/payroll_nz/models/employee_leave_type_object_spec.rb new file mode 100644 index 00000000..6978deda --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_type_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveTypeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveTypeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveTypeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveTypeObject' do + it 'should create an instance of EmployeeLeaveTypeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveTypeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_type_spec.rb b/spec/payroll_nz/models/employee_leave_type_spec.rb new file mode 100644 index 00000000..e9680b22 --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_type_spec.rb @@ -0,0 +1,99 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveType' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveType.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveType' do + it 'should create an instance of EmployeeLeaveType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveType) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "schedule_of_accrual"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["AnnuallyAfter6Months", "OnAnniversaryDate", "PercentageOfGrossEarnings", "NoAccruals"]) + # validator.allowable_values.each do |value| + # expect { @instance.schedule_of_accrual = value }.not_to raise_error + # end + end + end + + describe 'test attribute "hours_accrued_annually"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "maximum_to_accrue"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opening_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_accrued_hourly"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage_of_gross_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "include_holiday_pay_every_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "show_annual_leave_in_advance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_leave_total_amount_paid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leave_types_spec.rb b/spec/payroll_nz/models/employee_leave_types_spec.rb new file mode 100644 index 00000000..aa9a2db3 --- /dev/null +++ b/spec/payroll_nz/models/employee_leave_types_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaveTypes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveTypes' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaveTypes.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveTypes' do + it 'should create an instance of EmployeeLeaveTypes' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaveTypes) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_leaves_spec.rb b/spec/payroll_nz/models/employee_leaves_spec.rb new file mode 100644 index 00000000..2d144bcc --- /dev/null +++ b/spec/payroll_nz/models/employee_leaves_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeLeaves +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaves' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeLeaves.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaves' do + it 'should create an instance of EmployeeLeaves' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeLeaves) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_object_spec.rb b/spec/payroll_nz/models/employee_object_spec.rb new file mode 100644 index 00000000..119ef0e7 --- /dev/null +++ b/spec/payroll_nz/models/employee_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeObject' do + it 'should create an instance of EmployeeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_opening_balance_spec.rb b/spec/payroll_nz/models/employee_opening_balance_spec.rb new file mode 100644 index 00000000..7b5a6102 --- /dev/null +++ b/spec/payroll_nz/models/employee_opening_balance_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeOpeningBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeOpeningBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeOpeningBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeOpeningBalance' do + it 'should create an instance of EmployeeOpeningBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeOpeningBalance) + end + end + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "days_paid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unpaid_weeks"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gross_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_opening_balances_object_spec.rb b/spec/payroll_nz/models/employee_opening_balances_object_spec.rb new file mode 100644 index 00000000..60b90e97 --- /dev/null +++ b/spec/payroll_nz/models/employee_opening_balances_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeOpeningBalancesObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeOpeningBalancesObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeOpeningBalancesObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeOpeningBalancesObject' do + it 'should create an instance of EmployeeOpeningBalancesObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeOpeningBalancesObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opening_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_pay_template_object_spec.rb b/spec/payroll_nz/models/employee_pay_template_object_spec.rb new file mode 100644 index 00000000..98ed9762 --- /dev/null +++ b/spec/payroll_nz/models/employee_pay_template_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeePayTemplateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeePayTemplateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplateObject' do + it 'should create an instance of EmployeePayTemplateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeePayTemplateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_pay_template_spec.rb b/spec/payroll_nz/models/employee_pay_template_spec.rb new file mode 100644 index 00000000..6b10d591 --- /dev/null +++ b/spec/payroll_nz/models/employee_pay_template_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeePayTemplate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplate' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeePayTemplate.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplate' do + it 'should create an instance of EmployeePayTemplate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeePayTemplate) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_templates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_pay_templates_spec.rb b/spec/payroll_nz/models/employee_pay_templates_spec.rb new file mode 100644 index 00000000..e09d474f --- /dev/null +++ b/spec/payroll_nz/models/employee_pay_templates_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeePayTemplates +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplates' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeePayTemplates.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplates' do + it 'should create an instance of EmployeePayTemplates' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeePayTemplates) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_spec.rb b/spec/payroll_nz/models/employee_spec.rb new file mode 100644 index 00000000..07900914 --- /dev/null +++ b/spec/payroll_nz/models/employee_spec.rb @@ -0,0 +1,123 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Employee +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employee' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Employee.new + end + + after do + # run after each test + end + + describe 'test an instance of Employee' do + it 'should create an instance of Employee' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Employee) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_of_birth"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gender"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["M", "F"]) + # validator.allowable_values.each do |value| + # expect { @instance.gender = value }.not_to raise_error + # end + end + end + + describe 'test attribute "phone_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_leave_balance_object_spec.rb b/spec/payroll_nz/models/employee_statutory_leave_balance_object_spec.rb new file mode 100644 index 00000000..d45f09c5 --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_leave_balance_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveBalanceObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveBalanceObject' do + it 'should create an instance of EmployeeStatutoryLeaveBalanceObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalanceObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_leave_balance_spec.rb b/spec/payroll_nz/models/employee_statutory_leave_balance_spec.rb new file mode 100644 index 00000000..034fc27c --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_leave_balance_spec.rb @@ -0,0 +1,61 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveBalance' do + it 'should create an instance of EmployeeStatutoryLeaveBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutoryLeaveBalance) + end + end + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + # validator.allowable_values.each do |value| + # expect { @instance.leave_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "balance_remaining"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Hours"]) + # validator.allowable_values.each do |value| + # expect { @instance.units = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_leave_summary_spec.rb b/spec/payroll_nz/models/employee_statutory_leave_summary_spec.rb new file mode 100644 index 00000000..eecde39b --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_leave_summary_spec.rb @@ -0,0 +1,85 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveSummary' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveSummary' do + it 'should create an instance of EmployeeStatutoryLeaveSummary' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutoryLeaveSummary) + end + end + describe 'test attribute "statutory_leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + # validator.allowable_values.each do |value| + # expect { @instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_entitled"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_leaves_summaries_spec.rb b/spec/payroll_nz/models/employee_statutory_leaves_summaries_spec.rb new file mode 100644 index 00000000..d0c374bc --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_leaves_summaries_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeavesSummaries' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeavesSummaries' do + it 'should create an instance of EmployeeStatutoryLeavesSummaries' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutoryLeavesSummaries) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_leaves"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_sick_leave_object_spec.rb b/spec/payroll_nz/models/employee_statutory_sick_leave_object_spec.rb new file mode 100644 index 00000000..3d01c7dd --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_sick_leave_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeaveObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeaveObject' do + it 'should create an instance of EmployeeStatutorySickLeaveObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutorySickLeaveObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_sick_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_sick_leave_spec.rb b/spec/payroll_nz/models/employee_statutory_sick_leave_spec.rb new file mode 100644 index 00000000..dc5d06c0 --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_sick_leave_spec.rb @@ -0,0 +1,135 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutorySickLeave +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeave' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeave.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeave' do + it 'should create an instance of EmployeeStatutorySickLeave' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutorySickLeave) + end + end + describe 'test attribute "statutory_leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "work_pattern"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_pregnancy_related"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sufficient_notice"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_entitled"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_requested"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_qualified"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_remaining"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "overlaps_with_other_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_failure_reasons"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["UnableToCalculateAwe", "AweLowerThanLel", "NotQualifiedInPreviousPiw", "ExceededMaximumEntitlementWeeksOfSsp", "ExceededMaximumDurationOfPiw", "SufficientNoticeNotGiven"]) + # validator.allowable_values.each do |value| + # expect { @instance.entitlement_failure_reasons = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/employee_statutory_sick_leaves_spec.rb b/spec/payroll_nz/models/employee_statutory_sick_leaves_spec.rb new file mode 100644 index 00000000..67a3cf5a --- /dev/null +++ b/spec/payroll_nz/models/employee_statutory_sick_leaves_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeStatutorySickLeaves +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeaves' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeStatutorySickLeaves.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeaves' do + it 'should create an instance of EmployeeStatutorySickLeaves' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeStatutorySickLeaves) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_sick_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_tax_object_spec.rb b/spec/payroll_nz/models/employee_tax_object_spec.rb new file mode 100644 index 00000000..4d0072f5 --- /dev/null +++ b/spec/payroll_nz/models/employee_tax_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeTaxObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeTaxObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeTaxObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeTaxObject' do + it 'should create an instance of EmployeeTaxObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeTaxObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employee_tax_spec.rb b/spec/payroll_nz/models/employee_tax_spec.rb new file mode 100644 index 00000000..ee00f0d7 --- /dev/null +++ b/spec/payroll_nz/models/employee_tax_spec.rb @@ -0,0 +1,135 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmployeeTax +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeTax' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmployeeTax.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeTax' do + it 'should create an instance of EmployeeTax' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmployeeTax) + end + end + describe 'test attribute "ird_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "special_tax_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_special_student_loan_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "special_student_loan_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_eligible_for_kiwi_saver"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "esct_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "kiwi_saver_contributions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["MakeContributions", "OptOut", "OnAContributionsHoliday", "OnASavingsSuspension", "NotCurrentlyAKiwiSaverMember"]) + # validator.allowable_values.each do |value| + # expect { @instance.kiwi_saver_contributions = value }.not_to raise_error + # end + end + end + + describe 'test attribute "kiwi_saver_employee_contribution_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "kiwi_saver_employer_contribution_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "kiwi_saver_opt_out_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "kiwi_saver_contribution_holiday_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_student_loan_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "student_loan_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "student_loan_as_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employees_spec.rb b/spec/payroll_nz/models/employees_spec.rb new file mode 100644 index 00000000..be45fd10 --- /dev/null +++ b/spec/payroll_nz/models/employees_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Employees +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employees' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Employees.new + end + + after do + # run after each test + end + + describe 'test an instance of Employees' do + it 'should create an instance of Employees' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Employees) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employees"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employment_object_spec.rb b/spec/payroll_nz/models/employment_object_spec.rb new file mode 100644 index 00000000..65edf27d --- /dev/null +++ b/spec/payroll_nz/models/employment_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::EmploymentObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmploymentObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::EmploymentObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmploymentObject' do + it 'should create an instance of EmploymentObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::EmploymentObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/employment_spec.rb b/spec/payroll_nz/models/employment_spec.rb new file mode 100644 index 00000000..64f6dd4e --- /dev/null +++ b/spec/payroll_nz/models/employment_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Employment +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employment' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Employment.new + end + + after do + # run after each test + end + + describe 'test an instance of Employment' do + it 'should create an instance of Employment' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Employment) + end + end + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/gross_earnings_history_spec.rb b/spec/payroll_nz/models/gross_earnings_history_spec.rb new file mode 100644 index 00000000..40ccebd6 --- /dev/null +++ b/spec/payroll_nz/models/gross_earnings_history_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::GrossEarningsHistory +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'GrossEarningsHistory' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::GrossEarningsHistory.new + end + + after do + # run after each test + end + + describe 'test an instance of GrossEarningsHistory' do + it 'should create an instance of GrossEarningsHistory' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::GrossEarningsHistory) + end + end + describe 'test attribute "days_paid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unpaid_weeks"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/invalid_field_spec.rb b/spec/payroll_nz/models/invalid_field_spec.rb new file mode 100644 index 00000000..1b655821 --- /dev/null +++ b/spec/payroll_nz/models/invalid_field_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::InvalidField +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InvalidField' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::InvalidField.new + end + + after do + # run after each test + end + + describe 'test an instance of InvalidField' do + it 'should create an instance of InvalidField' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::InvalidField) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reason"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_accrual_line_spec.rb b/spec/payroll_nz/models/leave_accrual_line_spec.rb new file mode 100644 index 00000000..83f2d381 --- /dev/null +++ b/spec/payroll_nz/models/leave_accrual_line_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeaveAccrualLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveAccrualLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeaveAccrualLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveAccrualLine' do + it 'should create an instance of LeaveAccrualLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeaveAccrualLine) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_earnings_line_spec.rb b/spec/payroll_nz/models/leave_earnings_line_spec.rb new file mode 100644 index 00000000..fefd4e99 --- /dev/null +++ b/spec/payroll_nz/models/leave_earnings_line_spec.rb @@ -0,0 +1,95 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeaveEarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveEarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeaveEarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveEarningsLine' do + it 'should create an instance of LeaveEarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeaveEarningsLine) + end + end + describe 'test attribute "earnings_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_average_daily_pay_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_system_generated"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_period_spec.rb b/spec/payroll_nz/models/leave_period_spec.rb new file mode 100644 index 00000000..6fba035c --- /dev/null +++ b/spec/payroll_nz/models/leave_period_spec.rb @@ -0,0 +1,63 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeavePeriod +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriod' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeavePeriod.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriod' do + it 'should create an instance of LeavePeriod' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeavePeriod) + end + end + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Approved", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.period_status = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/leave_periods_spec.rb b/spec/payroll_nz/models/leave_periods_spec.rb new file mode 100644 index 00000000..2f6d6ec2 --- /dev/null +++ b/spec/payroll_nz/models/leave_periods_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeavePeriods +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriods' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeavePeriods.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriods' do + it 'should create an instance of LeavePeriods' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeavePeriods) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "periods"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_type_object_spec.rb b/spec/payroll_nz/models/leave_type_object_spec.rb new file mode 100644 index 00000000..c09f334f --- /dev/null +++ b/spec/payroll_nz/models/leave_type_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeaveTypeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveTypeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeaveTypeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveTypeObject' do + it 'should create an instance of LeaveTypeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeaveTypeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_type_spec.rb b/spec/payroll_nz/models/leave_type_spec.rb new file mode 100644 index 00000000..5e843f60 --- /dev/null +++ b/spec/payroll_nz/models/leave_type_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeaveType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveType' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeaveType.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveType' do + it 'should create an instance of LeaveType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeaveType) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_paid_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "show_on_payslip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/leave_types_spec.rb b/spec/payroll_nz/models/leave_types_spec.rb new file mode 100644 index 00000000..47f1cd6a --- /dev/null +++ b/spec/payroll_nz/models/leave_types_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::LeaveTypes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveTypes' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::LeaveTypes.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveTypes' do + it 'should create an instance of LeaveTypes' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::LeaveTypes) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pagination_spec.rb b/spec/payroll_nz/models/pagination_spec.rb new file mode 100644 index 00000000..0e89c956 --- /dev/null +++ b/spec/payroll_nz/models/pagination_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Pagination +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Pagination' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Pagination.new + end + + after do + # run after each test + end + + describe 'test an instance of Pagination' do + it 'should create an instance of Pagination' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Pagination) + end + end + describe 'test attribute "page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "item_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_run_calendar_object_spec.rb b/spec/payroll_nz/models/pay_run_calendar_object_spec.rb new file mode 100644 index 00000000..c319639f --- /dev/null +++ b/spec/payroll_nz/models/pay_run_calendar_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRunCalendarObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendarObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRunCalendarObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendarObject' do + it 'should create an instance of PayRunCalendarObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRunCalendarObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_calendar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_run_calendar_spec.rb b/spec/payroll_nz/models/pay_run_calendar_spec.rb new file mode 100644 index 00000000..b47d4d8e --- /dev/null +++ b/spec/payroll_nz/models/pay_run_calendar_spec.rb @@ -0,0 +1,81 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRunCalendar +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendar' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRunCalendar.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendar' do + it 'should create an instance of PayRunCalendar' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRunCalendar) + end + end + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calendar_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + # validator.allowable_values.each do |value| + # expect { @instance.calendar_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_run_calendars_spec.rb b/spec/payroll_nz/models/pay_run_calendars_spec.rb new file mode 100644 index 00000000..8e63c1df --- /dev/null +++ b/spec/payroll_nz/models/pay_run_calendars_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRunCalendars +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendars' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRunCalendars.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendars' do + it 'should create an instance of PayRunCalendars' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRunCalendars) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_calendars"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_run_object_spec.rb b/spec/payroll_nz/models/pay_run_object_spec.rb new file mode 100644 index 00000000..5954483a --- /dev/null +++ b/spec/payroll_nz/models/pay_run_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRunObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRunObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunObject' do + it 'should create an instance of PayRunObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRunObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_run_spec.rb b/spec/payroll_nz/models/pay_run_spec.rb new file mode 100644 index 00000000..1a795f80 --- /dev/null +++ b/spec/payroll_nz/models/pay_run_spec.rb @@ -0,0 +1,119 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRun +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRun' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRun.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRun' do + it 'should create an instance of PayRun' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRun) + end + end + describe 'test attribute "pay_run_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_cost"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Draft", "Posted"]) + # validator.allowable_values.each do |value| + # expect { @instance.pay_run_status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "pay_run_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + # validator.allowable_values.each do |value| + # expect { @instance.pay_run_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "calendar_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + # validator.allowable_values.each do |value| + # expect { @instance.calendar_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "posted_date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_runs_spec.rb b/spec/payroll_nz/models/pay_runs_spec.rb new file mode 100644 index 00000000..f04088cd --- /dev/null +++ b/spec/payroll_nz/models/pay_runs_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PayRuns +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRuns' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PayRuns.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRuns' do + it 'should create an instance of PayRuns' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PayRuns) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_runs"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_slip_object_spec.rb b/spec/payroll_nz/models/pay_slip_object_spec.rb new file mode 100644 index 00000000..19e85e8f --- /dev/null +++ b/spec/payroll_nz/models/pay_slip_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaySlipObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaySlipObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaySlipObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PaySlipObject' do + it 'should create an instance of PaySlipObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaySlipObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_slip_spec.rb b/spec/payroll_nz/models/pay_slip_spec.rb new file mode 100644 index 00000000..139d3344 --- /dev/null +++ b/spec/payroll_nz/models/pay_slip_spec.rb @@ -0,0 +1,219 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaySlip +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaySlip' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaySlip.new + end + + after do + # run after each test + end + + describe 'test an instance of PaySlip' do + it 'should create an instance of PaySlip' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaySlip) + end + end + describe 'test attribute "pay_slip_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_edited"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gross_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_employer_taxes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_employee_taxes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_statutory_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_superannuation"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bacs_hash"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_accrual_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "superannuation_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_tax_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employer_tax_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_settings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gross_earnings_history"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/pay_slips_spec.rb b/spec/payroll_nz/models/pay_slips_spec.rb new file mode 100644 index 00000000..916a02b7 --- /dev/null +++ b/spec/payroll_nz/models/pay_slips_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaySlips +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaySlips' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaySlips.new + end + + after do + # run after each test + end + + describe 'test an instance of PaySlips' do + it 'should create an instance of PaySlips' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaySlips) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/payment_line_spec.rb b/spec/payroll_nz/models/payment_line_spec.rb new file mode 100644 index 00000000..5bef5a63 --- /dev/null +++ b/spec/payroll_nz/models/payment_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaymentLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaymentLine.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentLine' do + it 'should create an instance of PaymentLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaymentLine) + end + end + describe 'test attribute "payment_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/payment_method_object_spec.rb b/spec/payroll_nz/models/payment_method_object_spec.rb new file mode 100644 index 00000000..ce09ddd6 --- /dev/null +++ b/spec/payroll_nz/models/payment_method_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaymentMethodObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentMethodObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaymentMethodObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentMethodObject' do + it 'should create an instance of PaymentMethodObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaymentMethodObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/payment_method_spec.rb b/spec/payroll_nz/models/payment_method_spec.rb new file mode 100644 index 00000000..c9191229 --- /dev/null +++ b/spec/payroll_nz/models/payment_method_spec.rb @@ -0,0 +1,51 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::PaymentMethod +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentMethod' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::PaymentMethod.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentMethod' do + it 'should create an instance of PaymentMethod' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::PaymentMethod) + end + end + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "bank_accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/problem_spec.rb b/spec/payroll_nz/models/problem_spec.rb new file mode 100644 index 00000000..0e30d9fc --- /dev/null +++ b/spec/payroll_nz/models/problem_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Problem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Problem' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Problem.new + end + + after do + # run after each test + end + + describe 'test an instance of Problem' do + it 'should create an instance of Problem' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Problem) + end + end + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "instance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "invalid_fields"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/reimbursement_line_spec.rb b/spec/payroll_nz/models/reimbursement_line_spec.rb new file mode 100644 index 00000000..e25640f2 --- /dev/null +++ b/spec/payroll_nz/models/reimbursement_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::ReimbursementLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::ReimbursementLine.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementLine' do + it 'should create an instance of ReimbursementLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::ReimbursementLine) + end + end + describe 'test attribute "reimbursement_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/reimbursement_object_spec.rb b/spec/payroll_nz/models/reimbursement_object_spec.rb new file mode 100644 index 00000000..51b27c48 --- /dev/null +++ b/spec/payroll_nz/models/reimbursement_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::ReimbursementObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::ReimbursementObject.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementObject' do + it 'should create an instance of ReimbursementObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::ReimbursementObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/reimbursement_spec.rb b/spec/payroll_nz/models/reimbursement_spec.rb new file mode 100644 index 00000000..3b203b9b --- /dev/null +++ b/spec/payroll_nz/models/reimbursement_spec.rb @@ -0,0 +1,101 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Reimbursement +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Reimbursement' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Reimbursement.new + end + + after do + # run after each test + end + + describe 'test an instance of Reimbursement' do + it 'should create an instance of Reimbursement' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Reimbursement) + end + end + describe 'test attribute "reimbursement_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["GST", "NoGST", "GSTInclusive"]) + # validator.allowable_values.each do |value| + # expect { @instance.reimbursement_category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Unknown", "FixedAmount", "RatePerUnit"]) + # validator.allowable_values.each do |value| + # expect { @instance.calculation_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "standard_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "standard_type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Hours", "km"]) + # validator.allowable_values.each do |value| + # expect { @instance.standard_type_of_units = value }.not_to raise_error + # end + end + end + + describe 'test attribute "standard_rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/reimbursements_spec.rb b/spec/payroll_nz/models/reimbursements_spec.rb new file mode 100644 index 00000000..55b79976 --- /dev/null +++ b/spec/payroll_nz/models/reimbursements_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Reimbursements +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Reimbursements' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Reimbursements.new + end + + after do + # run after each test + end + + describe 'test an instance of Reimbursements' do + it 'should create an instance of Reimbursements' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Reimbursements) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/salary_and_wage_object_spec.rb b/spec/payroll_nz/models/salary_and_wage_object_spec.rb new file mode 100644 index 00000000..72f2a496 --- /dev/null +++ b/spec/payroll_nz/models/salary_and_wage_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::SalaryAndWageObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWageObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::SalaryAndWageObject.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWageObject' do + it 'should create an instance of SalaryAndWageObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::SalaryAndWageObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "salary_and_wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/salary_and_wage_spec.rb b/spec/payroll_nz/models/salary_and_wage_spec.rb new file mode 100644 index 00000000..65f313c6 --- /dev/null +++ b/spec/payroll_nz/models/salary_and_wage_spec.rb @@ -0,0 +1,103 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::SalaryAndWage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWage' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::SalaryAndWage.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWage' do + it 'should create an instance of SalaryAndWage' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::SalaryAndWage) + end + end + describe 'test attribute "salary_and_wages_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units_per_week"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units_per_day"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "days_per_week"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "effective_from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_salary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Active", "Pending"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "payment_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Salary", "Hourly"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_type = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_nz/models/salary_and_wages_spec.rb b/spec/payroll_nz/models/salary_and_wages_spec.rb new file mode 100644 index 00000000..27c2c691 --- /dev/null +++ b/spec/payroll_nz/models/salary_and_wages_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::SalaryAndWages +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWages' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::SalaryAndWages.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWages' do + it 'should create an instance of SalaryAndWages' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::SalaryAndWages) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "salary_and_wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/settings_spec.rb b/spec/payroll_nz/models/settings_spec.rb new file mode 100644 index 00000000..e9274350 --- /dev/null +++ b/spec/payroll_nz/models/settings_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Settings +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Settings' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Settings.new + end + + after do + # run after each test + end + + describe 'test an instance of Settings' do + it 'should create an instance of Settings' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Settings) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "settings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/statutory_deduction_category_spec.rb b/spec/payroll_nz/models/statutory_deduction_category_spec.rb new file mode 100644 index 00000000..5c25f1b4 --- /dev/null +++ b/spec/payroll_nz/models/statutory_deduction_category_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::StatutoryDeductionCategory +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeductionCategory' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::StatutoryDeductionCategory.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeductionCategory' do + it 'should create an instance of StatutoryDeductionCategory' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::StatutoryDeductionCategory) + end + end +end diff --git a/spec/payroll_nz/models/statutory_deduction_line_spec.rb b/spec/payroll_nz/models/statutory_deduction_line_spec.rb new file mode 100644 index 00000000..5e48cff0 --- /dev/null +++ b/spec/payroll_nz/models/statutory_deduction_line_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::StatutoryDeductionLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeductionLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::StatutoryDeductionLine.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeductionLine' do + it 'should create an instance of StatutoryDeductionLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::StatutoryDeductionLine) + end + end + describe 'test attribute "statutory_deduction_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "manual_adjustment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/statutory_deduction_object_spec.rb b/spec/payroll_nz/models/statutory_deduction_object_spec.rb new file mode 100644 index 00000000..00c54e6e --- /dev/null +++ b/spec/payroll_nz/models/statutory_deduction_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::StatutoryDeductionObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeductionObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::StatutoryDeductionObject.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeductionObject' do + it 'should create an instance of StatutoryDeductionObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::StatutoryDeductionObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/statutory_deduction_spec.rb b/spec/payroll_nz/models/statutory_deduction_spec.rb new file mode 100644 index 00000000..77c61e09 --- /dev/null +++ b/spec/payroll_nz/models/statutory_deduction_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::StatutoryDeduction +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeduction' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::StatutoryDeduction.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeduction' do + it 'should create an instance of StatutoryDeduction' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::StatutoryDeduction) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/statutory_deductions_spec.rb b/spec/payroll_nz/models/statutory_deductions_spec.rb new file mode 100644 index 00000000..de0b5a2b --- /dev/null +++ b/spec/payroll_nz/models/statutory_deductions_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::StatutoryDeductions +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeductions' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::StatutoryDeductions.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeductions' do + it 'should create an instance of StatutoryDeductions' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::StatutoryDeductions) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/superannuation_line_spec.rb b/spec/payroll_nz/models/superannuation_line_spec.rb new file mode 100644 index 00000000..6c30f4f2 --- /dev/null +++ b/spec/payroll_nz/models/superannuation_line_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::SuperannuationLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperannuationLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::SuperannuationLine.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperannuationLine' do + it 'should create an instance of SuperannuationLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::SuperannuationLine) + end + end + describe 'test attribute "superannuation_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "manual_adjustment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/superannuation_object_spec.rb b/spec/payroll_nz/models/superannuation_object_spec.rb new file mode 100644 index 00000000..65ae51ee --- /dev/null +++ b/spec/payroll_nz/models/superannuation_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::SuperannuationObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SuperannuationObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::SuperannuationObject.new + end + + after do + # run after each test + end + + describe 'test an instance of SuperannuationObject' do + it 'should create an instance of SuperannuationObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::SuperannuationObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "benefit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/superannuations_spec.rb b/spec/payroll_nz/models/superannuations_spec.rb new file mode 100644 index 00000000..3869c333 --- /dev/null +++ b/spec/payroll_nz/models/superannuations_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Superannuations +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Superannuations' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Superannuations.new + end + + after do + # run after each test + end + + describe 'test an instance of Superannuations' do + it 'should create an instance of Superannuations' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Superannuations) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "benefits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/tax_code_spec.rb b/spec/payroll_nz/models/tax_code_spec.rb new file mode 100644 index 00000000..733e9aff --- /dev/null +++ b/spec/payroll_nz/models/tax_code_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TaxCode +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxCode' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TaxCode.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxCode' do + it 'should create an instance of TaxCode' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TaxCode) + end + end +end diff --git a/spec/payroll_nz/models/tax_line_spec.rb b/spec/payroll_nz/models/tax_line_spec.rb new file mode 100644 index 00000000..73f9aee7 --- /dev/null +++ b/spec/payroll_nz/models/tax_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TaxLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TaxLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxLine' do + it 'should create an instance of TaxLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TaxLine) + end + end + describe 'test attribute "tax_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "global_tax_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "manual_adjustment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/tax_settings_spec.rb b/spec/payroll_nz/models/tax_settings_spec.rb new file mode 100644 index 00000000..c5f2810a --- /dev/null +++ b/spec/payroll_nz/models/tax_settings_spec.rb @@ -0,0 +1,75 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TaxSettings +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxSettings' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TaxSettings.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxSettings' do + it 'should create an instance of TaxSettings' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TaxSettings) + end + end + describe 'test attribute "period_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["weeks", "months"]) + # validator.allowable_values.each do |value| + # expect { @instance.period_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "tax_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "special_tax_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "lump_sum_tax_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "lump_sum_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheet_earnings_line_spec.rb b/spec/payroll_nz/models/timesheet_earnings_line_spec.rb new file mode 100644 index 00000000..b7a8bac3 --- /dev/null +++ b/spec/payroll_nz/models/timesheet_earnings_line_spec.rb @@ -0,0 +1,95 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TimesheetEarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetEarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TimesheetEarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetEarningsLine' do + it 'should create an instance of TimesheetEarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TimesheetEarningsLine) + end + end + describe 'test attribute "earnings_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_average_daily_pay_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_system_generated"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheet_line_object_spec.rb b/spec/payroll_nz/models/timesheet_line_object_spec.rb new file mode 100644 index 00000000..1a2bd59a --- /dev/null +++ b/spec/payroll_nz/models/timesheet_line_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TimesheetLineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetLineObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TimesheetLineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetLineObject' do + it 'should create an instance of TimesheetLineObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TimesheetLineObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_line"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheet_line_spec.rb b/spec/payroll_nz/models/timesheet_line_spec.rb new file mode 100644 index 00000000..dbd9c4b1 --- /dev/null +++ b/spec/payroll_nz/models/timesheet_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TimesheetLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetLine' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TimesheetLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetLine' do + it 'should create an instance of TimesheetLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TimesheetLine) + end + end + describe 'test attribute "timesheet_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_item_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheet_object_spec.rb b/spec/payroll_nz/models/timesheet_object_spec.rb new file mode 100644 index 00000000..bf5e38e7 --- /dev/null +++ b/spec/payroll_nz/models/timesheet_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TimesheetObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetObject' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TimesheetObject.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetObject' do + it 'should create an instance of TimesheetObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TimesheetObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheet_spec.rb b/spec/payroll_nz/models/timesheet_spec.rb new file mode 100644 index 00000000..780d791d --- /dev/null +++ b/spec/payroll_nz/models/timesheet_spec.rb @@ -0,0 +1,93 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Timesheet +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheet' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Timesheet.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheet' do + it 'should create an instance of Timesheet' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Timesheet) + end + end + describe 'test attribute "timesheet_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "total_hours"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/timesheets_spec.rb b/spec/payroll_nz/models/timesheets_spec.rb new file mode 100644 index 00000000..f8aa3668 --- /dev/null +++ b/spec/payroll_nz/models/timesheets_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::Timesheets +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheets' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::Timesheets.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheets' do + it 'should create an instance of Timesheets' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::Timesheets) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheets"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/tracking_categories_spec.rb b/spec/payroll_nz/models/tracking_categories_spec.rb new file mode 100644 index 00000000..969eee1a --- /dev/null +++ b/spec/payroll_nz/models/tracking_categories_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TrackingCategories +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TrackingCategories' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TrackingCategories.new + end + + after do + # run after each test + end + + describe 'test an instance of TrackingCategories' do + it 'should create an instance of TrackingCategories' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TrackingCategories) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_categories"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_nz/models/tracking_category_spec.rb b/spec/payroll_nz/models/tracking_category_spec.rb new file mode 100644 index 00000000..82600e71 --- /dev/null +++ b/spec/payroll_nz/models/tracking_category_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollNz::TrackingCategory +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TrackingCategory' do + before do + # run before each test + @instance = XeroRuby::PayrollNz::TrackingCategory.new + end + + after do + # run after each test + end + + describe 'test an instance of TrackingCategory' do + it 'should create an instance of TrackingCategory' do + expect(@instance).to be_instance_of(XeroRuby::PayrollNz::TrackingCategory) + end + end + describe 'test attribute "employee_groups_tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/api/payroll_uk_api_spec.rb b/spec/payroll_uk/api/payroll_uk_api_spec.rb new file mode 100644 index 00000000..35061b42 --- /dev/null +++ b/spec/payroll_uk/api/payroll_uk_api_spec.rb @@ -0,0 +1,912 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for XeroRuby::PayrollUk::PayrollUkApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayrollUkApi' do + before do + # run before each test + @api_instance = XeroRuby::PayrollUk::PayrollUkApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PayrollUkApi' do + it 'should create an instance of PayrollUkApi' do + expect(@api_instance).to be_instance_of(XeroRuby::PayrollUk::PayrollUkApi) + end + end + + # unit tests for approve_timesheet + # approve a timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'approve_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_benefit + # create a new benefit + # @param xero_tenant_id Xero identifier for Tenant + # @param benefit + # @param [Hash] opts the optional parameters + # @return [BenefitObject] + describe 'create_benefit test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_deduction + # create a new deduction + # @param xero_tenant_id Xero identifier for Tenant + # @param deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + describe 'create_deduction test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_earnings_rate + # create a new earnings rate + # @param xero_tenant_id Xero identifier for Tenant + # @param earnings_rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + describe 'create_earnings_rate test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee + # creates employees + # @param xero_tenant_id Xero identifier for Tenant + # @param employee + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'create_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_earnings_template + # creates employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + describe 'create_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_leave + # creates employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_leave + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'create_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_leave_type + # creates employee leave type records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_leave_type + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypeObject] + describe 'create_employee_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_opening_balances + # creates employee opening balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_opening_balances + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + describe 'create_employee_opening_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_payment_method + # creates employee payment method + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param payment_method + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + describe 'create_employee_payment_method test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_salary_and_wage + # creates employee salary and wage record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wage + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + describe 'create_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employee_statutory_sick_leave + # creates employee statutory sick leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_statutory_sick_leave + # @param [Hash] opts the optional parameters + # @return [EmployeeStatutorySickLeaveObject] + describe 'create_employee_statutory_sick_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_employment + # creates employment + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employment + # @param [Hash] opts the optional parameters + # @return [EmploymentObject] + describe 'create_employment test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_leave_type + # create a new leave type + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + describe 'create_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_multiple_employee_earnings_template + # creates multiple employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplates] + describe 'create_multiple_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_pay_run_calendar + # create a new payrun calendar + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_calendar + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + describe 'create_pay_run_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_reimbursement + # create a new reimbursement + # @param xero_tenant_id Xero identifier for Tenant + # @param reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + describe 'create_reimbursement test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_timesheet + # create a new timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'create_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_timesheet_line + # create a new timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + describe 'create_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_earnings_template + # deletes an employee earnings template record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param pay_template_earning_id Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_leave + # deletes an employee leave record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param leave_id Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'delete_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_employee_salary_and_wage + # deletes an employee salary and wages record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single salary and wages object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_timesheet + # delete a timesheet + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + describe 'delete_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_timesheet_line + # delete a timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line_id Identifier for the timesheet line + # @param [Hash] opts the optional parameters + # @return [TimesheetLine] + describe 'delete_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_benefit + # retrieve a single benefit by id + # @param xero_tenant_id Xero identifier for Tenant + # @param id Identifier for the benefit + # @param [Hash] opts the optional parameters + # @return [BenefitObject] + describe 'get_benefit test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_benefits + # searches benefits + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Benefits] + describe 'get_benefits test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_deduction + # retrieve a single deduction by id + # @param xero_tenant_id Xero identifier for Tenant + # @param deduction_id Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [DeductionObject] + describe 'get_deduction test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_deductions + # searches deductions + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Deductions] + describe 'get_deductions test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_order + # retrieve a single deduction by id + # @param xero_tenant_id Xero identifier for Tenant + # @param id Identifier for the deduction + # @param [Hash] opts the optional parameters + # @return [EarningsOrderObject] + describe 'get_earnings_order test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_orders + # searches earnings orders + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsOrders] + describe 'get_earnings_orders test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_rate + # retrieve a single earnings rates by id + # @param xero_tenant_id Xero identifier for Tenant + # @param earnings_rate_id Identifier for the earnings rate + # @param [Hash] opts the optional parameters + # @return [EarningsRateObject] + describe 'get_earnings_rate test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_earnings_rates + # searches earnings rates + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [EarningsRates] + describe 'get_earnings_rates test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee + # searches employees + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'get_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave + # retrieve a single employee leave record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param leave_id Leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'get_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_balances + # search employee leave balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveBalances] + describe 'get_employee_leave_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_periods + # searches employee leave periods + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Date] :start_date Filter by start date + # @option opts [Date] :end_date Filter by end date + # @return [LeavePeriods] + describe 'get_employee_leave_periods test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leave_types + # searches employee leave types + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveTypes] + describe 'get_employee_leave_types test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_leaves + # search employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaves] + describe 'get_employee_leaves test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_opening_balances + # retrieve employee openingbalances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + describe 'get_employee_opening_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_pay_template + # searches employee pay templates + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeePayTemplateObject] + describe 'get_employee_pay_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_payment_method + # retrieves an employee's payment method + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [PaymentMethodObject] + describe 'get_employee_payment_method test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_salary_and_wage + # get employee salary and wages record by id + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single pay template earnings object + # @param [Hash] opts the optional parameters + # @return [SalaryAndWages] + describe 'get_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_salary_and_wages + # retrieves an employee's salary and wages + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [SalaryAndWages] + describe 'get_employee_salary_and_wages test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_statutory_leave_balances + # search employee leave balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [String] :leave_type Filter by the type of statutory leave + # @option opts [Date] :as_of_date The date from which to calculate balance remaining. If not specified, current date UTC is used. + # @return [EmployeeStatutoryLeaveBalanceObject] + describe 'get_employee_statutory_leave_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_statutory_sick_leave + # retrieve a statutory sick leave for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param statutory_sick_leave_id Statutory sick leave id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeStatutorySickLeaveObject] + describe 'get_employee_statutory_sick_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employee_tax + # searches tax records for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeTaxObject] + describe 'get_employee_tax test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_employees + # searches employees + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :first_name Filter by first name + # @option opts [String] :last_name Filter by last name + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Employees] + describe 'get_employees test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_type + # retrieve a single leave type by id + # @param xero_tenant_id Xero identifier for Tenant + # @param leave_type_id Identifier for the leave type + # @param [Hash] opts the optional parameters + # @return [LeaveTypeObject] + describe 'get_leave_type test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_leave_types + # searches leave types + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [Boolean] :active_only Filters leave types by active status. By default the API returns all leave types. + # @return [LeaveTypes] + describe 'get_leave_types test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run + # retrieve a single pay run by id + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id Identifier for the pay run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + describe 'get_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run_calendar + # retrieve a single payrun calendar by id + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_calendar_id Identifier for the payrun calendars + # @param [Hash] opts the optional parameters + # @return [PayRunCalendarObject] + describe 'get_pay_run_calendar test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_run_calendars + # searches payrun calendars + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [PayRunCalendars] + describe 'get_pay_run_calendars test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_runs + # searches pay runs + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + # @return [PayRuns] + describe 'get_pay_runs test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_slip + # retrieve a single payslip by id + # @param xero_tenant_id Xero identifier for Tenant + # @param payslip_id Identifier for the payslip + # @param [Hash] opts the optional parameters + # @return [PayslipObject] + describe 'get_pay_slip test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pay_slips + # searches payslips + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Payslips] + describe 'get_pay_slips test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_reimbursement + # retrieve a single reimbursement by id + # @param xero_tenant_id Xero identifier for Tenant + # @param reimbursement_id Identifier for the reimbursement + # @param [Hash] opts the optional parameters + # @return [ReimbursementObject] + describe 'get_reimbursement test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_reimbursements + # searches reimbursements + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @return [Reimbursements] + describe 'get_reimbursements test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_settings + # searches settings + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Settings] + describe 'get_settings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_statutory_leave_summary + # retrieve a summary of statutory leaves for an employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :active_only Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + # @return [EmployeeStatutoryLeavesSummaries] + describe 'get_statutory_leave_summary test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheet + # retrieve a single timesheet by id + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'get_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_timesheets + # searches timesheets + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + # @option opts [String] :employee_id By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + # @option opts [String] :payroll_calendar_id By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + # @return [Timesheets] + describe 'get_timesheets test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_tracking_categories + # searches tracking categories + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + describe 'get_tracking_categories test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for revert_timesheet + # revert a timesheet to draft + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param [Hash] opts the optional parameters + # @return [TimesheetObject] + describe 'revert_timesheet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee + # updates employee + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee + # @param [Hash] opts the optional parameters + # @return [EmployeeObject] + describe 'update_employee test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_earnings_template + # updates employee earnings template records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param pay_template_earning_id Id for single pay template earnings object + # @param earnings_template + # @param [Hash] opts the optional parameters + # @return [EarningsTemplateObject] + describe 'update_employee_earnings_template test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_leave + # updates employee leave records + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param leave_id Leave id for single object + # @param employee_leave + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + describe 'update_employee_leave test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_opening_balances + # updates employee opening balances + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param employee_opening_balances + # @param [Hash] opts the optional parameters + # @return [EmployeeOpeningBalancesObject] + describe 'update_employee_opening_balances test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_employee_salary_and_wage + # updates employee salary and wages record + # @param xero_tenant_id Xero identifier for Tenant + # @param employee_id Employee id for single object + # @param salary_and_wages_id Id for single pay template earnings object + # @param salary_and_wage + # @param [Hash] opts the optional parameters + # @return [SalaryAndWageObject] + describe 'update_employee_salary_and_wage test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pay_run + # update a pay run + # @param xero_tenant_id Xero identifier for Tenant + # @param pay_run_id Identifier for the pay run + # @param pay_run + # @param [Hash] opts the optional parameters + # @return [PayRunObject] + describe 'update_pay_run test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_timesheet_line + # update a timesheet line + # @param xero_tenant_id Xero identifier for Tenant + # @param timesheet_id Identifier for the timesheet + # @param timesheet_line_id Identifier for the timesheet line + # @param timesheet_line + # @param [Hash] opts the optional parameters + # @return [TimesheetLineObject] + describe 'update_timesheet_line test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/account_spec.rb b/spec/payroll_uk/models/account_spec.rb new file mode 100644 index 00000000..640af20a --- /dev/null +++ b/spec/payroll_uk/models/account_spec.rb @@ -0,0 +1,63 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Account +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Account' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Account.new + end + + after do + # run after each test + end + + describe 'test an instance of Account' do + it 'should create an instance of Account' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Account) + end + end + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BANK", "EMPLOYERSNIC", "NICLIABILITY", "PAYEECONTRIBUTION", "PAYELIABILITY", "WAGESPAYABLE", "WAGESEXPENSE"]) + # validator.allowable_values.each do |value| + # expect { @instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/accounts_spec.rb b/spec/payroll_uk/models/accounts_spec.rb new file mode 100644 index 00000000..9d1f9cd0 --- /dev/null +++ b/spec/payroll_uk/models/accounts_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Accounts +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Accounts' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Accounts.new + end + + after do + # run after each test + end + + describe 'test an instance of Accounts' do + it 'should create an instance of Accounts' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Accounts) + end + end + describe 'test attribute "accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/address_spec.rb b/spec/payroll_uk/models/address_spec.rb new file mode 100644 index 00000000..ad6e82f5 --- /dev/null +++ b/spec/payroll_uk/models/address_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Address +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Address' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Address.new + end + + after do + # run after each test + end + + describe 'test an instance of Address' do + it 'should create an instance of Address' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Address) + end + end + describe 'test attribute "address_line1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address_line2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "city"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "post_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "country_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/bank_account_spec.rb b/spec/payroll_uk/models/bank_account_spec.rb new file mode 100644 index 00000000..d4220ad6 --- /dev/null +++ b/spec/payroll_uk/models/bank_account_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::BankAccount +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BankAccount' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::BankAccount.new + end + + after do + # run after each test + end + + describe 'test an instance of BankAccount' do + it 'should create an instance of BankAccount' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::BankAccount) + end + end + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/benefit_line_spec.rb b/spec/payroll_uk/models/benefit_line_spec.rb new file mode 100644 index 00000000..73a5b6d3 --- /dev/null +++ b/spec/payroll_uk/models/benefit_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::BenefitLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BenefitLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::BenefitLine.new + end + + after do + # run after each test + end + + describe 'test an instance of BenefitLine' do + it 'should create an instance of BenefitLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::BenefitLine) + end + end + describe 'test attribute "benefit_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/benefit_object_spec.rb b/spec/payroll_uk/models/benefit_object_spec.rb new file mode 100644 index 00000000..457045cf --- /dev/null +++ b/spec/payroll_uk/models/benefit_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::BenefitObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BenefitObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::BenefitObject.new + end + + after do + # run after each test + end + + describe 'test an instance of BenefitObject' do + it 'should create an instance of BenefitObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::BenefitObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "benefit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/benefit_spec.rb b/spec/payroll_uk/models/benefit_spec.rb new file mode 100644 index 00000000..f2d87ea6 --- /dev/null +++ b/spec/payroll_uk/models/benefit_spec.rb @@ -0,0 +1,127 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Benefit +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Benefit' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Benefit.new + end + + after do + # run after each test + end + + describe 'test an instance of Benefit' do + it 'should create an instance of Benefit' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Benefit) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["StakeholderPension", "Other"]) + # validator.allowable_values.each do |value| + # expect { @instance.category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "standard_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + # validator.allowable_values.each do |value| + # expect { @instance.calculation_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_nic"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_pension"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_calculating_on_qualifying_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "show_balance_to_employee"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/benefits_spec.rb b/spec/payroll_uk/models/benefits_spec.rb new file mode 100644 index 00000000..d80330fc --- /dev/null +++ b/spec/payroll_uk/models/benefits_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Benefits +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Benefits' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Benefits.new + end + + after do + # run after each test + end + + describe 'test an instance of Benefits' do + it 'should create an instance of Benefits' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Benefits) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "benefits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/court_order_line_spec.rb b/spec/payroll_uk/models/court_order_line_spec.rb new file mode 100644 index 00000000..b0d09685 --- /dev/null +++ b/spec/payroll_uk/models/court_order_line_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::CourtOrderLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CourtOrderLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::CourtOrderLine.new + end + + after do + # run after each test + end + + describe 'test an instance of CourtOrderLine' do + it 'should create an instance of CourtOrderLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::CourtOrderLine) + end + end + describe 'test attribute "court_order_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/deduction_line_spec.rb b/spec/payroll_uk/models/deduction_line_spec.rb new file mode 100644 index 00000000..8268d3b6 --- /dev/null +++ b/spec/payroll_uk/models/deduction_line_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::DeductionLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::DeductionLine.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionLine' do + it 'should create an instance of DeductionLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::DeductionLine) + end + end + describe 'test attribute "deduction_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/deduction_object_spec.rb b/spec/payroll_uk/models/deduction_object_spec.rb new file mode 100644 index 00000000..9d9c68d1 --- /dev/null +++ b/spec/payroll_uk/models/deduction_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::DeductionObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DeductionObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::DeductionObject.new + end + + after do + # run after each test + end + + describe 'test an instance of DeductionObject' do + it 'should create an instance of DeductionObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::DeductionObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/deduction_spec.rb b/spec/payroll_uk/models/deduction_spec.rb new file mode 100644 index 00000000..0274531b --- /dev/null +++ b/spec/payroll_uk/models/deduction_spec.rb @@ -0,0 +1,139 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Deduction +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Deduction' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Deduction.new + end + + after do + # run after each test + end + + describe 'test an instance of Deduction' do + it 'should create an instance of Deduction' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Deduction) + end + end + describe 'test attribute "deduction_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["CapitalContributions", "ChildCareVoucher", "MakingGood", "PostgraduateLoanDeductions", "PrivateUsePayments", "SalarySacrifice", "StakeholderPension", "StakeholderPensionPostTax", "StudentLoanDeductions", "UkOther"]) + # validator.allowable_values.each do |value| + # expect { @instance.deduction_category = value }.not_to raise_error + # end + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "standard_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reduces_super_liability"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reduces_tax_liability"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calculation_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["FixedAmount", "PercentageOfGross"]) + # validator.allowable_values.each do |value| + # expect { @instance.calculation_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "percentage"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_nic"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject_to_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_reduced_by_basic_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "apply_to_pension_calculations"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_calculating_on_qualifying_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_pension"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/deductions_spec.rb b/spec/payroll_uk/models/deductions_spec.rb new file mode 100644 index 00000000..135afb0e --- /dev/null +++ b/spec/payroll_uk/models/deductions_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Deductions +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Deductions' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Deductions.new + end + + after do + # run after each test + end + + describe 'test an instance of Deductions' do + it 'should create an instance of Deductions' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Deductions) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_line_spec.rb b/spec/payroll_uk/models/earnings_line_spec.rb new file mode 100644 index 00000000..bd3862d3 --- /dev/null +++ b/spec/payroll_uk/models/earnings_line_spec.rb @@ -0,0 +1,89 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsLine' do + it 'should create an instance of EarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsLine) + end + end + describe 'test attribute "earnings_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "display_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_average_daily_pay_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_order_object_spec.rb b/spec/payroll_uk/models/earnings_order_object_spec.rb new file mode 100644 index 00000000..ad743dff --- /dev/null +++ b/spec/payroll_uk/models/earnings_order_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsOrderObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrderObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsOrderObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrderObject' do + it 'should create an instance of EarningsOrderObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsOrderObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_order_spec.rb b/spec/payroll_uk/models/earnings_order_spec.rb new file mode 100644 index 00000000..fd1c0fae --- /dev/null +++ b/spec/payroll_uk/models/earnings_order_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsOrder +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrder' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsOrder.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrder' do + it 'should create an instance of EarningsOrder' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsOrder) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_orders_spec.rb b/spec/payroll_uk/models/earnings_orders_spec.rb new file mode 100644 index 00000000..19cb09f0 --- /dev/null +++ b/spec/payroll_uk/models/earnings_orders_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsOrders +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsOrders' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsOrders.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsOrders' do + it 'should create an instance of EarningsOrders' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsOrders) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_rate_object_spec.rb b/spec/payroll_uk/models/earnings_rate_object_spec.rb new file mode 100644 index 00000000..6a352c35 --- /dev/null +++ b/spec/payroll_uk/models/earnings_rate_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsRateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsRateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRateObject' do + it 'should create an instance of EarningsRateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsRateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_rate_spec.rb b/spec/payroll_uk/models/earnings_rate_spec.rb new file mode 100644 index 00000000..a5a791ea --- /dev/null +++ b/spec/payroll_uk/models/earnings_rate_spec.rb @@ -0,0 +1,103 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsRate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRate' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsRate.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRate' do + it 'should create an instance of EarningsRate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsRate) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"]) + # validator.allowable_values.each do |value| + # expect { @instance.earnings_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "rate_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"]) + # validator.allowable_values.each do |value| + # expect { @instance.rate_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "multiple_of_ordinary_earnings_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_rates_spec.rb b/spec/payroll_uk/models/earnings_rates_spec.rb new file mode 100644 index 00000000..1aefe947 --- /dev/null +++ b/spec/payroll_uk/models/earnings_rates_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsRates +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsRates' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsRates.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsRates' do + it 'should create an instance of EarningsRates' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsRates) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_template_object_spec.rb b/spec/payroll_uk/models/earnings_template_object_spec.rb new file mode 100644 index 00000000..64f79ef7 --- /dev/null +++ b/spec/payroll_uk/models/earnings_template_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsTemplateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsTemplateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsTemplateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsTemplateObject' do + it 'should create an instance of EarningsTemplateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsTemplateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/earnings_template_spec.rb b/spec/payroll_uk/models/earnings_template_spec.rb new file mode 100644 index 00000000..e22327e6 --- /dev/null +++ b/spec/payroll_uk/models/earnings_template_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EarningsTemplate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EarningsTemplate' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EarningsTemplate.new + end + + after do + # run after each test + end + + describe 'test an instance of EarningsTemplate' do + it 'should create an instance of EarningsTemplate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EarningsTemplate) + end + end + describe 'test attribute "pay_template_earning_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_balance_spec.rb b/spec/payroll_uk/models/employee_leave_balance_spec.rb new file mode 100644 index 00000000..2b0447e6 --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_balance_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveBalance' do + it 'should create an instance of EmployeeLeaveBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveBalance) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_balances_spec.rb b/spec/payroll_uk/models/employee_leave_balances_spec.rb new file mode 100644 index 00000000..0ea50859 --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_balances_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveBalances +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveBalances' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveBalances.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveBalances' do + it 'should create an instance of EmployeeLeaveBalances' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveBalances) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_object_spec.rb b/spec/payroll_uk/models/employee_leave_object_spec.rb new file mode 100644 index 00000000..2860b959 --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveObject' do + it 'should create an instance of EmployeeLeaveObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_spec.rb b/spec/payroll_uk/models/employee_leave_spec.rb new file mode 100644 index 00000000..084b01ef --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_spec.rb @@ -0,0 +1,77 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeave +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeave' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeave.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeave' do + it 'should create an instance of EmployeeLeave' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeave) + end + end + describe 'test attribute "leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "periods"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_type_object_spec.rb b/spec/payroll_uk/models/employee_leave_type_object_spec.rb new file mode 100644 index 00000000..04531da7 --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_type_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveTypeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveTypeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveTypeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveTypeObject' do + it 'should create an instance of EmployeeLeaveTypeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveTypeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_type_spec.rb b/spec/payroll_uk/models/employee_leave_type_spec.rb new file mode 100644 index 00000000..6876e3ca --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_type_spec.rb @@ -0,0 +1,75 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveType' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveType.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveType' do + it 'should create an instance of EmployeeLeaveType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveType) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "schedule_of_accrual"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BeginningOfCalendarYear", "OnAnniversaryDate", "EachPayPeriod", "OnHourWorked"]) + # validator.allowable_values.each do |value| + # expect { @instance.schedule_of_accrual = value }.not_to raise_error + # end + end + end + + describe 'test attribute "hours_accrued_annually"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "maximum_to_accrue"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opening_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_accrued_hourly"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leave_types_spec.rb b/spec/payroll_uk/models/employee_leave_types_spec.rb new file mode 100644 index 00000000..04cd77cc --- /dev/null +++ b/spec/payroll_uk/models/employee_leave_types_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaveTypes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaveTypes' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaveTypes.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaveTypes' do + it 'should create an instance of EmployeeLeaveTypes' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaveTypes) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_leaves_spec.rb b/spec/payroll_uk/models/employee_leaves_spec.rb new file mode 100644 index 00000000..f0d9063b --- /dev/null +++ b/spec/payroll_uk/models/employee_leaves_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeLeaves +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeLeaves' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeLeaves.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeLeaves' do + it 'should create an instance of EmployeeLeaves' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeLeaves) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_object_spec.rb b/spec/payroll_uk/models/employee_object_spec.rb new file mode 100644 index 00000000..a5117669 --- /dev/null +++ b/spec/payroll_uk/models/employee_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeObject' do + it 'should create an instance of EmployeeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_opening_balances_object_spec.rb b/spec/payroll_uk/models/employee_opening_balances_object_spec.rb new file mode 100644 index 00000000..13581029 --- /dev/null +++ b/spec/payroll_uk/models/employee_opening_balances_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeOpeningBalancesObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeOpeningBalancesObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeOpeningBalancesObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeOpeningBalancesObject' do + it 'should create an instance of EmployeeOpeningBalancesObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeOpeningBalancesObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opening_balances"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_opening_balances_spec.rb b/spec/payroll_uk/models/employee_opening_balances_spec.rb new file mode 100644 index 00000000..81b9013a --- /dev/null +++ b/spec/payroll_uk/models/employee_opening_balances_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeOpeningBalances +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeOpeningBalances' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeOpeningBalances.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeOpeningBalances' do + it 'should create an instance of EmployeeOpeningBalances' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeOpeningBalances) + end + end + describe 'test attribute "statutory_adoption_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_maternity_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_paternity_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_shared_parental_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_sick_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prior_employee_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_pay_template_object_spec.rb b/spec/payroll_uk/models/employee_pay_template_object_spec.rb new file mode 100644 index 00000000..139ac9aa --- /dev/null +++ b/spec/payroll_uk/models/employee_pay_template_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeePayTemplateObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplateObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeePayTemplateObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplateObject' do + it 'should create an instance of EmployeePayTemplateObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeePayTemplateObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_template"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_pay_template_spec.rb b/spec/payroll_uk/models/employee_pay_template_spec.rb new file mode 100644 index 00000000..17c61b64 --- /dev/null +++ b/spec/payroll_uk/models/employee_pay_template_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeePayTemplate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplate' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeePayTemplate.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplate' do + it 'should create an instance of EmployeePayTemplate' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeePayTemplate) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_templates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_pay_templates_spec.rb b/spec/payroll_uk/models/employee_pay_templates_spec.rb new file mode 100644 index 00000000..cb87f401 --- /dev/null +++ b/spec/payroll_uk/models/employee_pay_templates_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeePayTemplates +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeePayTemplates' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeePayTemplates.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeePayTemplates' do + it 'should create an instance of EmployeePayTemplates' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeePayTemplates) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earning_templates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_spec.rb b/spec/payroll_uk/models/employee_spec.rb new file mode 100644 index 00000000..6976db45 --- /dev/null +++ b/spec/payroll_uk/models/employee_spec.rb @@ -0,0 +1,129 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Employee +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employee' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Employee.new + end + + after do + # run after each test + end + + describe 'test an instance of Employee' do + it 'should create an instance of Employee' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Employee) + end + end + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_of_birth"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gender"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["M", "F"]) + # validator.allowable_values.each do |value| + # expect { @instance.gender = value }.not_to raise_error + # end + end + end + + describe 'test attribute "phone_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "national_insurance_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_leave_balance_object_spec.rb b/spec/payroll_uk/models/employee_statutory_leave_balance_object_spec.rb new file mode 100644 index 00000000..97cd740e --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_leave_balance_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveBalanceObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveBalanceObject' do + it 'should create an instance of EmployeeStatutoryLeaveBalanceObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalanceObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_balance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_leave_balance_spec.rb b/spec/payroll_uk/models/employee_statutory_leave_balance_spec.rb new file mode 100644 index 00000000..f6a1365b --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_leave_balance_spec.rb @@ -0,0 +1,61 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveBalance' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveBalance' do + it 'should create an instance of EmployeeStatutoryLeaveBalance' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutoryLeaveBalance) + end + end + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + # validator.allowable_values.each do |value| + # expect { @instance.leave_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "balance_remaining"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Hours"]) + # validator.allowable_values.each do |value| + # expect { @instance.units = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_leave_summary_spec.rb b/spec/payroll_uk/models/employee_statutory_leave_summary_spec.rb new file mode 100644 index 00000000..cb11ed25 --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_leave_summary_spec.rb @@ -0,0 +1,85 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeaveSummary' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeaveSummary' do + it 'should create an instance of EmployeeStatutoryLeaveSummary' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutoryLeaveSummary) + end + end + describe 'test attribute "statutory_leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"]) + # validator.allowable_values.each do |value| + # expect { @instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_entitled"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_leaves_summaries_spec.rb b/spec/payroll_uk/models/employee_statutory_leaves_summaries_spec.rb new file mode 100644 index 00000000..1cb53bdb --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_leaves_summaries_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutoryLeavesSummaries' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutoryLeavesSummaries' do + it 'should create an instance of EmployeeStatutoryLeavesSummaries' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutoryLeavesSummaries) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_leaves"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_sick_leave_object_spec.rb b/spec/payroll_uk/models/employee_statutory_sick_leave_object_spec.rb new file mode 100644 index 00000000..7f2173f2 --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_sick_leave_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeaveObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeaveObject' do + it 'should create an instance of EmployeeStatutorySickLeaveObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutorySickLeaveObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_sick_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_sick_leave_spec.rb b/spec/payroll_uk/models/employee_statutory_sick_leave_spec.rb new file mode 100644 index 00000000..f6eb1728 --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_sick_leave_spec.rb @@ -0,0 +1,135 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutorySickLeave +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeave' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeave.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeave' do + it 'should create an instance of EmployeeStatutorySickLeave' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutorySickLeave) + end + end + describe 'test attribute "statutory_leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "work_pattern"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_pregnancy_related"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sufficient_notice"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_entitled"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_requested"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_qualified"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_weeks_remaining"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "overlaps_with_other_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "entitlement_failure_reasons"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["UnableToCalculateAwe", "AweLowerThanLel", "NotQualifiedInPreviousPiw", "ExceededMaximumEntitlementWeeksOfSsp", "ExceededMaximumDurationOfPiw", "SufficientNoticeNotGiven"]) + # validator.allowable_values.each do |value| + # expect { @instance.entitlement_failure_reasons = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/employee_statutory_sick_leaves_spec.rb b/spec/payroll_uk/models/employee_statutory_sick_leaves_spec.rb new file mode 100644 index 00000000..63962986 --- /dev/null +++ b/spec/payroll_uk/models/employee_statutory_sick_leaves_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeStatutorySickLeaves +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeStatutorySickLeaves' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeStatutorySickLeaves.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeStatutorySickLeaves' do + it 'should create an instance of EmployeeStatutorySickLeaves' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeStatutorySickLeaves) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_sick_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_tax_object_spec.rb b/spec/payroll_uk/models/employee_tax_object_spec.rb new file mode 100644 index 00000000..5656126e --- /dev/null +++ b/spec/payroll_uk/models/employee_tax_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeTaxObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeTaxObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeTaxObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeTaxObject' do + it 'should create an instance of EmployeeTaxObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeTaxObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employee_tax_spec.rb b/spec/payroll_uk/models/employee_tax_spec.rb new file mode 100644 index 00000000..c0a0acee --- /dev/null +++ b/spec/payroll_uk/models/employee_tax_spec.rb @@ -0,0 +1,101 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmployeeTax +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmployeeTax' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmployeeTax.new + end + + after do + # run after each test + end + + describe 'test an instance of EmployeeTax' do + it 'should create an instance of EmployeeTax' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmployeeTax) + end + end + describe 'test attribute "starter_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "starter_declaration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tax_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "w1_m1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "previous_taxable_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "previous_tax_paid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "student_loan_deduction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_post_graduate_loans"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_director"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "directorship_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "nic_calculation_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employees_spec.rb b/spec/payroll_uk/models/employees_spec.rb new file mode 100644 index 00000000..7e4f7ce0 --- /dev/null +++ b/spec/payroll_uk/models/employees_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Employees +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employees' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Employees.new + end + + after do + # run after each test + end + + describe 'test an instance of Employees' do + it 'should create an instance of Employees' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Employees) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employees"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employment_object_spec.rb b/spec/payroll_uk/models/employment_object_spec.rb new file mode 100644 index 00000000..3577884b --- /dev/null +++ b/spec/payroll_uk/models/employment_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::EmploymentObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EmploymentObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::EmploymentObject.new + end + + after do + # run after each test + end + + describe 'test an instance of EmploymentObject' do + it 'should create an instance of EmploymentObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::EmploymentObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/employment_spec.rb b/spec/payroll_uk/models/employment_spec.rb new file mode 100644 index 00000000..dc610df1 --- /dev/null +++ b/spec/payroll_uk/models/employment_spec.rb @@ -0,0 +1,63 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Employment +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Employment' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Employment.new + end + + after do + # run after each test + end + + describe 'test an instance of Employment' do + it 'should create an instance of Employment' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Employment) + end + end + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ni_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["A", "B", "C", "H", "J", "M", "Z", "X"]) + # validator.allowable_values.each do |value| + # expect { @instance.ni_category = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/invalid_field_spec.rb b/spec/payroll_uk/models/invalid_field_spec.rb new file mode 100644 index 00000000..7fd3f381 --- /dev/null +++ b/spec/payroll_uk/models/invalid_field_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::InvalidField +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InvalidField' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::InvalidField.new + end + + after do + # run after each test + end + + describe 'test an instance of InvalidField' do + it 'should create an instance of InvalidField' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::InvalidField) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reason"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_accrual_line_spec.rb b/spec/payroll_uk/models/leave_accrual_line_spec.rb new file mode 100644 index 00000000..cf7f8936 --- /dev/null +++ b/spec/payroll_uk/models/leave_accrual_line_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeaveAccrualLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveAccrualLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeaveAccrualLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveAccrualLine' do + it 'should create an instance of LeaveAccrualLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeaveAccrualLine) + end + end + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_earnings_line_spec.rb b/spec/payroll_uk/models/leave_earnings_line_spec.rb new file mode 100644 index 00000000..7cb2ee08 --- /dev/null +++ b/spec/payroll_uk/models/leave_earnings_line_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeaveEarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveEarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeaveEarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveEarningsLine' do + it 'should create an instance of LeaveEarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeaveEarningsLine) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_period_spec.rb b/spec/payroll_uk/models/leave_period_spec.rb new file mode 100644 index 00000000..ff328b15 --- /dev/null +++ b/spec/payroll_uk/models/leave_period_spec.rb @@ -0,0 +1,63 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeavePeriod +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriod' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeavePeriod.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriod' do + it 'should create an instance of LeavePeriod' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeavePeriod) + end + end + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Approved", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.period_status = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/leave_periods_spec.rb b/spec/payroll_uk/models/leave_periods_spec.rb new file mode 100644 index 00000000..ee82904e --- /dev/null +++ b/spec/payroll_uk/models/leave_periods_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeavePeriods +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeavePeriods' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeavePeriods.new + end + + after do + # run after each test + end + + describe 'test an instance of LeavePeriods' do + it 'should create an instance of LeavePeriods' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeavePeriods) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "periods"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_type_object_spec.rb b/spec/payroll_uk/models/leave_type_object_spec.rb new file mode 100644 index 00000000..6ce90abc --- /dev/null +++ b/spec/payroll_uk/models/leave_type_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeaveTypeObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveTypeObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeaveTypeObject.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveTypeObject' do + it 'should create an instance of LeaveTypeObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeaveTypeObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_type_spec.rb b/spec/payroll_uk/models/leave_type_spec.rb new file mode 100644 index 00000000..6c161aef --- /dev/null +++ b/spec/payroll_uk/models/leave_type_spec.rb @@ -0,0 +1,83 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeaveType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveType' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeaveType.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveType' do + it 'should create an instance of LeaveType' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeaveType) + end + end + describe 'test attribute "leave_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_paid_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "show_on_payslip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_statutory_leave"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/leave_types_spec.rb b/spec/payroll_uk/models/leave_types_spec.rb new file mode 100644 index 00000000..9e567555 --- /dev/null +++ b/spec/payroll_uk/models/leave_types_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::LeaveTypes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'LeaveTypes' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::LeaveTypes.new + end + + after do + # run after each test + end + + describe 'test an instance of LeaveTypes' do + it 'should create an instance of LeaveTypes' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::LeaveTypes) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pagination_spec.rb b/spec/payroll_uk/models/pagination_spec.rb new file mode 100644 index 00000000..433dfac8 --- /dev/null +++ b/spec/payroll_uk/models/pagination_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Pagination +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Pagination' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Pagination.new + end + + after do + # run after each test + end + + describe 'test an instance of Pagination' do + it 'should create an instance of Pagination' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Pagination) + end + end + describe 'test attribute "page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "item_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_run_calendar_object_spec.rb b/spec/payroll_uk/models/pay_run_calendar_object_spec.rb new file mode 100644 index 00000000..30f466ae --- /dev/null +++ b/spec/payroll_uk/models/pay_run_calendar_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRunCalendarObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendarObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRunCalendarObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendarObject' do + it 'should create an instance of PayRunCalendarObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRunCalendarObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_calendar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_run_calendar_spec.rb b/spec/payroll_uk/models/pay_run_calendar_spec.rb new file mode 100644 index 00000000..7f71cfeb --- /dev/null +++ b/spec/payroll_uk/models/pay_run_calendar_spec.rb @@ -0,0 +1,81 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRunCalendar +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendar' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRunCalendar.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendar' do + it 'should create an instance of PayRunCalendar' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRunCalendar) + end + end + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "calendar_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + # validator.allowable_values.each do |value| + # expect { @instance.calendar_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_run_calendars_spec.rb b/spec/payroll_uk/models/pay_run_calendars_spec.rb new file mode 100644 index 00000000..652cbe30 --- /dev/null +++ b/spec/payroll_uk/models/pay_run_calendars_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRunCalendars +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunCalendars' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRunCalendars.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunCalendars' do + it 'should create an instance of PayRunCalendars' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRunCalendars) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_calendars"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_run_object_spec.rb b/spec/payroll_uk/models/pay_run_object_spec.rb new file mode 100644 index 00000000..f50c04aa --- /dev/null +++ b/spec/payroll_uk/models/pay_run_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRunObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRunObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRunObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRunObject' do + it 'should create an instance of PayRunObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRunObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_run_spec.rb b/spec/payroll_uk/models/pay_run_spec.rb new file mode 100644 index 00000000..4a1296b6 --- /dev/null +++ b/spec/payroll_uk/models/pay_run_spec.rb @@ -0,0 +1,119 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRun +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRun' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRun.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRun' do + it 'should create an instance of PayRun' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRun) + end + end + describe 'test attribute "pay_run_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "period_end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_cost"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Draft", "Posted"]) + # validator.allowable_values.each do |value| + # expect { @instance.pay_run_status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "pay_run_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Scheduled", "Unscheduled", "EarlierYearUpdate"]) + # validator.allowable_values.each do |value| + # expect { @instance.pay_run_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "calendar_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Weekly", "Fortnightly", "FourWeekly", "Monthly", "Annual", "Quarterly"]) + # validator.allowable_values.each do |value| + # expect { @instance.calendar_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "posted_date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/pay_runs_spec.rb b/spec/payroll_uk/models/pay_runs_spec.rb new file mode 100644 index 00000000..5066c6b3 --- /dev/null +++ b/spec/payroll_uk/models/pay_runs_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayRuns +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayRuns' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayRuns.new + end + + after do + # run after each test + end + + describe 'test an instance of PayRuns' do + it 'should create an instance of PayRuns' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayRuns) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_runs"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payment_line_spec.rb b/spec/payroll_uk/models/payment_line_spec.rb new file mode 100644 index 00000000..a538b61c --- /dev/null +++ b/spec/payroll_uk/models/payment_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PaymentLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PaymentLine.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentLine' do + it 'should create an instance of PaymentLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PaymentLine) + end + end + describe 'test attribute "payment_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payment_method_object_spec.rb b/spec/payroll_uk/models/payment_method_object_spec.rb new file mode 100644 index 00000000..c7466706 --- /dev/null +++ b/spec/payroll_uk/models/payment_method_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PaymentMethodObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentMethodObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PaymentMethodObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentMethodObject' do + it 'should create an instance of PaymentMethodObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PaymentMethodObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payment_method_spec.rb b/spec/payroll_uk/models/payment_method_spec.rb new file mode 100644 index 00000000..42057c4a --- /dev/null +++ b/spec/payroll_uk/models/payment_method_spec.rb @@ -0,0 +1,51 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PaymentMethod +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PaymentMethod' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PaymentMethod.new + end + + after do + # run after each test + end + + describe 'test an instance of PaymentMethod' do + it 'should create an instance of PaymentMethod' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PaymentMethod) + end + end + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "bank_accounts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payslip_object_spec.rb b/spec/payroll_uk/models/payslip_object_spec.rb new file mode 100644 index 00000000..cf980bb6 --- /dev/null +++ b/spec/payroll_uk/models/payslip_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::PayslipObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PayslipObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::PayslipObject.new + end + + after do + # run after each test + end + + describe 'test an instance of PayslipObject' do + it 'should create an instance of PayslipObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::PayslipObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payslip_spec.rb b/spec/payroll_uk/models/payslip_spec.rb new file mode 100644 index 00000000..8d4936ec --- /dev/null +++ b/spec/payroll_uk/models/payslip_spec.rb @@ -0,0 +1,201 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Payslip +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Payslip' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Payslip.new + end + + after do + # run after each test + end + + describe 'test an instance of Payslip' do + it 'should create an instance of Payslip' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Payslip) + end + end + describe 'test attribute "pay_slip_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_run_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_edited"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gross_earnings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_pay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_employer_taxes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_employee_taxes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_deductions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_court_orders"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_benefits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bacs_hash"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_earnings_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deduction_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "leave_accrual_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "benefit_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payment_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_tax_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "court_order_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/payslips_spec.rb b/spec/payroll_uk/models/payslips_spec.rb new file mode 100644 index 00000000..42b92272 --- /dev/null +++ b/spec/payroll_uk/models/payslips_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Payslips +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Payslips' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Payslips.new + end + + after do + # run after each test + end + + describe 'test an instance of Payslips' do + it 'should create an instance of Payslips' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Payslips) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pay_slips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/problem_spec.rb b/spec/payroll_uk/models/problem_spec.rb new file mode 100644 index 00000000..12cf9785 --- /dev/null +++ b/spec/payroll_uk/models/problem_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Problem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Problem' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Problem.new + end + + after do + # run after each test + end + + describe 'test an instance of Problem' do + it 'should create an instance of Problem' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Problem) + end + end + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "detail"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "instance"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "invalid_fields"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/reimbursement_line_spec.rb b/spec/payroll_uk/models/reimbursement_line_spec.rb new file mode 100644 index 00000000..8676b4cb --- /dev/null +++ b/spec/payroll_uk/models/reimbursement_line_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::ReimbursementLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::ReimbursementLine.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementLine' do + it 'should create an instance of ReimbursementLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::ReimbursementLine) + end + end + describe 'test attribute "reimbursement_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/reimbursement_object_spec.rb b/spec/payroll_uk/models/reimbursement_object_spec.rb new file mode 100644 index 00000000..d2cb650e --- /dev/null +++ b/spec/payroll_uk/models/reimbursement_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::ReimbursementObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReimbursementObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::ReimbursementObject.new + end + + after do + # run after each test + end + + describe 'test an instance of ReimbursementObject' do + it 'should create an instance of ReimbursementObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::ReimbursementObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursement"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/reimbursement_spec.rb b/spec/payroll_uk/models/reimbursement_spec.rb new file mode 100644 index 00000000..65297bbf --- /dev/null +++ b/spec/payroll_uk/models/reimbursement_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Reimbursement +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Reimbursement' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Reimbursement.new + end + + after do + # run after each test + end + + describe 'test an instance of Reimbursement' do + it 'should create an instance of Reimbursement' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Reimbursement) + end + end + describe 'test attribute "reimbursement_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/reimbursements_spec.rb b/spec/payroll_uk/models/reimbursements_spec.rb new file mode 100644 index 00000000..ea5ca7a9 --- /dev/null +++ b/spec/payroll_uk/models/reimbursements_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Reimbursements +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Reimbursements' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Reimbursements.new + end + + after do + # run after each test + end + + describe 'test an instance of Reimbursements' do + it 'should create an instance of Reimbursements' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Reimbursements) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reimbursements"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/salary_and_wage_object_spec.rb b/spec/payroll_uk/models/salary_and_wage_object_spec.rb new file mode 100644 index 00000000..a5a2b6c3 --- /dev/null +++ b/spec/payroll_uk/models/salary_and_wage_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::SalaryAndWageObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWageObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::SalaryAndWageObject.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWageObject' do + it 'should create an instance of SalaryAndWageObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::SalaryAndWageObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "salary_and_wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/salary_and_wage_spec.rb b/spec/payroll_uk/models/salary_and_wage_spec.rb new file mode 100644 index 00000000..39ea62b8 --- /dev/null +++ b/spec/payroll_uk/models/salary_and_wage_spec.rb @@ -0,0 +1,97 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::SalaryAndWage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWage' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::SalaryAndWage.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWage' do + it 'should create an instance of SalaryAndWage' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::SalaryAndWage) + end + end + describe 'test attribute "salary_and_wages_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units_per_week"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units_per_day"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "effective_from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "annual_salary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Active", "Pending", "History"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "payment_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Salary"]) + # validator.allowable_values.each do |value| + # expect { @instance.payment_type = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/payroll_uk/models/salary_and_wages_spec.rb b/spec/payroll_uk/models/salary_and_wages_spec.rb new file mode 100644 index 00000000..5001854b --- /dev/null +++ b/spec/payroll_uk/models/salary_and_wages_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::SalaryAndWages +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SalaryAndWages' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::SalaryAndWages.new + end + + after do + # run after each test + end + + describe 'test an instance of SalaryAndWages' do + it 'should create an instance of SalaryAndWages' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::SalaryAndWages) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "salary_and_wages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/settings_spec.rb b/spec/payroll_uk/models/settings_spec.rb new file mode 100644 index 00000000..a5abfb3c --- /dev/null +++ b/spec/payroll_uk/models/settings_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Settings +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Settings' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Settings.new + end + + after do + # run after each test + end + + describe 'test an instance of Settings' do + it 'should create an instance of Settings' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Settings) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "settings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/statutory_deduction_category_spec.rb b/spec/payroll_uk/models/statutory_deduction_category_spec.rb new file mode 100644 index 00000000..e00f770e --- /dev/null +++ b/spec/payroll_uk/models/statutory_deduction_category_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::StatutoryDeductionCategory +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeductionCategory' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::StatutoryDeductionCategory.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeductionCategory' do + it 'should create an instance of StatutoryDeductionCategory' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::StatutoryDeductionCategory) + end + end +end diff --git a/spec/payroll_uk/models/statutory_deduction_spec.rb b/spec/payroll_uk/models/statutory_deduction_spec.rb new file mode 100644 index 00000000..56c896d5 --- /dev/null +++ b/spec/payroll_uk/models/statutory_deduction_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::StatutoryDeduction +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatutoryDeduction' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::StatutoryDeduction.new + end + + after do + # run after each test + end + + describe 'test an instance of StatutoryDeduction' do + it 'should create an instance of StatutoryDeduction' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::StatutoryDeduction) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statutory_deduction_category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "liability_account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "current_record"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/tax_line_spec.rb b/spec/payroll_uk/models/tax_line_spec.rb new file mode 100644 index 00000000..1fe87d75 --- /dev/null +++ b/spec/payroll_uk/models/tax_line_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TaxLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaxLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TaxLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TaxLine' do + it 'should create an instance of TaxLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TaxLine) + end + end + describe 'test attribute "tax_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_employer_tax"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "global_tax_type_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "manual_adjustment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheet_earnings_line_spec.rb b/spec/payroll_uk/models/timesheet_earnings_line_spec.rb new file mode 100644 index 00000000..f34eb274 --- /dev/null +++ b/spec/payroll_uk/models/timesheet_earnings_line_spec.rb @@ -0,0 +1,71 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TimesheetEarningsLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetEarningsLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TimesheetEarningsLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetEarningsLine' do + it 'should create an instance of TimesheetEarningsLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TimesheetEarningsLine) + end + end + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate_per_unit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_linked_to_timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheet_line_object_spec.rb b/spec/payroll_uk/models/timesheet_line_object_spec.rb new file mode 100644 index 00000000..0a01d608 --- /dev/null +++ b/spec/payroll_uk/models/timesheet_line_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TimesheetLineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetLineObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TimesheetLineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetLineObject' do + it 'should create an instance of TimesheetLineObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TimesheetLineObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_line"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheet_line_spec.rb b/spec/payroll_uk/models/timesheet_line_spec.rb new file mode 100644 index 00000000..e8745e61 --- /dev/null +++ b/spec/payroll_uk/models/timesheet_line_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TimesheetLine +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetLine' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TimesheetLine.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetLine' do + it 'should create an instance of TimesheetLine' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TimesheetLine) + end + end + describe 'test attribute "timesheet_line_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "earnings_rate_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_item_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_of_units"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheet_object_spec.rb b/spec/payroll_uk/models/timesheet_object_spec.rb new file mode 100644 index 00000000..26d9f708 --- /dev/null +++ b/spec/payroll_uk/models/timesheet_object_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TimesheetObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimesheetObject' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TimesheetObject.new + end + + after do + # run after each test + end + + describe 'test an instance of TimesheetObject' do + it 'should create an instance of TimesheetObject' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TimesheetObject) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheet_spec.rb b/spec/payroll_uk/models/timesheet_spec.rb new file mode 100644 index 00000000..3d95d3a1 --- /dev/null +++ b/spec/payroll_uk/models/timesheet_spec.rb @@ -0,0 +1,93 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Timesheet +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheet' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Timesheet.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheet' do + it 'should create an instance of Timesheet' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Timesheet) + end + end + describe 'test attribute "timesheet_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payroll_calendar_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "employee_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Draft", "Approved", "Completed"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "total_hours"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_lines"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/timesheets_spec.rb b/spec/payroll_uk/models/timesheets_spec.rb new file mode 100644 index 00000000..5f9a541c --- /dev/null +++ b/spec/payroll_uk/models/timesheets_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::Timesheets +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Timesheets' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::Timesheets.new + end + + after do + # run after each test + end + + describe 'test an instance of Timesheets' do + it 'should create an instance of Timesheets' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::Timesheets) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheets"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/tracking_categories_spec.rb b/spec/payroll_uk/models/tracking_categories_spec.rb new file mode 100644 index 00000000..af159f53 --- /dev/null +++ b/spec/payroll_uk/models/tracking_categories_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TrackingCategories +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TrackingCategories' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TrackingCategories.new + end + + after do + # run after each test + end + + describe 'test an instance of TrackingCategories' do + it 'should create an instance of TrackingCategories' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TrackingCategories) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "problem"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tracking_categories"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/payroll_uk/models/tracking_category_spec.rb b/spec/payroll_uk/models/tracking_category_spec.rb new file mode 100644 index 00000000..566d48ef --- /dev/null +++ b/spec/payroll_uk/models/tracking_category_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Payroll UK + +#This is the Xero Payroll API for orgs in the UK region. + +The version of the OpenAPI document: 2.3.7 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::PayrollUk::TrackingCategory +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TrackingCategory' do + before do + # run before each test + @instance = XeroRuby::PayrollUk::TrackingCategory.new + end + + after do + # run after each test + end + + describe 'test an instance of TrackingCategory' do + it 'should create an instance of TrackingCategory' do + expect(@instance).to be_instance_of(XeroRuby::PayrollUk::TrackingCategory) + end + end + describe 'test attribute "employee_groups_tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timesheet_tracking_category_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/xero-ruby.gemspec b/xero-ruby.gemspec index 02b39380..bc23f9fe 100644 --- a/xero-ruby.gemspec +++ b/xero-ruby.gemspec @@ -5,7 +5,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.2 +The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 From a19a06b4a71a5994b9683b6be74f03e5ed7a061e Mon Sep 17 00:00:00 2001 From: serknight Date: Mon, 26 Oct 2020 17:20:21 -0600 Subject: [PATCH 2/5] fix specs and rest of manual build updates --- lib/xero-ruby/models/accounting/account.rb | 2 +- .../models/accounting/currency_code.rb | 4 +-- .../models/accounting/organisation.rb | 26 +++++++++---------- spec/files/api/files_api_spec.rb | 6 ++--- spec/payroll_au/api/payroll_au_api_spec.rb | 6 ++--- spec/payroll_nz/api/payroll_nz_api_spec.rb | 6 ++--- spec/payroll_uk/api/payroll_uk_api_spec.rb | 6 ++--- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index 745c2d25..88f85ab8 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -91,7 +91,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - EMPTY = "".freeze + # EMPTY = "".freeze # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb index c80f8302..fa83a873 100644 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -156,7 +156,7 @@ class CurrencyCode TMT = "TMT".freeze TND = "TND".freeze TOP = "TOP".freeze - _TRY = "TRY".freeze + TRY = "TRY".freeze TTD = "TTD".freeze TVD = "TVD".freeze TWD = "TWD".freeze @@ -180,7 +180,7 @@ class CurrencyCode ZMW = "ZMW".freeze ZMK = "ZMK".freeze ZWD = "ZWD".freeze - _EMPTY = "".freeze + EMPTY = "".freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 4079e329..24f9ed25 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -114,7 +114,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - NONE = "NONE".freeze + # NONE = "NONE".freeze # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax @@ -136,18 +136,18 @@ class Organisation # Organisation Entity Type attr_accessor :organisation_entity_type - ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze - COMPANY = "COMPANY".freeze - CHARITY = "CHARITY".freeze - CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze - LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze - NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze - PARTNERSHIP = "PARTNERSHIP".freeze - S_CORPORATION = "S_CORPORATION".freeze - SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze - SOLE_TRADER = "SOLE_TRADER".freeze - SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze - TRUST = "TRUST".freeze + # ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + # COMPANY = "COMPANY".freeze + # CHARITY = "CHARITY".freeze + # CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + # LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + # NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + # PARTNERSHIP = "PARTNERSHIP".freeze + # S_CORPORATION = "S_CORPORATION".freeze + # SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + # SOLE_TRADER = "SOLE_TRADER".freeze + # SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + # TRUST = "TRUST".freeze # A unique identifier for the organisation. Potential uses. attr_accessor :short_code diff --git a/spec/files/api/files_api_spec.rb b/spec/files/api/files_api_spec.rb index 8aeb57c0..9d5dccde 100644 --- a/spec/files/api/files_api_spec.rb +++ b/spec/files/api/files_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::Files::FilesApi +# Unit tests for XeroRuby::FilesApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'FilesApi' do before do # run before each test - @api_instance = XeroRuby::Files::FilesApi.new + @api_instance = XeroRuby::FilesApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of FilesApi' do it 'should create an instance of FilesApi' do - expect(@api_instance).to be_instance_of(XeroRuby::Files::FilesApi) + expect(@api_instance).to be_instance_of(XeroRuby::FilesApi) end end diff --git a/spec/payroll_au/api/payroll_au_api_spec.rb b/spec/payroll_au/api/payroll_au_api_spec.rb index fe414205..b6227d81 100644 --- a/spec/payroll_au/api/payroll_au_api_spec.rb +++ b/spec/payroll_au/api/payroll_au_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::PayrollAu::PayrollAuApi +# Unit tests for XeroRuby::PayrollAuApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'PayrollAuApi' do before do # run before each test - @api_instance = XeroRuby::PayrollAu::PayrollAuApi.new + @api_instance = XeroRuby::PayrollAuApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of PayrollAuApi' do it 'should create an instance of PayrollAuApi' do - expect(@api_instance).to be_instance_of(XeroRuby::PayrollAu::PayrollAuApi) + expect(@api_instance).to be_instance_of(XeroRuby::PayrollAuApi) end end diff --git a/spec/payroll_nz/api/payroll_nz_api_spec.rb b/spec/payroll_nz/api/payroll_nz_api_spec.rb index 233070e4..73546413 100644 --- a/spec/payroll_nz/api/payroll_nz_api_spec.rb +++ b/spec/payroll_nz/api/payroll_nz_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::PayrollNz::PayrollNzApi +# Unit tests for XeroRuby::PayrollNzApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'PayrollNzApi' do before do # run before each test - @api_instance = XeroRuby::PayrollNz::PayrollNzApi.new + @api_instance = XeroRuby::PayrollNzApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of PayrollNzApi' do it 'should create an instance of PayrollNzApi' do - expect(@api_instance).to be_instance_of(XeroRuby::PayrollNz::PayrollNzApi) + expect(@api_instance).to be_instance_of(XeroRuby::PayrollNzApi) end end diff --git a/spec/payroll_uk/api/payroll_uk_api_spec.rb b/spec/payroll_uk/api/payroll_uk_api_spec.rb index 35061b42..e93023c7 100644 --- a/spec/payroll_uk/api/payroll_uk_api_spec.rb +++ b/spec/payroll_uk/api/payroll_uk_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::PayrollUk::PayrollUkApi +# Unit tests for XeroRuby::PayrollUkApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'PayrollUkApi' do before do # run before each test - @api_instance = XeroRuby::PayrollUk::PayrollUkApi.new + @api_instance = XeroRuby::PayrollUkApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of PayrollUkApi' do it 'should create an instance of PayrollUkApi' do - expect(@api_instance).to be_instance_of(XeroRuby::PayrollUk::PayrollUkApi) + expect(@api_instance).to be_instance_of(XeroRuby::PayrollUkApi) end end From 1f97df9007d382b20d78b3d82d2c35d14474e693 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 28 Oct 2020 15:22:45 -0600 Subject: [PATCH 3/5] generated form most recent spec, and the files debugging PR --- README.md | 52 +++--- docs/accounting/AccountingApi.md | 160 ++++++++---------- docs/accounting/ExpenseClaim.md | 2 +- lib/xero-ruby.rb | 2 +- lib/xero-ruby/api/accounting_api.rb | 94 +++++----- lib/xero-ruby/api/asset_api.rb | 2 +- lib/xero-ruby/api/files_api.rb | 2 +- lib/xero-ruby/api/payroll_au_api.rb | 2 +- lib/xero-ruby/api/payroll_nz_api.rb | 2 +- lib/xero-ruby/api/payroll_uk_api.rb | 2 +- lib/xero-ruby/api/project_api.rb | 2 +- lib/xero-ruby/api_client.rb | 7 +- lib/xero-ruby/api_error.rb | 2 +- lib/xero-ruby/configuration.rb | 4 +- lib/xero-ruby/models/accounting/account.rb | 4 +- .../models/accounting/account_type.rb | 2 +- lib/xero-ruby/models/accounting/accounts.rb | 2 +- .../models/accounting/accounts_payable.rb | 2 +- .../models/accounting/accounts_receivable.rb | 2 +- lib/xero-ruby/models/accounting/action.rb | 2 +- lib/xero-ruby/models/accounting/actions.rb | 2 +- lib/xero-ruby/models/accounting/address.rb | 2 +- lib/xero-ruby/models/accounting/allocation.rb | 2 +- .../models/accounting/allocations.rb | 2 +- lib/xero-ruby/models/accounting/attachment.rb | 2 +- .../models/accounting/attachments.rb | 2 +- lib/xero-ruby/models/accounting/balances.rb | 2 +- .../models/accounting/bank_transaction.rb | 2 +- .../models/accounting/bank_transactions.rb | 2 +- .../models/accounting/bank_transfer.rb | 2 +- .../models/accounting/bank_transfers.rb | 2 +- .../models/accounting/batch_payment.rb | 2 +- .../accounting/batch_payment_details.rb | 2 +- .../models/accounting/batch_payments.rb | 2 +- lib/xero-ruby/models/accounting/bill.rb | 2 +- .../models/accounting/branding_theme.rb | 2 +- .../models/accounting/branding_themes.rb | 2 +- .../models/accounting/cis_org_setting.rb | 2 +- .../models/accounting/cis_setting.rb | 2 +- .../models/accounting/cis_settings.rb | 2 +- lib/xero-ruby/models/accounting/contact.rb | 2 +- .../models/accounting/contact_group.rb | 2 +- .../models/accounting/contact_groups.rb | 2 +- .../models/accounting/contact_person.rb | 2 +- lib/xero-ruby/models/accounting/contacts.rb | 2 +- .../models/accounting/country_code.rb | 2 +- .../models/accounting/credit_note.rb | 2 +- .../models/accounting/credit_notes.rb | 2 +- lib/xero-ruby/models/accounting/currencies.rb | 2 +- lib/xero-ruby/models/accounting/currency.rb | 2 +- .../models/accounting/currency_code.rb | 6 +- lib/xero-ruby/models/accounting/element.rb | 2 +- lib/xero-ruby/models/accounting/employee.rb | 2 +- lib/xero-ruby/models/accounting/employees.rb | 2 +- lib/xero-ruby/models/accounting/error.rb | 2 +- .../models/accounting/expense_claim.rb | 4 +- .../models/accounting/expense_claims.rb | 2 +- .../models/accounting/external_link.rb | 2 +- .../models/accounting/history_record.rb | 2 +- .../models/accounting/history_records.rb | 2 +- lib/xero-ruby/models/accounting/invoice.rb | 2 +- .../models/accounting/invoice_reminder.rb | 2 +- .../models/accounting/invoice_reminders.rb | 2 +- lib/xero-ruby/models/accounting/invoices.rb | 2 +- lib/xero-ruby/models/accounting/item.rb | 2 +- lib/xero-ruby/models/accounting/items.rb | 2 +- lib/xero-ruby/models/accounting/journal.rb | 2 +- .../models/accounting/journal_line.rb | 2 +- lib/xero-ruby/models/accounting/journals.rb | 2 +- .../models/accounting/line_amount_types.rb | 2 +- lib/xero-ruby/models/accounting/line_item.rb | 2 +- .../models/accounting/line_item_tracking.rb | 2 +- .../models/accounting/linked_transaction.rb | 2 +- .../models/accounting/linked_transactions.rb | 2 +- .../models/accounting/manual_journal.rb | 2 +- .../models/accounting/manual_journal_line.rb | 2 +- .../models/accounting/manual_journals.rb | 2 +- .../models/accounting/online_invoice.rb | 2 +- .../models/accounting/online_invoices.rb | 2 +- .../models/accounting/organisation.rb | 28 +-- .../models/accounting/organisations.rb | 2 +- .../models/accounting/overpayment.rb | 2 +- .../models/accounting/overpayments.rb | 2 +- lib/xero-ruby/models/accounting/payment.rb | 2 +- .../models/accounting/payment_delete.rb | 2 +- .../models/accounting/payment_service.rb | 2 +- .../models/accounting/payment_services.rb | 2 +- .../models/accounting/payment_term.rb | 2 +- .../models/accounting/payment_term_type.rb | 2 +- lib/xero-ruby/models/accounting/payments.rb | 2 +- lib/xero-ruby/models/accounting/phone.rb | 2 +- lib/xero-ruby/models/accounting/prepayment.rb | 2 +- .../models/accounting/prepayments.rb | 2 +- lib/xero-ruby/models/accounting/purchase.rb | 2 +- .../models/accounting/purchase_order.rb | 2 +- .../models/accounting/purchase_orders.rb | 2 +- lib/xero-ruby/models/accounting/quote.rb | 2 +- .../accounting/quote_line_amount_types.rb | 2 +- .../models/accounting/quote_status_codes.rb | 2 +- lib/xero-ruby/models/accounting/quotes.rb | 2 +- lib/xero-ruby/models/accounting/receipt.rb | 2 +- lib/xero-ruby/models/accounting/receipts.rb | 2 +- .../models/accounting/repeating_invoice.rb | 2 +- .../models/accounting/repeating_invoices.rb | 2 +- lib/xero-ruby/models/accounting/report.rb | 2 +- .../models/accounting/report_attribute.rb | 2 +- .../models/accounting/report_cell.rb | 2 +- .../models/accounting/report_fields.rb | 2 +- lib/xero-ruby/models/accounting/report_row.rb | 2 +- .../models/accounting/report_rows.rb | 2 +- .../models/accounting/report_with_row.rb | 2 +- .../models/accounting/report_with_rows.rb | 2 +- lib/xero-ruby/models/accounting/reports.rb | 2 +- .../models/accounting/request_empty.rb | 2 +- lib/xero-ruby/models/accounting/row_type.rb | 2 +- .../accounting/sales_tracking_category.rb | 2 +- lib/xero-ruby/models/accounting/schedule.rb | 2 +- .../models/accounting/tax_component.rb | 2 +- lib/xero-ruby/models/accounting/tax_rate.rb | 2 +- lib/xero-ruby/models/accounting/tax_rates.rb | 2 +- lib/xero-ruby/models/accounting/tax_type.rb | 2 +- .../accounting/ten_ninety_nine_contact.rb | 2 +- lib/xero-ruby/models/accounting/time_zone.rb | 2 +- .../models/accounting/tracking_categories.rb | 2 +- .../models/accounting/tracking_category.rb | 2 +- .../models/accounting/tracking_option.rb | 2 +- .../models/accounting/tracking_options.rb | 2 +- lib/xero-ruby/models/accounting/user.rb | 2 +- lib/xero-ruby/models/accounting/users.rb | 2 +- .../models/accounting/validation_error.rb | 2 +- lib/xero-ruby/models/assets/asset.rb | 2 +- lib/xero-ruby/models/assets/asset_status.rb | 2 +- .../models/assets/asset_status_query_param.rb | 2 +- lib/xero-ruby/models/assets/asset_type.rb | 2 +- lib/xero-ruby/models/assets/assets.rb | 2 +- .../models/assets/book_depreciation_detail.rb | 2 +- .../assets/book_depreciation_setting.rb | 2 +- lib/xero-ruby/models/assets/error.rb | 2 +- .../assets/field_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/pagination.rb | 2 +- .../resource_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/setting.rb | 2 +- lib/xero-ruby/models/files/association.rb | 2 +- lib/xero-ruby/models/files/file_object.rb | 2 +- .../models/files/file_response204.rb | 2 +- lib/xero-ruby/models/files/files.rb | 2 +- lib/xero-ruby/models/files/folder.rb | 2 +- lib/xero-ruby/models/files/folders.rb | 2 +- lib/xero-ruby/models/files/inline_object.rb | 2 +- lib/xero-ruby/models/files/object_group.rb | 2 +- lib/xero-ruby/models/files/object_type.rb | 3 +- lib/xero-ruby/models/files/user.rb | 2 +- lib/xero-ruby/models/payroll_au/account.rb | 2 +- .../models/payroll_au/account_type.rb | 2 +- .../models/payroll_au/allowance_type.rb | 2 +- .../models/payroll_au/api_exception.rb | 2 +- .../models/payroll_au/bank_account.rb | 2 +- .../models/payroll_au/calendar_type.rb | 2 +- .../models/payroll_au/deduction_line.rb | 2 +- .../models/payroll_au/deduction_type.rb | 2 +- .../deduction_type_calculation_type.rb | 2 +- .../models/payroll_au/earnings_line.rb | 2 +- .../models/payroll_au/earnings_rate.rb | 2 +- .../earnings_rate_calculation_type.rb | 2 +- .../models/payroll_au/earnings_type.rb | 2 +- lib/xero-ruby/models/payroll_au/employee.rb | 2 +- .../models/payroll_au/employee_status.rb | 2 +- lib/xero-ruby/models/payroll_au/employees.rb | 2 +- .../models/payroll_au/employment_basis.rb | 2 +- .../employment_termination_payment_type.rb | 2 +- .../entitlement_final_pay_payout_type.rb | 2 +- .../models/payroll_au/home_address.rb | 2 +- .../models/payroll_au/leave_accrual_line.rb | 2 +- .../models/payroll_au/leave_application.rb | 2 +- .../models/payroll_au/leave_applications.rb | 2 +- .../models/payroll_au/leave_balance.rb | 2 +- .../models/payroll_au/leave_earnings_line.rb | 2 +- lib/xero-ruby/models/payroll_au/leave_line.rb | 2 +- .../payroll_au/leave_line_calculation_type.rb | 2 +- .../models/payroll_au/leave_lines.rb | 2 +- .../models/payroll_au/leave_period.rb | 2 +- .../models/payroll_au/leave_period_status.rb | 2 +- lib/xero-ruby/models/payroll_au/leave_type.rb | 2 +- .../leave_type_contribution_type.rb | 2 +- .../models/payroll_au/manual_tax_type.rb | 2 +- .../models/payroll_au/opening_balances.rb | 2 +- lib/xero-ruby/models/payroll_au/pay_item.rb | 2 +- lib/xero-ruby/models/payroll_au/pay_items.rb | 2 +- lib/xero-ruby/models/payroll_au/pay_run.rb | 2 +- .../models/payroll_au/pay_run_status.rb | 2 +- lib/xero-ruby/models/payroll_au/pay_runs.rb | 2 +- .../models/payroll_au/pay_template.rb | 2 +- .../payroll_au/payment_frequency_type.rb | 2 +- .../models/payroll_au/payroll_calendar.rb | 2 +- .../models/payroll_au/payroll_calendars.rb | 2 +- lib/xero-ruby/models/payroll_au/payslip.rb | 2 +- .../models/payroll_au/payslip_lines.rb | 2 +- .../models/payroll_au/payslip_object.rb | 2 +- .../models/payroll_au/payslip_summary.rb | 2 +- lib/xero-ruby/models/payroll_au/payslips.rb | 2 +- lib/xero-ruby/models/payroll_au/rate_type.rb | 2 +- .../models/payroll_au/reimbursement_line.rb | 2 +- .../models/payroll_au/reimbursement_lines.rb | 2 +- .../models/payroll_au/reimbursement_type.rb | 2 +- .../models/payroll_au/residency_status.rb | 2 +- lib/xero-ruby/models/payroll_au/settings.rb | 2 +- .../models/payroll_au/settings_object.rb | 2 +- .../settings_tracking_categories.rb | 2 +- ...ngs_tracking_categories_employee_groups.rb | 2 +- ...racking_categories_timesheet_categories.rb | 2 +- lib/xero-ruby/models/payroll_au/state.rb | 2 +- lib/xero-ruby/models/payroll_au/super_fund.rb | 2 +- .../models/payroll_au/super_fund_product.rb | 2 +- .../models/payroll_au/super_fund_products.rb | 2 +- .../models/payroll_au/super_fund_type.rb | 2 +- .../models/payroll_au/super_funds.rb | 2 +- lib/xero-ruby/models/payroll_au/super_line.rb | 2 +- .../models/payroll_au/super_membership.rb | 2 +- .../superannuation_calculation_type.rb | 2 +- .../superannuation_contribution_type.rb | 2 +- .../models/payroll_au/superannuation_line.rb | 2 +- .../models/payroll_au/tax_declaration.rb | 2 +- lib/xero-ruby/models/payroll_au/tax_line.rb | 2 +- .../models/payroll_au/tfn_exemption_type.rb | 2 +- lib/xero-ruby/models/payroll_au/timesheet.rb | 2 +- .../models/payroll_au/timesheet_line.rb | 2 +- .../models/payroll_au/timesheet_object.rb | 2 +- .../models/payroll_au/timesheet_status.rb | 2 +- lib/xero-ruby/models/payroll_au/timesheets.rb | 2 +- .../models/payroll_au/validation_error.rb | 2 +- lib/xero-ruby/models/payroll_nz/account.rb | 2 +- lib/xero-ruby/models/payroll_nz/accounts.rb | 2 +- lib/xero-ruby/models/payroll_nz/address.rb | 2 +- .../models/payroll_nz/bank_account.rb | 2 +- lib/xero-ruby/models/payroll_nz/benefit.rb | 2 +- lib/xero-ruby/models/payroll_nz/deduction.rb | 2 +- .../models/payroll_nz/deduction_line.rb | 2 +- .../models/payroll_nz/deduction_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/deductions.rb | 2 +- .../models/payroll_nz/earnings_line.rb | 2 +- .../models/payroll_nz/earnings_order.rb | 2 +- .../payroll_nz/earnings_order_object.rb | 2 +- .../models/payroll_nz/earnings_orders.rb | 2 +- .../models/payroll_nz/earnings_rate.rb | 2 +- .../models/payroll_nz/earnings_rate_object.rb | 2 +- .../models/payroll_nz/earnings_rates.rb | 2 +- .../models/payroll_nz/earnings_template.rb | 2 +- .../payroll_nz/earnings_template_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/employee.rb | 2 +- .../payroll_nz/employee_earnings_templates.rb | 2 +- .../models/payroll_nz/employee_leave.rb | 2 +- .../payroll_nz/employee_leave_balance.rb | 2 +- .../payroll_nz/employee_leave_balances.rb | 2 +- .../payroll_nz/employee_leave_object.rb | 2 +- .../models/payroll_nz/employee_leave_setup.rb | 2 +- .../payroll_nz/employee_leave_setup_object.rb | 2 +- .../models/payroll_nz/employee_leave_type.rb | 2 +- .../payroll_nz/employee_leave_type_object.rb | 2 +- .../models/payroll_nz/employee_leave_types.rb | 2 +- .../models/payroll_nz/employee_leaves.rb | 2 +- .../models/payroll_nz/employee_object.rb | 2 +- .../payroll_nz/employee_opening_balance.rb | 2 +- .../employee_opening_balances_object.rb | 2 +- .../payroll_nz/employee_pay_template.rb | 2 +- .../employee_pay_template_object.rb | 2 +- .../payroll_nz/employee_pay_templates.rb | 2 +- .../employee_statutory_leave_balance.rb | 2 +- ...employee_statutory_leave_balance_object.rb | 2 +- .../employee_statutory_leave_summary.rb | 2 +- .../employee_statutory_leaves_summaries.rb | 2 +- .../employee_statutory_sick_leave.rb | 2 +- .../employee_statutory_sick_leave_object.rb | 2 +- .../employee_statutory_sick_leaves.rb | 2 +- .../models/payroll_nz/employee_tax.rb | 2 +- .../models/payroll_nz/employee_tax_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/employees.rb | 2 +- lib/xero-ruby/models/payroll_nz/employment.rb | 2 +- .../models/payroll_nz/employment_object.rb | 2 +- .../payroll_nz/gross_earnings_history.rb | 2 +- .../models/payroll_nz/invalid_field.rb | 2 +- .../models/payroll_nz/leave_accrual_line.rb | 2 +- .../models/payroll_nz/leave_earnings_line.rb | 2 +- .../models/payroll_nz/leave_period.rb | 2 +- .../models/payroll_nz/leave_periods.rb | 2 +- lib/xero-ruby/models/payroll_nz/leave_type.rb | 2 +- .../models/payroll_nz/leave_type_object.rb | 2 +- .../models/payroll_nz/leave_types.rb | 2 +- lib/xero-ruby/models/payroll_nz/pagination.rb | 2 +- lib/xero-ruby/models/payroll_nz/pay_run.rb | 2 +- .../models/payroll_nz/pay_run_calendar.rb | 2 +- .../payroll_nz/pay_run_calendar_object.rb | 2 +- .../models/payroll_nz/pay_run_calendars.rb | 2 +- .../models/payroll_nz/pay_run_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/pay_runs.rb | 2 +- lib/xero-ruby/models/payroll_nz/pay_slip.rb | 2 +- .../models/payroll_nz/pay_slip_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/pay_slips.rb | 2 +- .../models/payroll_nz/payment_line.rb | 2 +- .../models/payroll_nz/payment_method.rb | 2 +- .../payroll_nz/payment_method_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/problem.rb | 2 +- .../models/payroll_nz/reimbursement.rb | 2 +- .../models/payroll_nz/reimbursement_line.rb | 2 +- .../models/payroll_nz/reimbursement_object.rb | 2 +- .../models/payroll_nz/reimbursements.rb | 2 +- .../models/payroll_nz/salary_and_wage.rb | 2 +- .../payroll_nz/salary_and_wage_object.rb | 2 +- .../models/payroll_nz/salary_and_wages.rb | 2 +- lib/xero-ruby/models/payroll_nz/settings.rb | 2 +- .../models/payroll_nz/statutory_deduction.rb | 2 +- .../statutory_deduction_category.rb | 2 +- .../payroll_nz/statutory_deduction_line.rb | 2 +- .../payroll_nz/statutory_deduction_object.rb | 2 +- .../models/payroll_nz/statutory_deductions.rb | 2 +- .../models/payroll_nz/superannuation_line.rb | 2 +- .../payroll_nz/superannuation_object.rb | 2 +- .../models/payroll_nz/superannuations.rb | 2 +- lib/xero-ruby/models/payroll_nz/tax_code.rb | 2 +- lib/xero-ruby/models/payroll_nz/tax_line.rb | 2 +- .../models/payroll_nz/tax_settings.rb | 2 +- lib/xero-ruby/models/payroll_nz/timesheet.rb | 2 +- .../payroll_nz/timesheet_earnings_line.rb | 2 +- .../models/payroll_nz/timesheet_line.rb | 2 +- .../payroll_nz/timesheet_line_object.rb | 2 +- .../models/payroll_nz/timesheet_object.rb | 2 +- lib/xero-ruby/models/payroll_nz/timesheets.rb | 2 +- .../models/payroll_nz/tracking_categories.rb | 2 +- .../models/payroll_nz/tracking_category.rb | 2 +- lib/xero-ruby/models/payroll_uk/account.rb | 2 +- lib/xero-ruby/models/payroll_uk/accounts.rb | 2 +- lib/xero-ruby/models/payroll_uk/address.rb | 2 +- .../models/payroll_uk/bank_account.rb | 2 +- lib/xero-ruby/models/payroll_uk/benefit.rb | 2 +- .../models/payroll_uk/benefit_line.rb | 2 +- .../models/payroll_uk/benefit_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/benefits.rb | 2 +- .../models/payroll_uk/court_order_line.rb | 2 +- lib/xero-ruby/models/payroll_uk/deduction.rb | 2 +- .../models/payroll_uk/deduction_line.rb | 2 +- .../models/payroll_uk/deduction_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/deductions.rb | 2 +- .../models/payroll_uk/earnings_line.rb | 2 +- .../models/payroll_uk/earnings_order.rb | 2 +- .../payroll_uk/earnings_order_object.rb | 2 +- .../models/payroll_uk/earnings_orders.rb | 2 +- .../models/payroll_uk/earnings_rate.rb | 2 +- .../models/payroll_uk/earnings_rate_object.rb | 2 +- .../models/payroll_uk/earnings_rates.rb | 2 +- .../models/payroll_uk/earnings_template.rb | 2 +- .../payroll_uk/earnings_template_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/employee.rb | 2 +- .../models/payroll_uk/employee_leave.rb | 2 +- .../payroll_uk/employee_leave_balance.rb | 2 +- .../payroll_uk/employee_leave_balances.rb | 2 +- .../payroll_uk/employee_leave_object.rb | 2 +- .../models/payroll_uk/employee_leave_type.rb | 2 +- .../payroll_uk/employee_leave_type_object.rb | 2 +- .../models/payroll_uk/employee_leave_types.rb | 2 +- .../models/payroll_uk/employee_leaves.rb | 2 +- .../models/payroll_uk/employee_object.rb | 2 +- .../payroll_uk/employee_opening_balances.rb | 2 +- .../employee_opening_balances_object.rb | 2 +- .../payroll_uk/employee_pay_template.rb | 2 +- .../employee_pay_template_object.rb | 2 +- .../payroll_uk/employee_pay_templates.rb | 2 +- .../employee_statutory_leave_balance.rb | 2 +- ...employee_statutory_leave_balance_object.rb | 2 +- .../employee_statutory_leave_summary.rb | 2 +- .../employee_statutory_leaves_summaries.rb | 2 +- .../employee_statutory_sick_leave.rb | 2 +- .../employee_statutory_sick_leave_object.rb | 2 +- .../employee_statutory_sick_leaves.rb | 2 +- .../models/payroll_uk/employee_tax.rb | 2 +- .../models/payroll_uk/employee_tax_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/employees.rb | 2 +- lib/xero-ruby/models/payroll_uk/employment.rb | 2 +- .../models/payroll_uk/employment_object.rb | 2 +- .../models/payroll_uk/invalid_field.rb | 2 +- .../models/payroll_uk/leave_accrual_line.rb | 2 +- .../models/payroll_uk/leave_earnings_line.rb | 2 +- .../models/payroll_uk/leave_period.rb | 2 +- .../models/payroll_uk/leave_periods.rb | 2 +- lib/xero-ruby/models/payroll_uk/leave_type.rb | 2 +- .../models/payroll_uk/leave_type_object.rb | 2 +- .../models/payroll_uk/leave_types.rb | 2 +- lib/xero-ruby/models/payroll_uk/pagination.rb | 2 +- lib/xero-ruby/models/payroll_uk/pay_run.rb | 2 +- .../models/payroll_uk/pay_run_calendar.rb | 2 +- .../payroll_uk/pay_run_calendar_object.rb | 2 +- .../models/payroll_uk/pay_run_calendars.rb | 2 +- .../models/payroll_uk/pay_run_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/pay_runs.rb | 2 +- .../models/payroll_uk/payment_line.rb | 2 +- .../models/payroll_uk/payment_method.rb | 2 +- .../payroll_uk/payment_method_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/payslip.rb | 2 +- .../models/payroll_uk/payslip_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/payslips.rb | 2 +- lib/xero-ruby/models/payroll_uk/problem.rb | 2 +- .../models/payroll_uk/reimbursement.rb | 2 +- .../models/payroll_uk/reimbursement_line.rb | 2 +- .../models/payroll_uk/reimbursement_object.rb | 2 +- .../models/payroll_uk/reimbursements.rb | 2 +- .../models/payroll_uk/salary_and_wage.rb | 2 +- .../payroll_uk/salary_and_wage_object.rb | 2 +- .../models/payroll_uk/salary_and_wages.rb | 2 +- lib/xero-ruby/models/payroll_uk/settings.rb | 2 +- .../models/payroll_uk/statutory_deduction.rb | 2 +- .../statutory_deduction_category.rb | 2 +- lib/xero-ruby/models/payroll_uk/tax_line.rb | 2 +- lib/xero-ruby/models/payroll_uk/timesheet.rb | 2 +- .../payroll_uk/timesheet_earnings_line.rb | 2 +- .../models/payroll_uk/timesheet_line.rb | 2 +- .../payroll_uk/timesheet_line_object.rb | 2 +- .../models/payroll_uk/timesheet_object.rb | 2 +- lib/xero-ruby/models/payroll_uk/timesheets.rb | 2 +- .../models/payroll_uk/tracking_categories.rb | 2 +- .../models/payroll_uk/tracking_category.rb | 2 +- lib/xero-ruby/models/projects/amount.rb | 2 +- lib/xero-ruby/models/projects/charge_type.rb | 2 +- .../models/projects/currency_code.rb | 2 +- lib/xero-ruby/models/projects/error.rb | 2 +- lib/xero-ruby/models/projects/pagination.rb | 2 +- lib/xero-ruby/models/projects/project.rb | 2 +- .../projects/project_create_or_update.rb | 2 +- .../models/projects/project_patch.rb | 2 +- .../models/projects/project_status.rb | 2 +- lib/xero-ruby/models/projects/project_user.rb | 2 +- .../models/projects/project_users.rb | 2 +- lib/xero-ruby/models/projects/projects.rb | 2 +- lib/xero-ruby/models/projects/task.rb | 2 +- .../models/projects/task_create_or_update.rb | 2 +- lib/xero-ruby/models/projects/tasks.rb | 2 +- lib/xero-ruby/models/projects/time_entries.rb | 2 +- lib/xero-ruby/models/projects/time_entry.rb | 2 +- .../projects/time_entry_create_or_update.rb | 2 +- lib/xero-ruby/version.rb | 2 +- xero-ruby.gemspec | 2 +- 438 files changed, 607 insertions(+), 611 deletions(-) diff --git a/README.md b/README.md index c65473c8..ab1304a6 100644 --- a/README.md +++ b/README.md @@ -161,35 +161,35 @@ end ### Accounting API ```ruby - require 'xero-ruby' +require 'xero-ruby' - xero_client.refresh_token_set(user.token_set) +xero_client.refresh_token_set(user.token_set) - tenant_id = user.active_tenant_id - # example of how to store the `tenantId` of the specific tenant (aka organisation) +tenant_id = user.active_tenant_id +# example of how to store the `tenantId` of the specific tenant (aka organisation) - # https://github.com/XeroAPI/xero-ruby/blob/master/accounting/lib/xero-ruby/api/accounting_api.rb - - # Get Accounts - accounts = xero_client.accounting_api.get_accounts(tenant_id).accounts - - # Create Invoice - invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: contacts[0].contact_id }, line_items: [{ description: "Big Agency", quantity: BigDecimal("2.0"), unit_amount: BigDecimal("50.99"), account_code: "600", tax_type: XeroRuby::Accounting::TaxType::NONE }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} - invoice = xero_client.accounting_api.create_invoices(tenant_id, invoices).invoices.first - - # Create History - payment = xero_client.accounting_api.get_payments(tenant_id).payments.first - history_records = { history_records: [{ details: "This payment now has some History!" }]} - payment_history = xero_client.accounting_api.create_payment_history(tenant_id, payment.payment_id, history_records) - - # Create Attachment - account = xero_client.accounting_api.get_accounts(tenant_id).accounts.first - file_name = "an-account-filename.png" - opts = { - include_online: true - } - file = File.read(Rails.root.join('app/assets/images/xero-api.png')) - attachment = xero_client.accounting_api.create_account_attachment_by_file_name(tenant_id, @account.account_id, file_name, file, opts) +# https://github.com/XeroAPI/xero-ruby/blob/master/accounting/lib/xero-ruby/api/accounting_api.rb + +# Get Accounts +accounts = xero_client.accounting_api.get_accounts(tenant_id).accounts + +# Create Invoice +invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: contacts[0].contact_id }, line_items: [{ description: "Big Agency", quantity: BigDecimal("2.0"), unit_amount: BigDecimal("50.99"), account_code: "600", tax_type: XeroRuby::Accounting::TaxType::NONE }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} +invoice = xero_client.accounting_api.create_invoices(tenant_id, invoices).invoices.first + +# Create History +payment = xero_client.accounting_api.get_payments(tenant_id).payments.first +history_records = { history_records: [{ details: "This payment now has some History!" }]} +payment_history = xero_client.accounting_api.create_payment_history(tenant_id, payment.payment_id, history_records) + +# Create Attachment +account = xero_client.accounting_api.get_accounts(tenant_id).accounts.first +file_name = "an-account-filename.png" +opts = { + include_online: true +} +file = File.read(Rails.root.join('app/assets/images/xero-api.png')) +attachment = xero_client.accounting_api.create_account_attachment_by_file_name(tenant_id, @account.account_id, file_name, file, opts) ``` ### Assets API diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index b304582c..a99f20fb 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -461,7 +461,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create history record for a bank transactions result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) @@ -526,7 +526,7 @@ api_instance = xero_client. bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" } ], bank_account: { code: "000" }}]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -547,7 +547,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **bank_transactions** | [**BankTransactions**](BankTransactions.md)| BankTransactions with an array of BankTransaction objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -726,7 +726,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) p result @@ -790,7 +790,7 @@ api_instance = xero_client. batch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }}]}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -809,7 +809,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **batch_payments** | [**BatchPayments**](BatchPayments.md)| BatchPayments with an array of Payments in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -858,7 +858,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create a history record for a Batch Payment result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) @@ -920,7 +920,7 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -payment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } +payment_service = { payment_service_id: "00000000-0000-0000-0000-000000000000", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } begin #Allow for the creation of new custom payment service for specified Branding Theme @@ -1179,7 +1179,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to retrieve a history records of an Contact result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) @@ -1244,7 +1244,7 @@ api_instance = xero_client. contacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::DAYSAFTERBILLMONTH }}}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -1263,7 +1263,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **contacts** | [**Contacts**](Contacts.md)| Contacts with an array of Contact objects to create in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -1311,7 +1311,7 @@ api_instance = xero_client. allocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -1331,7 +1331,7 @@ Name | Type | Description | Notes **xero_tenant_id** | **String**| Xero identifier for Tenant | **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | **allocations** | [**Allocations**](Allocations.md)| Allocations with array of Allocation object in body of request. | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -1453,7 +1453,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to retrieve a history records of an CreditNote result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) @@ -1518,7 +1518,7 @@ api_instance = xero_client. credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -1539,7 +1539,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **credit_notes** | [**CreditNotes**](CreditNotes.md)| Credit Notes with array of CreditNote object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -1649,7 +1649,7 @@ api_instance = xero_client. employees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -1668,7 +1668,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -1717,7 +1717,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create a history records of an ExpenseClaim result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) @@ -1918,7 +1918,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to retrieve a history records of an invoice result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) @@ -1980,10 +1980,10 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} +invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -2004,7 +2004,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **invoices** | [**Invoices**](Invoices.md)| Invoices with an array of invoice objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -2054,7 +2054,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create a history record for items result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) @@ -2119,7 +2119,7 @@ api_instance = xero_client. items = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventory_asset_account_code: "140", purchase_details: { cogs_account_code: "500" }}]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -2140,7 +2140,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **items** | [**Items**](Items.md)| Items with an array of Item objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -2320,7 +2320,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a manual journal -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create history record for a manual journal result = api_instance.create_manual_journal_history_record(xero_tenant_id, manual_journal_id, history_records) @@ -2385,7 +2385,7 @@ api_instance = xero_client. manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" }, { line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -2404,7 +2404,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -2449,10 +2449,10 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 1.0, date: "2019-03-12" }]} +allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 10.0, date: "2019-03-12" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -2472,7 +2472,7 @@ Name | Type | Description | Notes **xero_tenant_id** | **String**| Xero identifier for Tenant | **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | **allocations** | [**Allocations**](Allocations.md)| Allocations array with Allocation object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -2521,7 +2521,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create history records of an Overpayment result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) @@ -2649,7 +2649,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create a history record for a payment result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) @@ -2776,7 +2776,7 @@ api_instance = xero_client. payments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -2795,7 +2795,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **payments** | [**Payments**](Payments.md)| Payments array with Payment object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -2843,7 +2843,7 @@ api_instance = xero_client. allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -2863,7 +2863,7 @@ Name | Type | Description | Notes **xero_tenant_id** | **String**| Xero identifier for Tenant | **prepayment_id** | [**String**](.md)| Unique identifier for Prepayment | **allocations** | [**Allocations**](Allocations.md)| Allocations with an array of Allocation object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -2912,7 +2912,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create a history record for an Prepayment result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) @@ -3046,7 +3046,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create HistoryRecord for purchase orders result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) @@ -3111,7 +3111,7 @@ api_instance = xero_client. purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, account_code: "710" }], date: "2019-03-13" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -3130,7 +3130,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| PurchaseOrders with an array of PurchaseOrder object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -3247,7 +3247,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to retrieve a history records of an quote result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) @@ -3309,10 +3309,10 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date:"2020-02-01" }]} +quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -3331,7 +3331,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **quotes** | [**Quotes**](Quotes.md)| Quotes with an array of Quote object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -3515,7 +3515,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to retrieve a history records of an Receipt result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) @@ -3649,7 +3649,7 @@ api_instance = xero_client. xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +history_records = { "HistoryRecords": [ { "Details": "Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request begin #Allows you to create history for a repeating invoice result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) @@ -4221,11 +4221,8 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. +payments = { status: "DELETED" } - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -payment_delete = { status: "DELETED" } # PaymentDelete | begin #Allows you to update a specified payment for invoices and credit notes result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) @@ -12879,11 +12876,8 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. +{ accounts: [{ code: "123456", name: "BarFoo", account_id: "00000000-0000-0000-000-000000000000", type: XeroRuby::Accounting::Account::EXPENSE, description: "GoodBye World", tax_type: XeroRuby::Accounting::TaxType::NONE }]} - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object -accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} # Accounts | Request of type Accounts array with one Account begin #Allows you to update a chart of accounts result = api_instance.update_account(xero_tenant_id, account_id, accounts) @@ -13544,7 +13538,7 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} +expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date: "2020-01-01", user: {} }]}]} begin #Allows you to update specified expense claims @@ -13743,11 +13737,8 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. +items = { items: [{ code: "ItemCode123", description: "Description 123" }]} - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -13877,7 +13868,7 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -manual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} +manual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_lines: [] }]} begin #Allows you to update a specified manual journal @@ -14011,7 +14002,7 @@ api_instance = xero_client. bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" }], bank_account: { code: "000" }}]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -14032,7 +14023,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -14081,7 +14072,7 @@ api_instance = xero_client. { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTHDAYSAFTERBILLMONTH }}}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -14100,7 +14091,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **contacts** | [**Contacts**](Contacts.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -14148,7 +14139,7 @@ api_instance = xero_client. credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -14169,7 +14160,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **credit_notes** | [**CreditNotes**](CreditNotes.md)| an array of Credit Notes with a single CreditNote object. | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -14218,7 +14209,7 @@ api_instance = xero_client. employees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -14237,7 +14228,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -14282,10 +14273,10 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} +invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -14306,7 +14297,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **invoices** | [**Invoices**](Invoices.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -14352,10 +14343,10 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. -items = { items: [{ code: "abcXYZ", name: "HelloWorld", description: "Foobar" }]} +items = { items: [{ code: "ItemCode123", name: "ItemName XYZ", description: "Item Description ABC" }]} opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } @@ -14376,7 +14367,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **items** | [**Items**](Items.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -14425,7 +14416,7 @@ api_instance = xero_client. manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" },{ line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}] }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -14444,7 +14435,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -14492,7 +14483,7 @@ api_instance = xero_client. purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -14511,7 +14502,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -14559,7 +14550,7 @@ api_instance = xero_client. quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors } begin @@ -14578,7 +14569,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | **quotes** | [**Quotes**](Quotes.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created objects and any with validation errors | [optional] [default to false] ### Return type @@ -15151,11 +15142,8 @@ xero_client.refresh_token_set(token_set) api_instance = xero_client. +tracking_categories = { name: "Avengers" } - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_category = { name: "Avengers" } # TrackingCategory | begin #Allows you to update tracking categories result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) diff --git a/docs/accounting/ExpenseClaim.md b/docs/accounting/ExpenseClaim.md index 4335c24e..2b24bee0 100644 --- a/docs/accounting/ExpenseClaim.md +++ b/docs/accounting/ExpenseClaim.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **amount_paid** | **BigDecimal** | The amount still to pay for an expense claim | [optional] **payment_due_date** | **Date** | The date when the expense claim is due to be paid YYYY-MM-DD | [optional] **reporting_date** | **Date** | The date the expense claim will be reported in Xero YYYY-MM-DD | [optional] -**receipt_id** | **String** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional] +**receipt_id** | **String** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional] ## Code Sample diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index 56e9f687..318e10d2 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 13a09553..0d1e407e 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -357,7 +357,7 @@ def create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_t # @param xero_tenant_id [String] Xero identifier for Tenant # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [BankTransactions] def create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) @@ -369,7 +369,7 @@ def create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers def create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) @@ -681,7 +681,7 @@ def create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_tran # @param xero_tenant_id [String] Xero identifier for Tenant # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [BatchPayments] def create_batch_payment(xero_tenant_id, batch_payments, opts = {}) data, _status_code, _headers = create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts) @@ -692,7 +692,7 @@ def create_batch_payment(xero_tenant_id, batch_payments, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers def create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts = {}) if @api_client.config.debugging @@ -1250,7 +1250,7 @@ def create_contact_history_with_http_info(xero_tenant_id, contact_id, history_re # @param xero_tenant_id [String] Xero identifier for Tenant # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Contacts] def create_contacts(xero_tenant_id, contacts, opts = {}) data, _status_code, _headers = create_contacts_with_http_info(xero_tenant_id, contacts, opts) @@ -1261,7 +1261,7 @@ def create_contacts(xero_tenant_id, contacts, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) if @api_client.config.debugging @@ -1330,7 +1330,7 @@ def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) # @param credit_note_id [String] Unique identifier for a Credit Note # @param allocations [Allocations] Allocations with array of Allocation object in body of request. # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Allocations] def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, opts = {}) data, _status_code, _headers = create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts) @@ -1342,7 +1342,7 @@ def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, o # @param credit_note_id [String] Unique identifier for a Credit Note # @param allocations [Allocations] Allocations with array of Allocation object in body of request. # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts = {}) if @api_client.config.debugging @@ -1587,7 +1587,7 @@ def create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, hi # @param xero_tenant_id [String] Xero identifier for Tenant # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [CreditNotes] def create_credit_notes(xero_tenant_id, credit_notes, opts = {}) @@ -1599,7 +1599,7 @@ def create_credit_notes(xero_tenant_id, credit_notes, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers def create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) @@ -1743,7 +1743,7 @@ def create_currency_with_http_info(xero_tenant_id, currency, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param employees [Employees] Employees with array of Employee object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Employees] def create_employees(xero_tenant_id, employees, opts = {}) data, _status_code, _headers = create_employees_with_http_info(xero_tenant_id, employees, opts) @@ -1754,7 +1754,7 @@ def create_employees(xero_tenant_id, employees, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param employees [Employees] Employees with array of Employee object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers def create_employees_with_http_info(xero_tenant_id, employees, opts = {}) if @api_client.config.debugging @@ -2153,7 +2153,7 @@ def create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_re # @param xero_tenant_id [String] Xero identifier for Tenant # @param invoices [Invoices] Invoices with an array of invoice objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Invoices] def create_invoices(xero_tenant_id, invoices, opts = {}) @@ -2165,7 +2165,7 @@ def create_invoices(xero_tenant_id, invoices, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param invoices [Invoices] Invoices with an array of invoice objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers def create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) @@ -2317,7 +2317,7 @@ def create_item_history_with_http_info(xero_tenant_id, item_id, history_records, # @param xero_tenant_id [String] Xero identifier for Tenant # @param items [Items] Items with an array of Item objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Items] def create_items(xero_tenant_id, items, opts = {}) @@ -2329,7 +2329,7 @@ def create_items(xero_tenant_id, items, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param items [Items] Items with an array of Item objects in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers def create_items_with_http_info(xero_tenant_id, items, opts = {}) @@ -2645,7 +2645,7 @@ def create_manual_journal_history_record_with_http_info(xero_tenant_id, manual_j # @param xero_tenant_id [String] Xero identifier for Tenant # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [ManualJournals] def create_manual_journals(xero_tenant_id, manual_journals, opts = {}) data, _status_code, _headers = create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) @@ -2656,7 +2656,7 @@ def create_manual_journals(xero_tenant_id, manual_journals, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) if @api_client.config.debugging @@ -2725,7 +2725,7 @@ def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts # @param overpayment_id [String] Unique identifier for a Overpayment # @param allocations [Allocations] Allocations array with Allocation object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Allocations] def create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts = {}) data, _status_code, _headers = create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts) @@ -2737,7 +2737,7 @@ def create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, # @param overpayment_id [String] Unique identifier for a Overpayment # @param allocations [Allocations] Allocations array with Allocation object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers def create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts = {}) if @api_client.config.debugging @@ -3125,7 +3125,7 @@ def create_payment_service_with_http_info(xero_tenant_id, payment_services, opts # @param xero_tenant_id [String] Xero identifier for Tenant # @param payments [Payments] Payments array with Payment object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Payments] def create_payments(xero_tenant_id, payments, opts = {}) data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts) @@ -3136,7 +3136,7 @@ def create_payments(xero_tenant_id, payments, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param payments [Payments] Payments array with Payment object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers def create_payments_with_http_info(xero_tenant_id, payments, opts = {}) if @api_client.config.debugging @@ -3205,7 +3205,7 @@ def create_payments_with_http_info(xero_tenant_id, payments, opts = {}) # @param prepayment_id [String] Unique identifier for Prepayment # @param allocations [Allocations] Allocations with an array of Allocation object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Allocations] def create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts = {}) data, _status_code, _headers = create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts) @@ -3217,7 +3217,7 @@ def create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, op # @param prepayment_id [String] Unique identifier for Prepayment # @param allocations [Allocations] Allocations with an array of Allocation object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers def create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts = {}) if @api_client.config.debugging @@ -3541,7 +3541,7 @@ def create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_ # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [PurchaseOrders] def create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) data, _status_code, _headers = create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) @@ -3552,7 +3552,7 @@ def create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers def create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) if @api_client.config.debugging @@ -3790,7 +3790,7 @@ def create_quote_history_with_http_info(xero_tenant_id, quote_id, history_record # @param xero_tenant_id [String] Xero identifier for Tenant # @param quotes [Quotes] Quotes with an array of Quote object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Quotes] def create_quotes(xero_tenant_id, quotes, opts = {}) data, _status_code, _headers = create_quotes_with_http_info(xero_tenant_id, quotes, opts) @@ -3801,7 +3801,7 @@ def create_quotes(xero_tenant_id, quotes, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param quotes [Quotes] Quotes with an array of Quote object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers def create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) if @api_client.config.debugging @@ -16265,7 +16265,7 @@ def update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, # @param xero_tenant_id [String] Xero identifier for Tenant # @param bank_transactions [BankTransactions] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [BankTransactions] def update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) @@ -16277,7 +16277,7 @@ def update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts = # @param xero_tenant_id [String] Xero identifier for Tenant # @param bank_transactions [BankTransactions] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) @@ -16347,7 +16347,7 @@ def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_trans # @param xero_tenant_id [String] Xero identifier for Tenant # @param contacts [Contacts] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Contacts] def update_or_create_contacts(xero_tenant_id, contacts, opts = {}) data, _status_code, _headers = update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts) @@ -16358,7 +16358,7 @@ def update_or_create_contacts(xero_tenant_id, contacts, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param contacts [Contacts] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) if @api_client.config.debugging @@ -16426,7 +16426,7 @@ def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {} # @param xero_tenant_id [String] Xero identifier for Tenant # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [CreditNotes] def update_or_create_credit_notes(xero_tenant_id, credit_notes, opts = {}) @@ -16438,7 +16438,7 @@ def update_or_create_credit_notes(xero_tenant_id, credit_notes, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) @@ -16508,7 +16508,7 @@ def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, o # @param xero_tenant_id [String] Xero identifier for Tenant # @param employees [Employees] Employees with array of Employee object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Employees] def update_or_create_employees(xero_tenant_id, employees, opts = {}) data, _status_code, _headers = update_or_create_employees_with_http_info(xero_tenant_id, employees, opts) @@ -16519,7 +16519,7 @@ def update_or_create_employees(xero_tenant_id, employees, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param employees [Employees] Employees with array of Employee object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = {}) if @api_client.config.debugging @@ -16587,7 +16587,7 @@ def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = # @param xero_tenant_id [String] Xero identifier for Tenant # @param invoices [Invoices] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Invoices] def update_or_create_invoices(xero_tenant_id, invoices, opts = {}) @@ -16599,7 +16599,7 @@ def update_or_create_invoices(xero_tenant_id, invoices, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param invoices [Invoices] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) @@ -16669,7 +16669,7 @@ def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {} # @param xero_tenant_id [String] Xero identifier for Tenant # @param items [Items] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Items] def update_or_create_items(xero_tenant_id, items, opts = {}) @@ -16681,7 +16681,7 @@ def update_or_create_items(xero_tenant_id, items, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param items [Items] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {}) @@ -16751,7 +16751,7 @@ def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [ManualJournals] def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {}) data, _status_code, _headers = update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) @@ -16762,7 +16762,7 @@ def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) if @api_client.config.debugging @@ -16830,7 +16830,7 @@ def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journ # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_orders [PurchaseOrders] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [PurchaseOrders] def update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) data, _status_code, _headers = update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) @@ -16841,7 +16841,7 @@ def update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param purchase_orders [PurchaseOrders] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) if @api_client.config.debugging @@ -16909,7 +16909,7 @@ def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_ord # @param xero_tenant_id [String] Xero identifier for Tenant # @param quotes [Quotes] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false) # @return [Quotes] def update_or_create_quotes(xero_tenant_id, quotes, opts = {}) data, _status_code, _headers = update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts) @@ -16920,7 +16920,7 @@ def update_or_create_quotes(xero_tenant_id, quotes, opts = {}) # @param xero_tenant_id [String] Xero identifier for Tenant # @param quotes [Quotes] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers def update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) if @api_client.config.debugging diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index f9c27636..f7b4fc3b 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/files_api.rb b/lib/xero-ruby/api/files_api.rb index fd53df2c..252309d1 100644 --- a/lib/xero-ruby/api/files_api.rb +++ b/lib/xero-ruby/api/files_api.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/payroll_au_api.rb b/lib/xero-ruby/api/payroll_au_api.rb index 8a9badc8..8f59859c 100644 --- a/lib/xero-ruby/api/payroll_au_api.rb +++ b/lib/xero-ruby/api/payroll_au_api.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/payroll_nz_api.rb b/lib/xero-ruby/api/payroll_nz_api.rb index 8407bf78..36964e9f 100644 --- a/lib/xero-ruby/api/payroll_nz_api.rb +++ b/lib/xero-ruby/api/payroll_nz_api.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/payroll_uk_api.rb b/lib/xero-ruby/api/payroll_uk_api.rb index 1d92d461..97bfa8c4 100644 --- a/lib/xero-ruby/api/payroll_uk_api.rb +++ b/lib/xero-ruby/api/payroll_uk_api.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index 51f8e107..5a008630 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index c01d3cc2..76e4b633 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -62,6 +62,11 @@ def project_api XeroRuby::ProjectApi.new(self) end + def files_api + @config.base_url = @config.files_url + XeroRuby::FilesApi.new(self) + end + def payroll_au_api @config.base_url = @config.payroll_au_url XeroRuby::PayrollAu.new(self) diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb index 9055ef65..86d8c12b 100644 --- a/lib/xero-ruby/api_error.rb +++ b/lib/xero-ruby/api_error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb index 640c82df..48643e20 100644 --- a/lib/xero-ruby/configuration.rb +++ b/lib/xero-ruby/configuration.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -30,6 +30,7 @@ class Configuration attr_accessor :accounting_url attr_accessor :asset_url attr_accessor :project_url + attr_accessor :files_url attr_accessor :payroll_au_url attr_accessor :payroll_nz_url attr_accessor :payroll_uk_url @@ -142,6 +143,7 @@ def initialize @accounting_url = 'https://api.xero.com/api.xro/2.0' @asset_url = 'https://api.xero.com/assets.xro/1.0' @project_url = 'https://api.xero.com/projects.xro/2.0/' + @files_url = 'https://api.xero.com/files.xro/1.0/' @payroll_au_url = 'https://api.xero.com/payroll.xro/1.0/' @payroll_nz_url = 'https://api.xero.com/payroll.xro/2.0/' @payroll_uk_url = 'https://api.xero.com/payroll.xro/2.0/' diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index 88f85ab8..e97a836c 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -91,7 +91,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - # EMPTY = "".freeze + EMPTY = "".freeze # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb index 749c97a1..c6b82d21 100644 --- a/lib/xero-ruby/models/accounting/account_type.rb +++ b/lib/xero-ruby/models/accounting/account_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb index ef5ac715..b2ad2763 100644 --- a/lib/xero-ruby/models/accounting/accounts.rb +++ b/lib/xero-ruby/models/accounting/accounts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb index 0220c85b..61e28698 100644 --- a/lib/xero-ruby/models/accounting/accounts_payable.rb +++ b/lib/xero-ruby/models/accounting/accounts_payable.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb index d9692a35..b8a8d98c 100644 --- a/lib/xero-ruby/models/accounting/accounts_receivable.rb +++ b/lib/xero-ruby/models/accounting/accounts_receivable.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/action.rb b/lib/xero-ruby/models/accounting/action.rb index f71dd035..c37e34f3 100644 --- a/lib/xero-ruby/models/accounting/action.rb +++ b/lib/xero-ruby/models/accounting/action.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/actions.rb b/lib/xero-ruby/models/accounting/actions.rb index 6f9082ac..f9d7935d 100644 --- a/lib/xero-ruby/models/accounting/actions.rb +++ b/lib/xero-ruby/models/accounting/actions.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb index 9212ebb1..8c161768 100644 --- a/lib/xero-ruby/models/accounting/address.rb +++ b/lib/xero-ruby/models/accounting/address.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb index 09d3f598..e31b271d 100644 --- a/lib/xero-ruby/models/accounting/allocation.rb +++ b/lib/xero-ruby/models/accounting/allocation.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb index 3fbfd9ff..2b4f80f7 100644 --- a/lib/xero-ruby/models/accounting/allocations.rb +++ b/lib/xero-ruby/models/accounting/allocations.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb index 0b3239a3..806e1774 100644 --- a/lib/xero-ruby/models/accounting/attachment.rb +++ b/lib/xero-ruby/models/accounting/attachment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb index b9b14637..95e0e63c 100644 --- a/lib/xero-ruby/models/accounting/attachments.rb +++ b/lib/xero-ruby/models/accounting/attachments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb index ccd5066d..539acba5 100644 --- a/lib/xero-ruby/models/accounting/balances.rb +++ b/lib/xero-ruby/models/accounting/balances.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb index fc838c51..3329afcb 100644 --- a/lib/xero-ruby/models/accounting/bank_transaction.rb +++ b/lib/xero-ruby/models/accounting/bank_transaction.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb index 42e9a494..78b884c7 100644 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb index 91497496..508b4da0 100644 --- a/lib/xero-ruby/models/accounting/bank_transfer.rb +++ b/lib/xero-ruby/models/accounting/bank_transfer.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb index b51570f3..361f22c4 100644 --- a/lib/xero-ruby/models/accounting/bank_transfers.rb +++ b/lib/xero-ruby/models/accounting/bank_transfers.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb index e4114595..cf881f10 100644 --- a/lib/xero-ruby/models/accounting/batch_payment.rb +++ b/lib/xero-ruby/models/accounting/batch_payment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb index 1095bb68..ee725824 100644 --- a/lib/xero-ruby/models/accounting/batch_payment_details.rb +++ b/lib/xero-ruby/models/accounting/batch_payment_details.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb index a1b4597d..2dc40f56 100644 --- a/lib/xero-ruby/models/accounting/batch_payments.rb +++ b/lib/xero-ruby/models/accounting/batch_payments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb index aabe09d9..0a9acdaa 100644 --- a/lib/xero-ruby/models/accounting/bill.rb +++ b/lib/xero-ruby/models/accounting/bill.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb index 51e85fc3..4bc52df9 100644 --- a/lib/xero-ruby/models/accounting/branding_theme.rb +++ b/lib/xero-ruby/models/accounting/branding_theme.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb index 911807d4..abc64c18 100644 --- a/lib/xero-ruby/models/accounting/branding_themes.rb +++ b/lib/xero-ruby/models/accounting/branding_themes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb index 9e3bd751..a5fbf3d0 100644 --- a/lib/xero-ruby/models/accounting/cis_org_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_org_setting.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb index a89f924e..67369f88 100644 --- a/lib/xero-ruby/models/accounting/cis_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_setting.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb index dafa67d5..0e2cbde9 100644 --- a/lib/xero-ruby/models/accounting/cis_settings.rb +++ b/lib/xero-ruby/models/accounting/cis_settings.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb index 8761b481..6a914aad 100644 --- a/lib/xero-ruby/models/accounting/contact.rb +++ b/lib/xero-ruby/models/accounting/contact.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb index 6a6e5901..6830f8e8 100644 --- a/lib/xero-ruby/models/accounting/contact_group.rb +++ b/lib/xero-ruby/models/accounting/contact_group.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb index 17a1fc91..51965f6c 100644 --- a/lib/xero-ruby/models/accounting/contact_groups.rb +++ b/lib/xero-ruby/models/accounting/contact_groups.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb index fd29faa5..46bbf173 100644 --- a/lib/xero-ruby/models/accounting/contact_person.rb +++ b/lib/xero-ruby/models/accounting/contact_person.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb index 5aa1494b..3749d334 100644 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb index 4d6b244d..f47e06a5 100644 --- a/lib/xero-ruby/models/accounting/country_code.rb +++ b/lib/xero-ruby/models/accounting/country_code.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb index 597c77f9..f1aa8a87 100644 --- a/lib/xero-ruby/models/accounting/credit_note.rb +++ b/lib/xero-ruby/models/accounting/credit_note.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb index c72c3f8c..0671ab09 100644 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb index 7299e75d..6242be0d 100644 --- a/lib/xero-ruby/models/accounting/currencies.rb +++ b/lib/xero-ruby/models/accounting/currencies.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb index 3de06dd6..2bfaa3bd 100644 --- a/lib/xero-ruby/models/accounting/currency.rb +++ b/lib/xero-ruby/models/accounting/currency.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb index fa83a873..c1e707f0 100644 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -156,7 +156,7 @@ class CurrencyCode TMT = "TMT".freeze TND = "TND".freeze TOP = "TOP".freeze - TRY = "TRY".freeze + TRY_LIRA = "TRY".freeze TTD = "TTD".freeze TVD = "TVD".freeze TWD = "TWD".freeze @@ -180,7 +180,7 @@ class CurrencyCode ZMW = "ZMW".freeze ZMK = "ZMK".freeze ZWD = "ZWD".freeze - EMPTY = "".freeze + EMPTY_CURRENCY = "".freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb index de63b8cc..284d3279 100644 --- a/lib/xero-ruby/models/accounting/element.rb +++ b/lib/xero-ruby/models/accounting/element.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb index e3681787..390d65c4 100644 --- a/lib/xero-ruby/models/accounting/employee.rb +++ b/lib/xero-ruby/models/accounting/employee.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb index f4fb4beb..b30d51a9 100644 --- a/lib/xero-ruby/models/accounting/employees.rb +++ b/lib/xero-ruby/models/accounting/employees.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb index f6e09112..bd9e2c9a 100644 --- a/lib/xero-ruby/models/accounting/error.rb +++ b/lib/xero-ruby/models/accounting/error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb index 01d16285..4f7e230f 100644 --- a/lib/xero-ruby/models/accounting/expense_claim.rb +++ b/lib/xero-ruby/models/accounting/expense_claim.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -55,7 +55,7 @@ class ExpenseClaim # The date the expense claim will be reported in Xero YYYY-MM-DD attr_accessor :reporting_date - # The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 + # The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 attr_accessor :receipt_id class EnumAttributeValidator diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb index ac1c8f3c..df2f9297 100644 --- a/lib/xero-ruby/models/accounting/expense_claims.rb +++ b/lib/xero-ruby/models/accounting/expense_claims.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb index 9175dc0e..e44af833 100644 --- a/lib/xero-ruby/models/accounting/external_link.rb +++ b/lib/xero-ruby/models/accounting/external_link.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb index 39326d0b..6ac6bb4d 100644 --- a/lib/xero-ruby/models/accounting/history_record.rb +++ b/lib/xero-ruby/models/accounting/history_record.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb index a64a3d87..9b8738ae 100644 --- a/lib/xero-ruby/models/accounting/history_records.rb +++ b/lib/xero-ruby/models/accounting/history_records.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb index 268a5941..b34118cc 100644 --- a/lib/xero-ruby/models/accounting/invoice.rb +++ b/lib/xero-ruby/models/accounting/invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb index 827de7d6..c15bbdf3 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminder.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminder.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb index 827befbe..3bb02fef 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminders.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminders.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb index 5d3b4cfb..19974961 100644 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb index 08477b73..f3589387 100644 --- a/lib/xero-ruby/models/accounting/item.rb +++ b/lib/xero-ruby/models/accounting/item.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb index 0a87592e..e59bd850 100644 --- a/lib/xero-ruby/models/accounting/items.rb +++ b/lib/xero-ruby/models/accounting/items.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb index 6e8466ea..0d59a3da 100644 --- a/lib/xero-ruby/models/accounting/journal.rb +++ b/lib/xero-ruby/models/accounting/journal.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb index edf1c19f..a7d8d995 100644 --- a/lib/xero-ruby/models/accounting/journal_line.rb +++ b/lib/xero-ruby/models/accounting/journal_line.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb index a6df4bde..ea2d585a 100644 --- a/lib/xero-ruby/models/accounting/journals.rb +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb index 059eadb6..bd8befd0 100644 --- a/lib/xero-ruby/models/accounting/line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/line_amount_types.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb index 606dd56f..4bbaef4c 100644 --- a/lib/xero-ruby/models/accounting/line_item.rb +++ b/lib/xero-ruby/models/accounting/line_item.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb index cb55fef2..e7ef2082 100644 --- a/lib/xero-ruby/models/accounting/line_item_tracking.rb +++ b/lib/xero-ruby/models/accounting/line_item_tracking.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb index 9c051f46..18e1f78c 100644 --- a/lib/xero-ruby/models/accounting/linked_transaction.rb +++ b/lib/xero-ruby/models/accounting/linked_transaction.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb index e3bce7aa..1f9b68a6 100644 --- a/lib/xero-ruby/models/accounting/linked_transactions.rb +++ b/lib/xero-ruby/models/accounting/linked_transactions.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb index ee762e09..3f07ed55 100644 --- a/lib/xero-ruby/models/accounting/manual_journal.rb +++ b/lib/xero-ruby/models/accounting/manual_journal.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb index f4546306..a5790bbd 100644 --- a/lib/xero-ruby/models/accounting/manual_journal_line.rb +++ b/lib/xero-ruby/models/accounting/manual_journal_line.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb index 0e9ac4e3..2beedec9 100644 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb index cc90daa9..012fdb2c 100644 --- a/lib/xero-ruby/models/accounting/online_invoice.rb +++ b/lib/xero-ruby/models/accounting/online_invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb index 9e71e4cf..9b62779a 100644 --- a/lib/xero-ruby/models/accounting/online_invoices.rb +++ b/lib/xero-ruby/models/accounting/online_invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 24f9ed25..61b13154 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -114,7 +114,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - # NONE = "NONE".freeze + NONE = "NONE".freeze # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax @@ -136,18 +136,18 @@ class Organisation # Organisation Entity Type attr_accessor :organisation_entity_type - # ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze - # COMPANY = "COMPANY".freeze - # CHARITY = "CHARITY".freeze - # CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze - # LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze - # NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze - # PARTNERSHIP = "PARTNERSHIP".freeze - # S_CORPORATION = "S_CORPORATION".freeze - # SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze - # SOLE_TRADER = "SOLE_TRADER".freeze - # SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze - # TRUST = "TRUST".freeze + ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + COMPANY = "COMPANY".freeze + CHARITY = "CHARITY".freeze + CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + PARTNERSHIP = "PARTNERSHIP".freeze + S_CORPORATION = "S_CORPORATION".freeze + SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + SOLE_TRADER = "SOLE_TRADER".freeze + SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + TRUST = "TRUST".freeze # A unique identifier for the organisation. Potential uses. attr_accessor :short_code diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb index 8b8208b2..1afba0b5 100644 --- a/lib/xero-ruby/models/accounting/organisations.rb +++ b/lib/xero-ruby/models/accounting/organisations.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb index 7d1d6cc0..465dcdb2 100644 --- a/lib/xero-ruby/models/accounting/overpayment.rb +++ b/lib/xero-ruby/models/accounting/overpayment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb index 858b2adb..f34078de 100644 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb index 3941139d..7aa969f5 100644 --- a/lib/xero-ruby/models/accounting/payment.rb +++ b/lib/xero-ruby/models/accounting/payment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb index e4647059..361d5fef 100644 --- a/lib/xero-ruby/models/accounting/payment_delete.rb +++ b/lib/xero-ruby/models/accounting/payment_delete.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb index f610a686..b7eef041 100644 --- a/lib/xero-ruby/models/accounting/payment_service.rb +++ b/lib/xero-ruby/models/accounting/payment_service.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb index b6f24918..ade19f9d 100644 --- a/lib/xero-ruby/models/accounting/payment_services.rb +++ b/lib/xero-ruby/models/accounting/payment_services.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb index 64730935..30674418 100644 --- a/lib/xero-ruby/models/accounting/payment_term.rb +++ b/lib/xero-ruby/models/accounting/payment_term.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb index 81132e33..4cc475f2 100644 --- a/lib/xero-ruby/models/accounting/payment_term_type.rb +++ b/lib/xero-ruby/models/accounting/payment_term_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb index de5fbfa2..9752e170 100644 --- a/lib/xero-ruby/models/accounting/payments.rb +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb index 4d3bb3d3..d45dea2b 100644 --- a/lib/xero-ruby/models/accounting/phone.rb +++ b/lib/xero-ruby/models/accounting/phone.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb index 56cd222d..0cb7d590 100644 --- a/lib/xero-ruby/models/accounting/prepayment.rb +++ b/lib/xero-ruby/models/accounting/prepayment.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb index c38d1395..d6382238 100644 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb index 1e0416d8..a8441035 100644 --- a/lib/xero-ruby/models/accounting/purchase.rb +++ b/lib/xero-ruby/models/accounting/purchase.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb index 1e4cc15e..c5a47175 100644 --- a/lib/xero-ruby/models/accounting/purchase_order.rb +++ b/lib/xero-ruby/models/accounting/purchase_order.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb index c0c6ef49..c74fa802 100644 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb index ef218c02..9fd894ea 100644 --- a/lib/xero-ruby/models/accounting/quote.rb +++ b/lib/xero-ruby/models/accounting/quote.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb index bcd40372..28a969d7 100644 --- a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb index 229563be..d41778fa 100644 --- a/lib/xero-ruby/models/accounting/quote_status_codes.rb +++ b/lib/xero-ruby/models/accounting/quote_status_codes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb index 2e8e7a6b..b5bb64c7 100644 --- a/lib/xero-ruby/models/accounting/quotes.rb +++ b/lib/xero-ruby/models/accounting/quotes.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb index 2da935ce..8b2e5616 100644 --- a/lib/xero-ruby/models/accounting/receipt.rb +++ b/lib/xero-ruby/models/accounting/receipt.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb index 53ee1838..c7d9ce01 100644 --- a/lib/xero-ruby/models/accounting/receipts.rb +++ b/lib/xero-ruby/models/accounting/receipts.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb index 839b538c..5287ef96 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoice.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoice.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb index bc6a37ff..cc63e1dd 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoices.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoices.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb index e174529a..d116cad4 100644 --- a/lib/xero-ruby/models/accounting/report.rb +++ b/lib/xero-ruby/models/accounting/report.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb index a83accd2..4348e262 100644 --- a/lib/xero-ruby/models/accounting/report_attribute.rb +++ b/lib/xero-ruby/models/accounting/report_attribute.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb index 1156e5e7..0649153d 100644 --- a/lib/xero-ruby/models/accounting/report_cell.rb +++ b/lib/xero-ruby/models/accounting/report_cell.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb index 22dc3795..bbb8e969 100644 --- a/lib/xero-ruby/models/accounting/report_fields.rb +++ b/lib/xero-ruby/models/accounting/report_fields.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb index 65f5eb38..254d4233 100644 --- a/lib/xero-ruby/models/accounting/report_row.rb +++ b/lib/xero-ruby/models/accounting/report_row.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb index 33e72f69..6a0ca21f 100644 --- a/lib/xero-ruby/models/accounting/report_rows.rb +++ b/lib/xero-ruby/models/accounting/report_rows.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb index 32cf6df6..0a56ccc6 100644 --- a/lib/xero-ruby/models/accounting/report_with_row.rb +++ b/lib/xero-ruby/models/accounting/report_with_row.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb index 2d966adc..24fda32d 100644 --- a/lib/xero-ruby/models/accounting/report_with_rows.rb +++ b/lib/xero-ruby/models/accounting/report_with_rows.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb index be80924d..8335f047 100644 --- a/lib/xero-ruby/models/accounting/reports.rb +++ b/lib/xero-ruby/models/accounting/reports.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb index e29029ef..2712ca81 100644 --- a/lib/xero-ruby/models/accounting/request_empty.rb +++ b/lib/xero-ruby/models/accounting/request_empty.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb index 5e120bf2..849e7b15 100644 --- a/lib/xero-ruby/models/accounting/row_type.rb +++ b/lib/xero-ruby/models/accounting/row_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb index 34339e06..3d8cc11b 100644 --- a/lib/xero-ruby/models/accounting/sales_tracking_category.rb +++ b/lib/xero-ruby/models/accounting/sales_tracking_category.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb index 722103f8..520819c1 100644 --- a/lib/xero-ruby/models/accounting/schedule.rb +++ b/lib/xero-ruby/models/accounting/schedule.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb index b6e53a9b..b300e1cc 100644 --- a/lib/xero-ruby/models/accounting/tax_component.rb +++ b/lib/xero-ruby/models/accounting/tax_component.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb index b20b439d..0421e047 100644 --- a/lib/xero-ruby/models/accounting/tax_rate.rb +++ b/lib/xero-ruby/models/accounting/tax_rate.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb index 0349fb5a..7a0de95f 100644 --- a/lib/xero-ruby/models/accounting/tax_rates.rb +++ b/lib/xero-ruby/models/accounting/tax_rates.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb index 718d93f3..b93e67d0 100644 --- a/lib/xero-ruby/models/accounting/tax_type.rb +++ b/lib/xero-ruby/models/accounting/tax_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb index a6fbd608..35c6edca 100644 --- a/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +++ b/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb index ed95e6ec..fb5e16c6 100644 --- a/lib/xero-ruby/models/accounting/time_zone.rb +++ b/lib/xero-ruby/models/accounting/time_zone.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb index 496174e1..33327c0c 100644 --- a/lib/xero-ruby/models/accounting/tracking_categories.rb +++ b/lib/xero-ruby/models/accounting/tracking_categories.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb index 098aef36..c046d54c 100644 --- a/lib/xero-ruby/models/accounting/tracking_category.rb +++ b/lib/xero-ruby/models/accounting/tracking_category.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb index a7f1296d..6dc3a5cd 100644 --- a/lib/xero-ruby/models/accounting/tracking_option.rb +++ b/lib/xero-ruby/models/accounting/tracking_option.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb index 91ea7db1..e5444c20 100644 --- a/lib/xero-ruby/models/accounting/tracking_options.rb +++ b/lib/xero-ruby/models/accounting/tracking_options.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb index b96c049c..9e6ae98a 100644 --- a/lib/xero-ruby/models/accounting/user.rb +++ b/lib/xero-ruby/models/accounting/user.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb index c90ca6f9..eca1b5aa 100644 --- a/lib/xero-ruby/models/accounting/users.rb +++ b/lib/xero-ruby/models/accounting/users.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb index d2dad08e..8f5d4537 100644 --- a/lib/xero-ruby/models/accounting/validation_error.rb +++ b/lib/xero-ruby/models/accounting/validation_error.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb index b269a950..03571fa5 100644 --- a/lib/xero-ruby/models/assets/asset.rb +++ b/lib/xero-ruby/models/assets/asset.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb index a264cb5a..a4776086 100644 --- a/lib/xero-ruby/models/assets/asset_status.rb +++ b/lib/xero-ruby/models/assets/asset_status.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb index 637244e6..f372dbe1 100644 --- a/lib/xero-ruby/models/assets/asset_status_query_param.rb +++ b/lib/xero-ruby/models/assets/asset_status_query_param.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb index fd61b98b..28eeaaff 100644 --- a/lib/xero-ruby/models/assets/asset_type.rb +++ b/lib/xero-ruby/models/assets/asset_type.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb index 896dc005..5fc9963c 100644 --- a/lib/xero-ruby/models/assets/assets.rb +++ b/lib/xero-ruby/models/assets/assets.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb index 2671cfb3..f27c0c8e 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_detail.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_detail.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb index 326d4e2d..e057cf8e 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_setting.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb index 2b3c6525..57a0cf59 100644 --- a/lib/xero-ruby/models/assets/error.rb +++ b/lib/xero-ruby/models/assets/error.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb index e8114a61..0e9b4bf8 100644 --- a/lib/xero-ruby/models/assets/field_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/field_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb index e7a1d12e..9e97dcc1 100644 --- a/lib/xero-ruby/models/assets/pagination.rb +++ b/lib/xero-ruby/models/assets/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb index 3dc625ba..c60220a3 100644 --- a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb index e62e5b03..009fdcb8 100644 --- a/lib/xero-ruby/models/assets/setting.rb +++ b/lib/xero-ruby/models/assets/setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/association.rb b/lib/xero-ruby/models/files/association.rb index 32c248c6..61279c2a 100644 --- a/lib/xero-ruby/models/files/association.rb +++ b/lib/xero-ruby/models/files/association.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/file_object.rb b/lib/xero-ruby/models/files/file_object.rb index eb842a22..398c42f5 100644 --- a/lib/xero-ruby/models/files/file_object.rb +++ b/lib/xero-ruby/models/files/file_object.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/file_response204.rb b/lib/xero-ruby/models/files/file_response204.rb index 2fa07e21..a40f98a9 100644 --- a/lib/xero-ruby/models/files/file_response204.rb +++ b/lib/xero-ruby/models/files/file_response204.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/files.rb b/lib/xero-ruby/models/files/files.rb index d46fd9e1..937f71f9 100644 --- a/lib/xero-ruby/models/files/files.rb +++ b/lib/xero-ruby/models/files/files.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/folder.rb b/lib/xero-ruby/models/files/folder.rb index 2c1766dd..2ff623ca 100644 --- a/lib/xero-ruby/models/files/folder.rb +++ b/lib/xero-ruby/models/files/folder.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/folders.rb b/lib/xero-ruby/models/files/folders.rb index 3505844d..acf723f3 100644 --- a/lib/xero-ruby/models/files/folders.rb +++ b/lib/xero-ruby/models/files/folders.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/inline_object.rb b/lib/xero-ruby/models/files/inline_object.rb index 8a2c9258..3713fe0a 100644 --- a/lib/xero-ruby/models/files/inline_object.rb +++ b/lib/xero-ruby/models/files/inline_object.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/object_group.rb b/lib/xero-ruby/models/files/object_group.rb index 46fe2119..86559c26 100644 --- a/lib/xero-ruby/models/files/object_group.rb +++ b/lib/xero-ruby/models/files/object_group.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/files/object_type.rb b/lib/xero-ruby/models/files/object_type.rb index 04546050..3285ab9e 100644 --- a/lib/xero-ruby/models/files/object_type.rb +++ b/lib/xero-ruby/models/files/object_type.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -20,6 +20,7 @@ class ObjectType ACCPAYCREDIT = "ACCPAYCREDIT".freeze ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze ACCREC = "ACCREC".freeze + ACC_REC = "AccRec".freeze ACCRECCREDIT = "ACCRECCREDIT".freeze ACCRECPAYMENT = "ACCRECPAYMENT".freeze ADJUSTMENT = "ADJUSTMENT".freeze diff --git a/lib/xero-ruby/models/files/user.rb b/lib/xero-ruby/models/files/user.rb index a74507f5..6bc7ee0b 100644 --- a/lib/xero-ruby/models/files/user.rb +++ b/lib/xero-ruby/models/files/user.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/account.rb b/lib/xero-ruby/models/payroll_au/account.rb index 33ba1597..e570ad8a 100644 --- a/lib/xero-ruby/models/payroll_au/account.rb +++ b/lib/xero-ruby/models/payroll_au/account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/account_type.rb b/lib/xero-ruby/models/payroll_au/account_type.rb index c9307ce5..069fd4c0 100644 --- a/lib/xero-ruby/models/payroll_au/account_type.rb +++ b/lib/xero-ruby/models/payroll_au/account_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/allowance_type.rb b/lib/xero-ruby/models/payroll_au/allowance_type.rb index 1c8ddb45..4566f2d7 100644 --- a/lib/xero-ruby/models/payroll_au/allowance_type.rb +++ b/lib/xero-ruby/models/payroll_au/allowance_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/api_exception.rb b/lib/xero-ruby/models/payroll_au/api_exception.rb index 4d8fb8dc..c6e690d5 100644 --- a/lib/xero-ruby/models/payroll_au/api_exception.rb +++ b/lib/xero-ruby/models/payroll_au/api_exception.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/bank_account.rb b/lib/xero-ruby/models/payroll_au/bank_account.rb index b099f00b..31f9f740 100644 --- a/lib/xero-ruby/models/payroll_au/bank_account.rb +++ b/lib/xero-ruby/models/payroll_au/bank_account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/calendar_type.rb b/lib/xero-ruby/models/payroll_au/calendar_type.rb index e3f6af72..ef2b393c 100644 --- a/lib/xero-ruby/models/payroll_au/calendar_type.rb +++ b/lib/xero-ruby/models/payroll_au/calendar_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/deduction_line.rb b/lib/xero-ruby/models/payroll_au/deduction_line.rb index 0dace00f..fa500727 100644 --- a/lib/xero-ruby/models/payroll_au/deduction_line.rb +++ b/lib/xero-ruby/models/payroll_au/deduction_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/deduction_type.rb b/lib/xero-ruby/models/payroll_au/deduction_type.rb index f177a754..e86fd372 100644 --- a/lib/xero-ruby/models/payroll_au/deduction_type.rb +++ b/lib/xero-ruby/models/payroll_au/deduction_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb b/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb index 22cbd254..89420277 100644 --- a/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb +++ b/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/earnings_line.rb b/lib/xero-ruby/models/payroll_au/earnings_line.rb index 8286595b..db5bef3f 100644 --- a/lib/xero-ruby/models/payroll_au/earnings_line.rb +++ b/lib/xero-ruby/models/payroll_au/earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/earnings_rate.rb b/lib/xero-ruby/models/payroll_au/earnings_rate.rb index 8394a280..05e92a5a 100644 --- a/lib/xero-ruby/models/payroll_au/earnings_rate.rb +++ b/lib/xero-ruby/models/payroll_au/earnings_rate.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb b/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb index 5274ba61..9e5728ff 100644 --- a/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb +++ b/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/earnings_type.rb b/lib/xero-ruby/models/payroll_au/earnings_type.rb index 1d24f301..5e69c715 100644 --- a/lib/xero-ruby/models/payroll_au/earnings_type.rb +++ b/lib/xero-ruby/models/payroll_au/earnings_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/employee.rb b/lib/xero-ruby/models/payroll_au/employee.rb index e7f7b064..15b00e51 100644 --- a/lib/xero-ruby/models/payroll_au/employee.rb +++ b/lib/xero-ruby/models/payroll_au/employee.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/employee_status.rb b/lib/xero-ruby/models/payroll_au/employee_status.rb index d21cfdb0..61f35396 100644 --- a/lib/xero-ruby/models/payroll_au/employee_status.rb +++ b/lib/xero-ruby/models/payroll_au/employee_status.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/employees.rb b/lib/xero-ruby/models/payroll_au/employees.rb index a35157f1..d333610b 100644 --- a/lib/xero-ruby/models/payroll_au/employees.rb +++ b/lib/xero-ruby/models/payroll_au/employees.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/employment_basis.rb b/lib/xero-ruby/models/payroll_au/employment_basis.rb index 4975dd67..ac55ab87 100644 --- a/lib/xero-ruby/models/payroll_au/employment_basis.rb +++ b/lib/xero-ruby/models/payroll_au/employment_basis.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb b/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb index ea9ce8e0..67c10edc 100644 --- a/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb +++ b/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb b/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb index 1ff83161..73a98602 100644 --- a/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb +++ b/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/home_address.rb b/lib/xero-ruby/models/payroll_au/home_address.rb index 21653789..c2452391 100644 --- a/lib/xero-ruby/models/payroll_au/home_address.rb +++ b/lib/xero-ruby/models/payroll_au/home_address.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb index 267e5f89..aa041c1f 100644 --- a/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb +++ b/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_application.rb b/lib/xero-ruby/models/payroll_au/leave_application.rb index 7e57723e..8ff3f276 100644 --- a/lib/xero-ruby/models/payroll_au/leave_application.rb +++ b/lib/xero-ruby/models/payroll_au/leave_application.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_applications.rb b/lib/xero-ruby/models/payroll_au/leave_applications.rb index 3384d5a2..82334722 100644 --- a/lib/xero-ruby/models/payroll_au/leave_applications.rb +++ b/lib/xero-ruby/models/payroll_au/leave_applications.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_balance.rb b/lib/xero-ruby/models/payroll_au/leave_balance.rb index a6f21e05..1c6549a1 100644 --- a/lib/xero-ruby/models/payroll_au/leave_balance.rb +++ b/lib/xero-ruby/models/payroll_au/leave_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb index 6647107f..79ab30f9 100644 --- a/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +++ b/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_line.rb b/lib/xero-ruby/models/payroll_au/leave_line.rb index 0a4e006e..31838668 100644 --- a/lib/xero-ruby/models/payroll_au/leave_line.rb +++ b/lib/xero-ruby/models/payroll_au/leave_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb b/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb index 6bcfd488..61540616 100644 --- a/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +++ b/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_lines.rb b/lib/xero-ruby/models/payroll_au/leave_lines.rb index b6e6302a..da33b332 100644 --- a/lib/xero-ruby/models/payroll_au/leave_lines.rb +++ b/lib/xero-ruby/models/payroll_au/leave_lines.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_period.rb b/lib/xero-ruby/models/payroll_au/leave_period.rb index ab4b151c..b14b0932 100644 --- a/lib/xero-ruby/models/payroll_au/leave_period.rb +++ b/lib/xero-ruby/models/payroll_au/leave_period.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_period_status.rb b/lib/xero-ruby/models/payroll_au/leave_period_status.rb index 8f6605a3..06a21fd8 100644 --- a/lib/xero-ruby/models/payroll_au/leave_period_status.rb +++ b/lib/xero-ruby/models/payroll_au/leave_period_status.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_type.rb b/lib/xero-ruby/models/payroll_au/leave_type.rb index cd51437a..f4cbe3bf 100644 --- a/lib/xero-ruby/models/payroll_au/leave_type.rb +++ b/lib/xero-ruby/models/payroll_au/leave_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb b/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb index c82704af..de3568a2 100644 --- a/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb +++ b/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/manual_tax_type.rb b/lib/xero-ruby/models/payroll_au/manual_tax_type.rb index cd806e8b..84392f22 100644 --- a/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +++ b/lib/xero-ruby/models/payroll_au/manual_tax_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/opening_balances.rb b/lib/xero-ruby/models/payroll_au/opening_balances.rb index b7732cf7..c436c8ee 100644 --- a/lib/xero-ruby/models/payroll_au/opening_balances.rb +++ b/lib/xero-ruby/models/payroll_au/opening_balances.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_item.rb b/lib/xero-ruby/models/payroll_au/pay_item.rb index b1ac6ae0..9bddd684 100644 --- a/lib/xero-ruby/models/payroll_au/pay_item.rb +++ b/lib/xero-ruby/models/payroll_au/pay_item.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_items.rb b/lib/xero-ruby/models/payroll_au/pay_items.rb index d640309e..ccdb3d1a 100644 --- a/lib/xero-ruby/models/payroll_au/pay_items.rb +++ b/lib/xero-ruby/models/payroll_au/pay_items.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_run.rb b/lib/xero-ruby/models/payroll_au/pay_run.rb index 32e46fb3..6c34751c 100644 --- a/lib/xero-ruby/models/payroll_au/pay_run.rb +++ b/lib/xero-ruby/models/payroll_au/pay_run.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_run_status.rb b/lib/xero-ruby/models/payroll_au/pay_run_status.rb index 7a2a2ff3..22bb85a6 100644 --- a/lib/xero-ruby/models/payroll_au/pay_run_status.rb +++ b/lib/xero-ruby/models/payroll_au/pay_run_status.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_runs.rb b/lib/xero-ruby/models/payroll_au/pay_runs.rb index 47909133..27872c77 100644 --- a/lib/xero-ruby/models/payroll_au/pay_runs.rb +++ b/lib/xero-ruby/models/payroll_au/pay_runs.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/pay_template.rb b/lib/xero-ruby/models/payroll_au/pay_template.rb index c3a45a0d..699a85e6 100644 --- a/lib/xero-ruby/models/payroll_au/pay_template.rb +++ b/lib/xero-ruby/models/payroll_au/pay_template.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb b/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb index cf70c063..418f5dbc 100644 --- a/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb +++ b/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payroll_calendar.rb b/lib/xero-ruby/models/payroll_au/payroll_calendar.rb index 71c90815..625318ec 100644 --- a/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +++ b/lib/xero-ruby/models/payroll_au/payroll_calendar.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payroll_calendars.rb b/lib/xero-ruby/models/payroll_au/payroll_calendars.rb index 9a1ad345..280f0adf 100644 --- a/lib/xero-ruby/models/payroll_au/payroll_calendars.rb +++ b/lib/xero-ruby/models/payroll_au/payroll_calendars.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payslip.rb b/lib/xero-ruby/models/payroll_au/payslip.rb index f8f21220..266e901f 100644 --- a/lib/xero-ruby/models/payroll_au/payslip.rb +++ b/lib/xero-ruby/models/payroll_au/payslip.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payslip_lines.rb b/lib/xero-ruby/models/payroll_au/payslip_lines.rb index e45752d0..a898de21 100644 --- a/lib/xero-ruby/models/payroll_au/payslip_lines.rb +++ b/lib/xero-ruby/models/payroll_au/payslip_lines.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payslip_object.rb b/lib/xero-ruby/models/payroll_au/payslip_object.rb index 190ac8c5..a9ff03ed 100644 --- a/lib/xero-ruby/models/payroll_au/payslip_object.rb +++ b/lib/xero-ruby/models/payroll_au/payslip_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payslip_summary.rb b/lib/xero-ruby/models/payroll_au/payslip_summary.rb index 2fee42a4..e8b5ad4d 100644 --- a/lib/xero-ruby/models/payroll_au/payslip_summary.rb +++ b/lib/xero-ruby/models/payroll_au/payslip_summary.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/payslips.rb b/lib/xero-ruby/models/payroll_au/payslips.rb index 405fb248..ec33519f 100644 --- a/lib/xero-ruby/models/payroll_au/payslips.rb +++ b/lib/xero-ruby/models/payroll_au/payslips.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/rate_type.rb b/lib/xero-ruby/models/payroll_au/rate_type.rb index 2809f40c..a97db1f9 100644 --- a/lib/xero-ruby/models/payroll_au/rate_type.rb +++ b/lib/xero-ruby/models/payroll_au/rate_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_line.rb b/lib/xero-ruby/models/payroll_au/reimbursement_line.rb index 78557118..bce584c2 100644 --- a/lib/xero-ruby/models/payroll_au/reimbursement_line.rb +++ b/lib/xero-ruby/models/payroll_au/reimbursement_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb b/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb index 90dd1e83..2add9c62 100644 --- a/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb +++ b/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/reimbursement_type.rb b/lib/xero-ruby/models/payroll_au/reimbursement_type.rb index 10ddf916..75b77cf3 100644 --- a/lib/xero-ruby/models/payroll_au/reimbursement_type.rb +++ b/lib/xero-ruby/models/payroll_au/reimbursement_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/residency_status.rb b/lib/xero-ruby/models/payroll_au/residency_status.rb index cd2569bb..0cf344b2 100644 --- a/lib/xero-ruby/models/payroll_au/residency_status.rb +++ b/lib/xero-ruby/models/payroll_au/residency_status.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/settings.rb b/lib/xero-ruby/models/payroll_au/settings.rb index 6c3ba5ff..467bcae6 100644 --- a/lib/xero-ruby/models/payroll_au/settings.rb +++ b/lib/xero-ruby/models/payroll_au/settings.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/settings_object.rb b/lib/xero-ruby/models/payroll_au/settings_object.rb index 6d8f1292..eff121d4 100644 --- a/lib/xero-ruby/models/payroll_au/settings_object.rb +++ b/lib/xero-ruby/models/payroll_au/settings_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb index 3b33a9ab..5747b50f 100644 --- a/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb index 14b4d9a2..43e364e0 100644 --- a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb index fdc2c924..9c332e91 100644 --- a/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb +++ b/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/state.rb b/lib/xero-ruby/models/payroll_au/state.rb index 78c28637..168e9e17 100644 --- a/lib/xero-ruby/models/payroll_au/state.rb +++ b/lib/xero-ruby/models/payroll_au/state.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_fund.rb b/lib/xero-ruby/models/payroll_au/super_fund.rb index 42f2b32b..5a9a2798 100644 --- a/lib/xero-ruby/models/payroll_au/super_fund.rb +++ b/lib/xero-ruby/models/payroll_au/super_fund.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_fund_product.rb b/lib/xero-ruby/models/payroll_au/super_fund_product.rb index 6c752714..f204759c 100644 --- a/lib/xero-ruby/models/payroll_au/super_fund_product.rb +++ b/lib/xero-ruby/models/payroll_au/super_fund_product.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_fund_products.rb b/lib/xero-ruby/models/payroll_au/super_fund_products.rb index 078b5d3b..56a8dcd1 100644 --- a/lib/xero-ruby/models/payroll_au/super_fund_products.rb +++ b/lib/xero-ruby/models/payroll_au/super_fund_products.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_fund_type.rb b/lib/xero-ruby/models/payroll_au/super_fund_type.rb index 06f0234f..e230fdc4 100644 --- a/lib/xero-ruby/models/payroll_au/super_fund_type.rb +++ b/lib/xero-ruby/models/payroll_au/super_fund_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_funds.rb b/lib/xero-ruby/models/payroll_au/super_funds.rb index ed1ad44e..96b8856b 100644 --- a/lib/xero-ruby/models/payroll_au/super_funds.rb +++ b/lib/xero-ruby/models/payroll_au/super_funds.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_line.rb b/lib/xero-ruby/models/payroll_au/super_line.rb index 49b760c3..db6b6f4f 100644 --- a/lib/xero-ruby/models/payroll_au/super_line.rb +++ b/lib/xero-ruby/models/payroll_au/super_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/super_membership.rb b/lib/xero-ruby/models/payroll_au/super_membership.rb index 2b4fe99f..fc3c330c 100644 --- a/lib/xero-ruby/models/payroll_au/super_membership.rb +++ b/lib/xero-ruby/models/payroll_au/super_membership.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb b/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb index c0b4d880..52ac00f9 100644 --- a/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb +++ b/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb b/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb index 659f9a63..48fc584a 100644 --- a/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb +++ b/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/superannuation_line.rb b/lib/xero-ruby/models/payroll_au/superannuation_line.rb index c994c56e..b8efba5a 100644 --- a/lib/xero-ruby/models/payroll_au/superannuation_line.rb +++ b/lib/xero-ruby/models/payroll_au/superannuation_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/tax_declaration.rb b/lib/xero-ruby/models/payroll_au/tax_declaration.rb index 40c4cc5b..58c51893 100644 --- a/lib/xero-ruby/models/payroll_au/tax_declaration.rb +++ b/lib/xero-ruby/models/payroll_au/tax_declaration.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/tax_line.rb b/lib/xero-ruby/models/payroll_au/tax_line.rb index a7078d4e..67100c40 100644 --- a/lib/xero-ruby/models/payroll_au/tax_line.rb +++ b/lib/xero-ruby/models/payroll_au/tax_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb b/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb index db1fc6f3..021bd71a 100644 --- a/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb +++ b/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/timesheet.rb b/lib/xero-ruby/models/payroll_au/timesheet.rb index 1a201c83..36606888 100644 --- a/lib/xero-ruby/models/payroll_au/timesheet.rb +++ b/lib/xero-ruby/models/payroll_au/timesheet.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/timesheet_line.rb b/lib/xero-ruby/models/payroll_au/timesheet_line.rb index 3b511302..9d49b9dc 100644 --- a/lib/xero-ruby/models/payroll_au/timesheet_line.rb +++ b/lib/xero-ruby/models/payroll_au/timesheet_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/timesheet_object.rb b/lib/xero-ruby/models/payroll_au/timesheet_object.rb index ae689c5c..6a68a25d 100644 --- a/lib/xero-ruby/models/payroll_au/timesheet_object.rb +++ b/lib/xero-ruby/models/payroll_au/timesheet_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/timesheet_status.rb b/lib/xero-ruby/models/payroll_au/timesheet_status.rb index 5c3ad0e3..d3e4f838 100644 --- a/lib/xero-ruby/models/payroll_au/timesheet_status.rb +++ b/lib/xero-ruby/models/payroll_au/timesheet_status.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/timesheets.rb b/lib/xero-ruby/models/payroll_au/timesheets.rb index 84aa2119..4c29c5bb 100644 --- a/lib/xero-ruby/models/payroll_au/timesheets.rb +++ b/lib/xero-ruby/models/payroll_au/timesheets.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_au/validation_error.rb b/lib/xero-ruby/models/payroll_au/validation_error.rb index de310c33..0b209da8 100644 --- a/lib/xero-ruby/models/payroll_au/validation_error.rb +++ b/lib/xero-ruby/models/payroll_au/validation_error.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in Australia region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/account.rb b/lib/xero-ruby/models/payroll_nz/account.rb index 068bc52d..4f1215d9 100644 --- a/lib/xero-ruby/models/payroll_nz/account.rb +++ b/lib/xero-ruby/models/payroll_nz/account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/accounts.rb b/lib/xero-ruby/models/payroll_nz/accounts.rb index f6aa75cd..6b545150 100644 --- a/lib/xero-ruby/models/payroll_nz/accounts.rb +++ b/lib/xero-ruby/models/payroll_nz/accounts.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/address.rb b/lib/xero-ruby/models/payroll_nz/address.rb index e12df6c1..9ee7698a 100644 --- a/lib/xero-ruby/models/payroll_nz/address.rb +++ b/lib/xero-ruby/models/payroll_nz/address.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/bank_account.rb b/lib/xero-ruby/models/payroll_nz/bank_account.rb index 048fbc08..5bae732e 100644 --- a/lib/xero-ruby/models/payroll_nz/bank_account.rb +++ b/lib/xero-ruby/models/payroll_nz/bank_account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/benefit.rb b/lib/xero-ruby/models/payroll_nz/benefit.rb index e578fcb2..b8fed055 100644 --- a/lib/xero-ruby/models/payroll_nz/benefit.rb +++ b/lib/xero-ruby/models/payroll_nz/benefit.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/deduction.rb b/lib/xero-ruby/models/payroll_nz/deduction.rb index 3f120a7a..07a30b90 100644 --- a/lib/xero-ruby/models/payroll_nz/deduction.rb +++ b/lib/xero-ruby/models/payroll_nz/deduction.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/deduction_line.rb b/lib/xero-ruby/models/payroll_nz/deduction_line.rb index 33cb6876..bf47e4b3 100644 --- a/lib/xero-ruby/models/payroll_nz/deduction_line.rb +++ b/lib/xero-ruby/models/payroll_nz/deduction_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/deduction_object.rb b/lib/xero-ruby/models/payroll_nz/deduction_object.rb index 3e7325d0..7f00a245 100644 --- a/lib/xero-ruby/models/payroll_nz/deduction_object.rb +++ b/lib/xero-ruby/models/payroll_nz/deduction_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/deductions.rb b/lib/xero-ruby/models/payroll_nz/deductions.rb index a4dbe253..11f9fda5 100644 --- a/lib/xero-ruby/models/payroll_nz/deductions.rb +++ b/lib/xero-ruby/models/payroll_nz/deductions.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_line.rb b/lib/xero-ruby/models/payroll_nz/earnings_line.rb index 8818ee6f..4511768a 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_line.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_order.rb b/lib/xero-ruby/models/payroll_nz/earnings_order.rb index c65f4af0..993c1892 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_order.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_order.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb index c93be063..455ed2d5 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_orders.rb b/lib/xero-ruby/models/payroll_nz/earnings_orders.rb index 8ef44526..35e15f75 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_orders.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_orders.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rate.rb b/lib/xero-ruby/models/payroll_nz/earnings_rate.rb index 8248fc1f..5244ebf0 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_rate.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_rate.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb index 7e994286..3f453f33 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_rates.rb b/lib/xero-ruby/models/payroll_nz/earnings_rates.rb index 14936c09..ac44fa1b 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_rates.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_rates.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_template.rb b/lib/xero-ruby/models/payroll_nz/earnings_template.rb index e2c2ae55..1044fa61 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_template.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_template.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb b/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb index 27b1716c..e778dd70 100644 --- a/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb +++ b/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee.rb b/lib/xero-ruby/models/payroll_nz/employee.rb index e64eb1ac..fc11620e 100644 --- a/lib/xero-ruby/models/payroll_nz/employee.rb +++ b/lib/xero-ruby/models/payroll_nz/employee.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb b/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb index 51d7f63e..9e7ab9a1 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave.rb b/lib/xero-ruby/models/payroll_nz/employee_leave.rb index 18f033de..c0960edc 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb index bf7b37c8..301a8304 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb index 2bedd8e8..f66cd87f 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb index c50c9915..f4cd292d 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb index 787f93ff..6e7fa15e 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb index f105f477..c4b01bdb 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb index 6fc6edc8..246dc188 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb index 5f955fcf..2759745a 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb b/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb index 7307985d..fa145826 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_leaves.rb b/lib/xero-ruby/models/payroll_nz/employee_leaves.rb index 9b2c60c9..4b544238 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leaves.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leaves.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_object.rb b/lib/xero-ruby/models/payroll_nz/employee_object.rb index 4e7cd709..63a10afb 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb index eccd95ee..c4428225 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb b/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb index 28b828f4..a7d86ee2 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb index 8e110ff3..29c5c829 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb index fe2947d4..d94a24a1 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb b/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb index 00ef2144..dbbb69ee 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb index 7bd3cb51..435257a4 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb index c8b53e21..db088e96 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb index 0a66b05f..65af82e8 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb index 9bd74f65..bf9b8b99 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb index 1b7951d5..bd27e483 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb index c19e4396..7086b9ed 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb index 873b2cf4..0150ca96 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_tax.rb b/lib/xero-ruby/models/payroll_nz/employee_tax.rb index d2c17e7b..973eb098 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_tax.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_tax.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb b/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb index df397b3b..8d8a7564 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employees.rb b/lib/xero-ruby/models/payroll_nz/employees.rb index 124f7518..a0706abf 100644 --- a/lib/xero-ruby/models/payroll_nz/employees.rb +++ b/lib/xero-ruby/models/payroll_nz/employees.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employment.rb b/lib/xero-ruby/models/payroll_nz/employment.rb index b9e40e9d..8f6251bd 100644 --- a/lib/xero-ruby/models/payroll_nz/employment.rb +++ b/lib/xero-ruby/models/payroll_nz/employment.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/employment_object.rb b/lib/xero-ruby/models/payroll_nz/employment_object.rb index f9a10d69..a39de188 100644 --- a/lib/xero-ruby/models/payroll_nz/employment_object.rb +++ b/lib/xero-ruby/models/payroll_nz/employment_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb b/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb index 1a91e559..f4b09e7d 100644 --- a/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb +++ b/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/invalid_field.rb b/lib/xero-ruby/models/payroll_nz/invalid_field.rb index 46658a3d..ce8a7f2a 100644 --- a/lib/xero-ruby/models/payroll_nz/invalid_field.rb +++ b/lib/xero-ruby/models/payroll_nz/invalid_field.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb index f1181c7f..710fd890 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb index 0f6aba4f..2d2f22c8 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_period.rb b/lib/xero-ruby/models/payroll_nz/leave_period.rb index a2ab8412..5b3487ff 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_period.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_period.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_periods.rb b/lib/xero-ruby/models/payroll_nz/leave_periods.rb index 3c5216e5..fbef9fec 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_periods.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_periods.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_type.rb b/lib/xero-ruby/models/payroll_nz/leave_type.rb index 88761475..728648c8 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_type.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_type_object.rb b/lib/xero-ruby/models/payroll_nz/leave_type_object.rb index 3a7f9015..1c367791 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_type_object.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_type_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/leave_types.rb b/lib/xero-ruby/models/payroll_nz/leave_types.rb index 06516695..eadfdd5b 100644 --- a/lib/xero-ruby/models/payroll_nz/leave_types.rb +++ b/lib/xero-ruby/models/payroll_nz/leave_types.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pagination.rb b/lib/xero-ruby/models/payroll_nz/pagination.rb index 9b3492f0..c3285c3b 100644 --- a/lib/xero-ruby/models/payroll_nz/pagination.rb +++ b/lib/xero-ruby/models/payroll_nz/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_run.rb b/lib/xero-ruby/models/payroll_nz/pay_run.rb index c242a740..9166a472 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_run.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_run.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb index c76e2315..3f5ee505 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb index 15899817..8a78c527 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb b/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb index efee2cc4..86e0c68c 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_run_object.rb b/lib/xero-ruby/models/payroll_nz/pay_run_object.rb index aa444c59..18538907 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_run_object.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_run_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_runs.rb b/lib/xero-ruby/models/payroll_nz/pay_runs.rb index 14ec9895..c962578b 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_runs.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_runs.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_slip.rb b/lib/xero-ruby/models/payroll_nz/pay_slip.rb index 0bde2d55..237f92da 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_slip.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_slip.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb b/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb index da14f202..1d604b11 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/pay_slips.rb b/lib/xero-ruby/models/payroll_nz/pay_slips.rb index 3d86faeb..a6bca3e1 100644 --- a/lib/xero-ruby/models/payroll_nz/pay_slips.rb +++ b/lib/xero-ruby/models/payroll_nz/pay_slips.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/payment_line.rb b/lib/xero-ruby/models/payroll_nz/payment_line.rb index 389ca11b..7337df60 100644 --- a/lib/xero-ruby/models/payroll_nz/payment_line.rb +++ b/lib/xero-ruby/models/payroll_nz/payment_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/payment_method.rb b/lib/xero-ruby/models/payroll_nz/payment_method.rb index 47ad6cdc..2e76e462 100644 --- a/lib/xero-ruby/models/payroll_nz/payment_method.rb +++ b/lib/xero-ruby/models/payroll_nz/payment_method.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/payment_method_object.rb b/lib/xero-ruby/models/payroll_nz/payment_method_object.rb index ece11759..5d4545fc 100644 --- a/lib/xero-ruby/models/payroll_nz/payment_method_object.rb +++ b/lib/xero-ruby/models/payroll_nz/payment_method_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/problem.rb b/lib/xero-ruby/models/payroll_nz/problem.rb index ed3ee93c..49686ea2 100644 --- a/lib/xero-ruby/models/payroll_nz/problem.rb +++ b/lib/xero-ruby/models/payroll_nz/problem.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement.rb b/lib/xero-ruby/models/payroll_nz/reimbursement.rb index 9bf5ba5a..4de754ac 100644 --- a/lib/xero-ruby/models/payroll_nz/reimbursement.rb +++ b/lib/xero-ruby/models/payroll_nz/reimbursement.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb b/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb index cbe36892..1d625ed7 100644 --- a/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb +++ b/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb b/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb index 341214d7..33f15ee0 100644 --- a/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb +++ b/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/reimbursements.rb b/lib/xero-ruby/models/payroll_nz/reimbursements.rb index 0652a603..1f9ccbde 100644 --- a/lib/xero-ruby/models/payroll_nz/reimbursements.rb +++ b/lib/xero-ruby/models/payroll_nz/reimbursements.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb index 8f87e925..248bd930 100644 --- a/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb index 961d1eed..139d0e16 100644 --- a/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb b/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb index 7d0a9695..926d53e5 100644 --- a/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/settings.rb b/lib/xero-ruby/models/payroll_nz/settings.rb index ebb8a24e..f1955f42 100644 --- a/lib/xero-ruby/models/payroll_nz/settings.rb +++ b/lib/xero-ruby/models/payroll_nz/settings.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb index 16de1af1..8b16d3bb 100644 --- a/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb index feac6f36..e37578d1 100644 --- a/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb index cbd03426..cdb1712e 100644 --- a/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb b/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb index 6b7b9f82..3d75d7e9 100644 --- a/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb +++ b/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb b/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb index efdf5d84..5baaddbd 100644 --- a/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb +++ b/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/superannuation_line.rb b/lib/xero-ruby/models/payroll_nz/superannuation_line.rb index 5c225dbe..c16eada1 100644 --- a/lib/xero-ruby/models/payroll_nz/superannuation_line.rb +++ b/lib/xero-ruby/models/payroll_nz/superannuation_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/superannuation_object.rb b/lib/xero-ruby/models/payroll_nz/superannuation_object.rb index 80354169..67fe8fdc 100644 --- a/lib/xero-ruby/models/payroll_nz/superannuation_object.rb +++ b/lib/xero-ruby/models/payroll_nz/superannuation_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/superannuations.rb b/lib/xero-ruby/models/payroll_nz/superannuations.rb index 4aecde2e..71423bbc 100644 --- a/lib/xero-ruby/models/payroll_nz/superannuations.rb +++ b/lib/xero-ruby/models/payroll_nz/superannuations.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/tax_code.rb b/lib/xero-ruby/models/payroll_nz/tax_code.rb index dc824c91..8d554aa9 100644 --- a/lib/xero-ruby/models/payroll_nz/tax_code.rb +++ b/lib/xero-ruby/models/payroll_nz/tax_code.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/tax_line.rb b/lib/xero-ruby/models/payroll_nz/tax_line.rb index bb6548e5..5f4f3e52 100644 --- a/lib/xero-ruby/models/payroll_nz/tax_line.rb +++ b/lib/xero-ruby/models/payroll_nz/tax_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/tax_settings.rb b/lib/xero-ruby/models/payroll_nz/tax_settings.rb index 13be5ba9..c106a4b5 100644 --- a/lib/xero-ruby/models/payroll_nz/tax_settings.rb +++ b/lib/xero-ruby/models/payroll_nz/tax_settings.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheet.rb b/lib/xero-ruby/models/payroll_nz/timesheet.rb index 035dd1c9..2d6e65aa 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheet.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheet.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb b/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb index 6a1a9201..65987254 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_line.rb b/lib/xero-ruby/models/payroll_nz/timesheet_line.rb index a1e0f57b..3fe67273 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheet_line.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheet_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb b/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb index 157ede58..47ddcdef 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheet_object.rb b/lib/xero-ruby/models/payroll_nz/timesheet_object.rb index c443c060..934231bd 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheet_object.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheet_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/timesheets.rb b/lib/xero-ruby/models/payroll_nz/timesheets.rb index 85573b36..e69346d5 100644 --- a/lib/xero-ruby/models/payroll_nz/timesheets.rb +++ b/lib/xero-ruby/models/payroll_nz/timesheets.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/tracking_categories.rb b/lib/xero-ruby/models/payroll_nz/tracking_categories.rb index 4339dfd4..0e7336b6 100644 --- a/lib/xero-ruby/models/payroll_nz/tracking_categories.rb +++ b/lib/xero-ruby/models/payroll_nz/tracking_categories.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_nz/tracking_category.rb b/lib/xero-ruby/models/payroll_nz/tracking_category.rb index 53d3ce3a..b1bc3f33 100644 --- a/lib/xero-ruby/models/payroll_nz/tracking_category.rb +++ b/lib/xero-ruby/models/payroll_nz/tracking_category.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the NZ region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/account.rb b/lib/xero-ruby/models/payroll_uk/account.rb index ed3d6dd7..af9c7fb8 100644 --- a/lib/xero-ruby/models/payroll_uk/account.rb +++ b/lib/xero-ruby/models/payroll_uk/account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/accounts.rb b/lib/xero-ruby/models/payroll_uk/accounts.rb index 0206e216..101046f3 100644 --- a/lib/xero-ruby/models/payroll_uk/accounts.rb +++ b/lib/xero-ruby/models/payroll_uk/accounts.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/address.rb b/lib/xero-ruby/models/payroll_uk/address.rb index fc3adc11..d094f3d6 100644 --- a/lib/xero-ruby/models/payroll_uk/address.rb +++ b/lib/xero-ruby/models/payroll_uk/address.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/bank_account.rb b/lib/xero-ruby/models/payroll_uk/bank_account.rb index 5df99041..380f216f 100644 --- a/lib/xero-ruby/models/payroll_uk/bank_account.rb +++ b/lib/xero-ruby/models/payroll_uk/bank_account.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/benefit.rb b/lib/xero-ruby/models/payroll_uk/benefit.rb index 639f4474..d7ed4882 100644 --- a/lib/xero-ruby/models/payroll_uk/benefit.rb +++ b/lib/xero-ruby/models/payroll_uk/benefit.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/benefit_line.rb b/lib/xero-ruby/models/payroll_uk/benefit_line.rb index 53584e82..51f3788f 100644 --- a/lib/xero-ruby/models/payroll_uk/benefit_line.rb +++ b/lib/xero-ruby/models/payroll_uk/benefit_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/benefit_object.rb b/lib/xero-ruby/models/payroll_uk/benefit_object.rb index b74e341b..fb9b4284 100644 --- a/lib/xero-ruby/models/payroll_uk/benefit_object.rb +++ b/lib/xero-ruby/models/payroll_uk/benefit_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/benefits.rb b/lib/xero-ruby/models/payroll_uk/benefits.rb index d3d1603a..74a0c7fd 100644 --- a/lib/xero-ruby/models/payroll_uk/benefits.rb +++ b/lib/xero-ruby/models/payroll_uk/benefits.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/court_order_line.rb b/lib/xero-ruby/models/payroll_uk/court_order_line.rb index b829f9bd..37d90f2b 100644 --- a/lib/xero-ruby/models/payroll_uk/court_order_line.rb +++ b/lib/xero-ruby/models/payroll_uk/court_order_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/deduction.rb b/lib/xero-ruby/models/payroll_uk/deduction.rb index b6f2aed2..0464723c 100644 --- a/lib/xero-ruby/models/payroll_uk/deduction.rb +++ b/lib/xero-ruby/models/payroll_uk/deduction.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/deduction_line.rb b/lib/xero-ruby/models/payroll_uk/deduction_line.rb index 7f6891f5..b811a363 100644 --- a/lib/xero-ruby/models/payroll_uk/deduction_line.rb +++ b/lib/xero-ruby/models/payroll_uk/deduction_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/deduction_object.rb b/lib/xero-ruby/models/payroll_uk/deduction_object.rb index 15a7e1f6..5f585811 100644 --- a/lib/xero-ruby/models/payroll_uk/deduction_object.rb +++ b/lib/xero-ruby/models/payroll_uk/deduction_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/deductions.rb b/lib/xero-ruby/models/payroll_uk/deductions.rb index 6ac9c0b1..d2de1688 100644 --- a/lib/xero-ruby/models/payroll_uk/deductions.rb +++ b/lib/xero-ruby/models/payroll_uk/deductions.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_line.rb b/lib/xero-ruby/models/payroll_uk/earnings_line.rb index 69c22bc5..52e18b19 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_line.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_order.rb b/lib/xero-ruby/models/payroll_uk/earnings_order.rb index 4503a73a..1a5b3d00 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_order.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_order.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb index a6e38e23..6c50cf43 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_orders.rb b/lib/xero-ruby/models/payroll_uk/earnings_orders.rb index ab4f138e..6054c890 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_orders.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_orders.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rate.rb b/lib/xero-ruby/models/payroll_uk/earnings_rate.rb index 7f4b1e40..29798acf 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_rate.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb index 5dde290e..4fb47ccf 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_rates.rb b/lib/xero-ruby/models/payroll_uk/earnings_rates.rb index 269edc1f..ae3720dd 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_rates.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_rates.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_template.rb b/lib/xero-ruby/models/payroll_uk/earnings_template.rb index d7b87c12..ffa5eb93 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_template.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_template.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb b/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb index f9fd8323..90797a9f 100644 --- a/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb +++ b/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee.rb b/lib/xero-ruby/models/payroll_uk/employee.rb index 9dc67dbf..81b5823a 100644 --- a/lib/xero-ruby/models/payroll_uk/employee.rb +++ b/lib/xero-ruby/models/payroll_uk/employee.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave.rb b/lib/xero-ruby/models/payroll_uk/employee_leave.rb index 8ea6e481..a99cc4ec 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb index b19edd3c..d3853b12 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb index df3fb4ef..c962b051 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb index 71987cda..98c646e9 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb index fec7e88c..4234fd6f 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb index 3833cded..aaaf6ae5 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb b/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb index f043dcfe..55820fca 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_leaves.rb b/lib/xero-ruby/models/payroll_uk/employee_leaves.rb index 0ed699f3..d3f154fe 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_leaves.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_leaves.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_object.rb b/lib/xero-ruby/models/payroll_uk/employee_object.rb index 59be2d1e..1cab1633 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb b/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb index a92e5918..21b7bc95 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb b/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb index 9b0c4212..c85bb60b 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb index 2cf164a7..d3ed900c 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb index 4c38be1c..03b04b4c 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb b/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb index 3873b83d..bff96b7d 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb index 7c4a6500..663c29c8 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb index c3f2200d..bfaaac54 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb index 8606d8bf..5b056cac 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb index 50ea0aa0..35b0be5c 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb index 86bb0f53..6006b816 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb index 0c262834..c7fadfd6 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb index 3fed3ac9..eaf9de09 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_tax.rb b/lib/xero-ruby/models/payroll_uk/employee_tax.rb index df8b524b..f33cec6b 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_tax.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_tax.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb b/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb index 1d079c10..d910d90c 100644 --- a/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employees.rb b/lib/xero-ruby/models/payroll_uk/employees.rb index 2c3613e0..a8082dda 100644 --- a/lib/xero-ruby/models/payroll_uk/employees.rb +++ b/lib/xero-ruby/models/payroll_uk/employees.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employment.rb b/lib/xero-ruby/models/payroll_uk/employment.rb index 1ba98062..e83ce1c0 100644 --- a/lib/xero-ruby/models/payroll_uk/employment.rb +++ b/lib/xero-ruby/models/payroll_uk/employment.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/employment_object.rb b/lib/xero-ruby/models/payroll_uk/employment_object.rb index a3e69d88..30c32173 100644 --- a/lib/xero-ruby/models/payroll_uk/employment_object.rb +++ b/lib/xero-ruby/models/payroll_uk/employment_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/invalid_field.rb b/lib/xero-ruby/models/payroll_uk/invalid_field.rb index 671facdb..a4736616 100644 --- a/lib/xero-ruby/models/payroll_uk/invalid_field.rb +++ b/lib/xero-ruby/models/payroll_uk/invalid_field.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb b/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb index 6f46913c..4b7d49d6 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb b/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb index f17502f9..3753bce3 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_period.rb b/lib/xero-ruby/models/payroll_uk/leave_period.rb index 05b64490..f94dec57 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_period.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_period.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_periods.rb b/lib/xero-ruby/models/payroll_uk/leave_periods.rb index 4451302c..42864697 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_periods.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_periods.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_type.rb b/lib/xero-ruby/models/payroll_uk/leave_type.rb index 93516725..b7c099bd 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_type.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_type.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_type_object.rb b/lib/xero-ruby/models/payroll_uk/leave_type_object.rb index 6fa610a6..dd3882f2 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_type_object.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_type_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/leave_types.rb b/lib/xero-ruby/models/payroll_uk/leave_types.rb index debe4965..a4ba3f13 100644 --- a/lib/xero-ruby/models/payroll_uk/leave_types.rb +++ b/lib/xero-ruby/models/payroll_uk/leave_types.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pagination.rb b/lib/xero-ruby/models/payroll_uk/pagination.rb index 21d10b27..48984350 100644 --- a/lib/xero-ruby/models/payroll_uk/pagination.rb +++ b/lib/xero-ruby/models/payroll_uk/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_run.rb b/lib/xero-ruby/models/payroll_uk/pay_run.rb index f15eece3..188ee351 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_run.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_run.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb index 1bf529e7..ab460193 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb index e293a700..000dd256 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb b/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb index 5d4e4226..9376ed0c 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_run_object.rb b/lib/xero-ruby/models/payroll_uk/pay_run_object.rb index a77619a4..690846c9 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_run_object.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_run_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/pay_runs.rb b/lib/xero-ruby/models/payroll_uk/pay_runs.rb index ecd7936c..5075c97d 100644 --- a/lib/xero-ruby/models/payroll_uk/pay_runs.rb +++ b/lib/xero-ruby/models/payroll_uk/pay_runs.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payment_line.rb b/lib/xero-ruby/models/payroll_uk/payment_line.rb index 1b394d29..3a4c55f8 100644 --- a/lib/xero-ruby/models/payroll_uk/payment_line.rb +++ b/lib/xero-ruby/models/payroll_uk/payment_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payment_method.rb b/lib/xero-ruby/models/payroll_uk/payment_method.rb index eb74888b..61e9d2d5 100644 --- a/lib/xero-ruby/models/payroll_uk/payment_method.rb +++ b/lib/xero-ruby/models/payroll_uk/payment_method.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payment_method_object.rb b/lib/xero-ruby/models/payroll_uk/payment_method_object.rb index 7568ee12..5f248fd7 100644 --- a/lib/xero-ruby/models/payroll_uk/payment_method_object.rb +++ b/lib/xero-ruby/models/payroll_uk/payment_method_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payslip.rb b/lib/xero-ruby/models/payroll_uk/payslip.rb index 67dcc9ad..ae660bd0 100644 --- a/lib/xero-ruby/models/payroll_uk/payslip.rb +++ b/lib/xero-ruby/models/payroll_uk/payslip.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payslip_object.rb b/lib/xero-ruby/models/payroll_uk/payslip_object.rb index 2e5e4c46..31fae2ed 100644 --- a/lib/xero-ruby/models/payroll_uk/payslip_object.rb +++ b/lib/xero-ruby/models/payroll_uk/payslip_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/payslips.rb b/lib/xero-ruby/models/payroll_uk/payslips.rb index a8bc76e8..72a758f8 100644 --- a/lib/xero-ruby/models/payroll_uk/payslips.rb +++ b/lib/xero-ruby/models/payroll_uk/payslips.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/problem.rb b/lib/xero-ruby/models/payroll_uk/problem.rb index ea889697..6822c619 100644 --- a/lib/xero-ruby/models/payroll_uk/problem.rb +++ b/lib/xero-ruby/models/payroll_uk/problem.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement.rb b/lib/xero-ruby/models/payroll_uk/reimbursement.rb index 5465a76f..a9881c10 100644 --- a/lib/xero-ruby/models/payroll_uk/reimbursement.rb +++ b/lib/xero-ruby/models/payroll_uk/reimbursement.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb b/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb index 4bfc93f2..d0948efe 100644 --- a/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb +++ b/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb b/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb index 5441620f..5ecbd64e 100644 --- a/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb +++ b/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/reimbursements.rb b/lib/xero-ruby/models/payroll_uk/reimbursements.rb index 6556f186..71c0fdf5 100644 --- a/lib/xero-ruby/models/payroll_uk/reimbursements.rb +++ b/lib/xero-ruby/models/payroll_uk/reimbursements.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb index 54e62a9a..ecb31411 100644 --- a/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb index a6ebe8e2..7b11ee65 100644 --- a/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb b/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb index 5e5741b5..1feb1278 100644 --- a/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb +++ b/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/settings.rb b/lib/xero-ruby/models/payroll_uk/settings.rb index 652bf3c7..5cb9abe5 100644 --- a/lib/xero-ruby/models/payroll_uk/settings.rb +++ b/lib/xero-ruby/models/payroll_uk/settings.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb b/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb index 800133b1..2c638700 100644 --- a/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb +++ b/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb b/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb index 94361ec1..9ba65726 100644 --- a/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb +++ b/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/tax_line.rb b/lib/xero-ruby/models/payroll_uk/tax_line.rb index 7b040884..85e35cb9 100644 --- a/lib/xero-ruby/models/payroll_uk/tax_line.rb +++ b/lib/xero-ruby/models/payroll_uk/tax_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheet.rb b/lib/xero-ruby/models/payroll_uk/timesheet.rb index a0e2b57b..5dbf1047 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheet.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheet.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb b/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb index 69b7dd65..d8f0e08d 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_line.rb b/lib/xero-ruby/models/payroll_uk/timesheet_line.rb index b0226057..ca833bfe 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheet_line.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheet_line.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb b/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb index 671f515c..a6d6245a 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheet_object.rb b/lib/xero-ruby/models/payroll_uk/timesheet_object.rb index 74349b08..852a1a5a 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheet_object.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheet_object.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/timesheets.rb b/lib/xero-ruby/models/payroll_uk/timesheets.rb index 0ecaf13a..20276bf9 100644 --- a/lib/xero-ruby/models/payroll_uk/timesheets.rb +++ b/lib/xero-ruby/models/payroll_uk/timesheets.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/tracking_categories.rb b/lib/xero-ruby/models/payroll_uk/tracking_categories.rb index d6079870..999653b7 100644 --- a/lib/xero-ruby/models/payroll_uk/tracking_categories.rb +++ b/lib/xero-ruby/models/payroll_uk/tracking_categories.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/payroll_uk/tracking_category.rb b/lib/xero-ruby/models/payroll_uk/tracking_category.rb index c143fe92..fbc6aebb 100644 --- a/lib/xero-ruby/models/payroll_uk/tracking_category.rb +++ b/lib/xero-ruby/models/payroll_uk/tracking_category.rb @@ -3,7 +3,7 @@ #This is the Xero Payroll API for orgs in the UK region. -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/amount.rb b/lib/xero-ruby/models/projects/amount.rb index fa6984ab..13bdab4f 100644 --- a/lib/xero-ruby/models/projects/amount.rb +++ b/lib/xero-ruby/models/projects/amount.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/charge_type.rb b/lib/xero-ruby/models/projects/charge_type.rb index fa4df5da..f88c70ee 100644 --- a/lib/xero-ruby/models/projects/charge_type.rb +++ b/lib/xero-ruby/models/projects/charge_type.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/currency_code.rb b/lib/xero-ruby/models/projects/currency_code.rb index d80b44c3..4fe4d1b0 100644 --- a/lib/xero-ruby/models/projects/currency_code.rb +++ b/lib/xero-ruby/models/projects/currency_code.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/error.rb b/lib/xero-ruby/models/projects/error.rb index 986ae7b5..71e0d411 100644 --- a/lib/xero-ruby/models/projects/error.rb +++ b/lib/xero-ruby/models/projects/error.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/pagination.rb b/lib/xero-ruby/models/projects/pagination.rb index 619c839f..7e21248b 100644 --- a/lib/xero-ruby/models/projects/pagination.rb +++ b/lib/xero-ruby/models/projects/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project.rb b/lib/xero-ruby/models/projects/project.rb index 529994b2..f7b2bea2 100644 --- a/lib/xero-ruby/models/projects/project.rb +++ b/lib/xero-ruby/models/projects/project.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_create_or_update.rb b/lib/xero-ruby/models/projects/project_create_or_update.rb index a873b80f..03fe7bc6 100644 --- a/lib/xero-ruby/models/projects/project_create_or_update.rb +++ b/lib/xero-ruby/models/projects/project_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_patch.rb b/lib/xero-ruby/models/projects/project_patch.rb index ee6cc671..99c52423 100644 --- a/lib/xero-ruby/models/projects/project_patch.rb +++ b/lib/xero-ruby/models/projects/project_patch.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_status.rb b/lib/xero-ruby/models/projects/project_status.rb index f5841dcb..6677ac3f 100644 --- a/lib/xero-ruby/models/projects/project_status.rb +++ b/lib/xero-ruby/models/projects/project_status.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_user.rb b/lib/xero-ruby/models/projects/project_user.rb index 75a36aa0..34b105d4 100644 --- a/lib/xero-ruby/models/projects/project_user.rb +++ b/lib/xero-ruby/models/projects/project_user.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_users.rb b/lib/xero-ruby/models/projects/project_users.rb index 010f41c6..1f3c3aec 100644 --- a/lib/xero-ruby/models/projects/project_users.rb +++ b/lib/xero-ruby/models/projects/project_users.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/projects.rb b/lib/xero-ruby/models/projects/projects.rb index f8046314..d7216991 100644 --- a/lib/xero-ruby/models/projects/projects.rb +++ b/lib/xero-ruby/models/projects/projects.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task.rb b/lib/xero-ruby/models/projects/task.rb index f14880da..47b1d55c 100644 --- a/lib/xero-ruby/models/projects/task.rb +++ b/lib/xero-ruby/models/projects/task.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task_create_or_update.rb b/lib/xero-ruby/models/projects/task_create_or_update.rb index 495fa2b6..014dfe9c 100644 --- a/lib/xero-ruby/models/projects/task_create_or_update.rb +++ b/lib/xero-ruby/models/projects/task_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/tasks.rb b/lib/xero-ruby/models/projects/tasks.rb index 9411d9db..c9262ef2 100644 --- a/lib/xero-ruby/models/projects/tasks.rb +++ b/lib/xero-ruby/models/projects/tasks.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entries.rb b/lib/xero-ruby/models/projects/time_entries.rb index b8b18acd..5f705c00 100644 --- a/lib/xero-ruby/models/projects/time_entries.rb +++ b/lib/xero-ruby/models/projects/time_entries.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry.rb b/lib/xero-ruby/models/projects/time_entry.rb index da17cc51..071b1bf0 100644 --- a/lib/xero-ruby/models/projects/time_entry.rb +++ b/lib/xero-ruby/models/projects/time_entry.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb index 0bd72b49..50ce233c 100644 --- a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +++ b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index fa9f002b..283ac267 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -3,7 +3,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/xero-ruby.gemspec b/xero-ruby.gemspec index bc23f9fe..2a37a622 100644 --- a/xero-ruby.gemspec +++ b/xero-ruby.gemspec @@ -5,7 +5,7 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.3.7 +The version of the OpenAPI document: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 From 6523992464ceba903019ad2f5e750bfbc2d9b7b0 Mon Sep 17 00:00:00 2001 From: serknight Date: Mon, 2 Nov 2020 14:48:07 -0700 Subject: [PATCH 4/5] regen and pass string of API set --- lib/xero-ruby/api/accounting_api.rb | 446 +++++++++++----------- lib/xero-ruby/api/asset_api.rb | 12 +- lib/xero-ruby/api/files_api.rb | 35 +- lib/xero-ruby/api/payroll_au_api.rb | 58 +-- lib/xero-ruby/api/payroll_nz_api.rb | 136 +++---- lib/xero-ruby/api/payroll_uk_api.rb | 140 +++---- lib/xero-ruby/api/project_api.rb | 26 +- lib/xero-ruby/api_client.rb | 53 +-- lib/xero-ruby/models/files/object_type.rb | 1 + 9 files changed, 447 insertions(+), 460 deletions(-) diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 0d1e407e..f7bd49b1 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -88,7 +88,7 @@ def create_account_with_http_info(xero_tenant_id, account, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -176,7 +176,7 @@ def create_account_attachment_by_file_name_with_http_info(xero_tenant_id, accoun :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -264,7 +264,7 @@ def create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -346,7 +346,7 @@ def create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_t :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -428,7 +428,7 @@ def create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -504,7 +504,7 @@ def create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -590,7 +590,7 @@ def create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -670,7 +670,7 @@ def create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_tran :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -749,7 +749,7 @@ def create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -831,7 +831,7 @@ def create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_pay :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -913,7 +913,7 @@ def create_branding_theme_payment_services_with_http_info(xero_tenant_id, brandi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -999,7 +999,7 @@ def create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contac :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1075,7 +1075,7 @@ def create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1157,7 +1157,7 @@ def create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1239,7 +1239,7 @@ def create_contact_history_with_http_info(xero_tenant_id, contact_id, history_re :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1318,7 +1318,7 @@ def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1403,7 +1403,7 @@ def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_allocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1494,7 +1494,7 @@ def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, cr :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1576,7 +1576,7 @@ def create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, hi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1658,7 +1658,7 @@ def create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1732,7 +1732,7 @@ def create_currency_with_http_info(xero_tenant_id, currency, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1811,7 +1811,7 @@ def create_employees_with_http_info(xero_tenant_id, employees, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1893,7 +1893,7 @@ def create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1969,7 +1969,7 @@ def create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2060,7 +2060,7 @@ def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoic :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2142,7 +2142,7 @@ def create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_re :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2224,7 +2224,7 @@ def create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2306,7 +2306,7 @@ def create_item_history_with_http_info(xero_tenant_id, item_id, history_records, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2388,7 +2388,7 @@ def create_items_with_http_info(xero_tenant_id, items, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2464,7 +2464,7 @@ def create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2552,7 +2552,7 @@ def create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2634,7 +2634,7 @@ def create_manual_journal_history_record_with_http_info(xero_tenant_id, manual_j :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_manual_journal_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2713,7 +2713,7 @@ def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2798,7 +2798,7 @@ def create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2880,7 +2880,7 @@ def create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, hi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2956,7 +2956,7 @@ def create_payment_with_http_info(xero_tenant_id, payment, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3038,7 +3038,7 @@ def create_payment_history_with_http_info(xero_tenant_id, payment_id, history_re :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3114,7 +3114,7 @@ def create_payment_service_with_http_info(xero_tenant_id, payment_services, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_payment_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3193,7 +3193,7 @@ def create_payments_with_http_info(xero_tenant_id, payments, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3278,7 +3278,7 @@ def create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3360,7 +3360,7 @@ def create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, hist :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3448,7 +3448,7 @@ def create_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3530,7 +3530,7 @@ def create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3609,7 +3609,7 @@ def create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3697,7 +3697,7 @@ def create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3779,7 +3779,7 @@ def create_quote_history_with_http_info(xero_tenant_id, quote_id, history_record :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3858,7 +3858,7 @@ def create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3937,7 +3937,7 @@ def create_receipt_with_http_info(xero_tenant_id, receipts, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4025,7 +4025,7 @@ def create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receip :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4107,7 +4107,7 @@ def create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_re :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4195,7 +4195,7 @@ def create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4277,7 +4277,7 @@ def create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_in :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4353,7 +4353,7 @@ def create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4429,7 +4429,7 @@ def create_tracking_category_with_http_info(xero_tenant_id, tracking_category, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4511,7 +4511,7 @@ def create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#create_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4585,7 +4585,7 @@ def delete_account_with_http_info(xero_tenant_id, account_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4665,7 +4665,7 @@ def delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4737,7 +4737,7 @@ def delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4811,7 +4811,7 @@ def delete_item_with_http_info(xero_tenant_id, item_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4885,7 +4885,7 @@ def delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4967,7 +4967,7 @@ def delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5041,7 +5041,7 @@ def delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5121,7 +5121,7 @@ def delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5203,7 +5203,7 @@ def email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#email_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5277,7 +5277,7 @@ def get_account_with_http_info(xero_tenant_id, account_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5364,7 +5364,7 @@ def get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5451,7 +5451,7 @@ def get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, atta :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5525,7 +5525,7 @@ def get_account_attachments_with_http_info(xero_tenant_id, account_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_account_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5602,7 +5602,7 @@ def get_accounts_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5679,7 +5679,7 @@ def get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5766,7 +5766,7 @@ def get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5853,7 +5853,7 @@ def get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_tr :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5927,7 +5927,7 @@ def get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transac :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6010,7 +6010,7 @@ def get_bank_transactions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6084,7 +6084,7 @@ def get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transactio :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6158,7 +6158,7 @@ def get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6245,7 +6245,7 @@ def get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, ban :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6332,7 +6332,7 @@ def get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_trans :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6406,7 +6406,7 @@ def get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6480,7 +6480,7 @@ def get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6557,7 +6557,7 @@ def get_bank_transfers_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6631,7 +6631,7 @@ def get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_batch_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6708,7 +6708,7 @@ def get_batch_payments_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_batch_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6782,7 +6782,7 @@ def get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6856,7 +6856,7 @@ def get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6924,7 +6924,7 @@ def get_branding_themes_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_branding_themes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -6998,7 +6998,7 @@ def get_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7085,7 +7085,7 @@ def get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7172,7 +7172,7 @@ def get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, atta :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7246,7 +7246,7 @@ def get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7320,7 +7320,7 @@ def get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_by_contact_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7394,7 +7394,7 @@ def get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7468,7 +7468,7 @@ def get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7542,7 +7542,7 @@ def get_contact_groups_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7616,7 +7616,7 @@ def get_contact_history_with_http_info(xero_tenant_id, contact_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7702,7 +7702,7 @@ def get_contacts_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7779,7 +7779,7 @@ def get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7853,7 +7853,7 @@ def get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -7940,7 +7940,7 @@ def get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8027,7 +8027,7 @@ def get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8101,7 +8101,7 @@ def get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8175,7 +8175,7 @@ def get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8258,7 +8258,7 @@ def get_credit_notes_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8332,7 +8332,7 @@ def get_currencies_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8406,7 +8406,7 @@ def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8483,7 +8483,7 @@ def get_employees_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8557,7 +8557,7 @@ def get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8631,7 +8631,7 @@ def get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8708,7 +8708,7 @@ def get_expense_claims_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8785,7 +8785,7 @@ def get_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8859,7 +8859,7 @@ def get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -8946,7 +8946,7 @@ def get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9033,7 +9033,7 @@ def get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, atta :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9107,7 +9107,7 @@ def get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9181,7 +9181,7 @@ def get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9249,7 +9249,7 @@ def get_invoice_reminders_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoice_reminders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9350,7 +9350,7 @@ def get_invoices_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9427,7 +9427,7 @@ def get_item_with_http_info(xero_tenant_id, item_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9501,7 +9501,7 @@ def get_item_history_with_http_info(xero_tenant_id, item_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9581,7 +9581,7 @@ def get_items_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9655,7 +9655,7 @@ def get_journal_with_http_info(xero_tenant_id, journal_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9732,7 +9732,7 @@ def get_journals_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9806,7 +9806,7 @@ def get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9892,7 +9892,7 @@ def get_linked_transactions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_linked_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -9966,7 +9966,7 @@ def get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10053,7 +10053,7 @@ def get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, ma :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10140,7 +10140,7 @@ def get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_jo :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10214,7 +10214,7 @@ def get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10294,7 +10294,7 @@ def get_manual_journals_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10368,7 +10368,7 @@ def get_manual_journals_history_with_http_info(xero_tenant_id, manual_journal_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_manual_journals_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10442,7 +10442,7 @@ def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_online_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10510,7 +10510,7 @@ def get_organisation_actions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_organisation_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10584,7 +10584,7 @@ def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_organisation_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10652,7 +10652,7 @@ def get_organisations_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_organisations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10726,7 +10726,7 @@ def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_overpayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10800,7 +10800,7 @@ def get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10883,7 +10883,7 @@ def get_overpayments_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_overpayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -10957,7 +10957,7 @@ def get_payment_with_http_info(xero_tenant_id, payment_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11031,7 +11031,7 @@ def get_payment_history_with_http_info(xero_tenant_id, payment_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11099,7 +11099,7 @@ def get_payment_services_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11179,7 +11179,7 @@ def get_payments_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11253,7 +11253,7 @@ def get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_prepayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11327,7 +11327,7 @@ def get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11410,7 +11410,7 @@ def get_prepayments_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_prepayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11484,7 +11484,7 @@ def get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11558,7 +11558,7 @@ def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11645,7 +11645,7 @@ def get_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, pu :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11732,7 +11732,7 @@ def get_purchase_order_attachment_by_id_with_http_info(xero_tenant_id, purchase_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11806,7 +11806,7 @@ def get_purchase_order_attachments_with_http_info(xero_tenant_id, purchase_order :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11880,7 +11880,7 @@ def get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_n :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_by_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -11954,7 +11954,7 @@ def get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12044,7 +12044,7 @@ def get_purchase_orders_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12118,7 +12118,7 @@ def get_quote_with_http_info(xero_tenant_id, quote_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12192,7 +12192,7 @@ def get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12279,7 +12279,7 @@ def get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, f :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12366,7 +12366,7 @@ def get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachme :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12440,7 +12440,7 @@ def get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12514,7 +12514,7 @@ def get_quote_history_with_http_info(xero_tenant_id, quote_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12612,7 +12612,7 @@ def get_quotes_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12689,7 +12689,7 @@ def get_receipt_with_http_info(xero_tenant_id, receipt_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12776,7 +12776,7 @@ def get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12863,7 +12863,7 @@ def get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, atta :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -12937,7 +12937,7 @@ def get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13011,7 +13011,7 @@ def get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13091,7 +13091,7 @@ def get_receipts_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13165,7 +13165,7 @@ def get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13252,7 +13252,7 @@ def get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13339,7 +13339,7 @@ def get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeat :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13413,7 +13413,7 @@ def get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13487,7 +13487,7 @@ def get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13561,7 +13561,7 @@ def get_repeating_invoices_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13645,7 +13645,7 @@ def get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_payables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13729,7 +13729,7 @@ def get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contac :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_receivables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13803,7 +13803,7 @@ def get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13871,7 +13871,7 @@ def get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -13964,7 +13964,7 @@ def get_report_balance_sheet_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_balance_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14038,7 +14038,7 @@ def get_report_bank_summary_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_bank_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14115,7 +14115,7 @@ def get_report_budget_summary_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_budget_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14186,7 +14186,7 @@ def get_report_executive_summary_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_executive_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14288,7 +14288,7 @@ def get_report_profit_and_loss_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_profit_and_loss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14359,7 +14359,7 @@ def get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_ten_ninety_nine\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14433,7 +14433,7 @@ def get_report_trial_balance_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_report_trial_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14510,7 +14510,7 @@ def get_tax_rates_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14587,7 +14587,7 @@ def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14661,7 +14661,7 @@ def get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14735,7 +14735,7 @@ def get_user_with_http_info(xero_tenant_id, user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14812,7 +14812,7 @@ def get_users_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14894,7 +14894,7 @@ def update_account_with_http_info(xero_tenant_id, account_id, accounts, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -14982,7 +14982,7 @@ def update_account_attachment_by_file_name_with_http_info(xero_tenant_id, accoun :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15067,7 +15067,7 @@ def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15155,7 +15155,7 @@ def update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_i :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15241,7 +15241,7 @@ def update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15321,7 +15321,7 @@ def update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15407,7 +15407,7 @@ def update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contac :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15489,7 +15489,7 @@ def update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contac :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15574,7 +15574,7 @@ def update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_not :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15662,7 +15662,7 @@ def update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, cr :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15744,7 +15744,7 @@ def update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expens :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15829,7 +15829,7 @@ def update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -15917,7 +15917,7 @@ def update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoic :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16002,7 +16002,7 @@ def update_item_with_http_info(xero_tenant_id, item_id, items, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16084,7 +16084,7 @@ def update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16166,7 +16166,7 @@ def update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manu :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16254,7 +16254,7 @@ def update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16336,7 +16336,7 @@ def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_trans :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16415,7 +16415,7 @@ def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16497,7 +16497,7 @@ def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16576,7 +16576,7 @@ def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16658,7 +16658,7 @@ def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16740,7 +16740,7 @@ def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16819,7 +16819,7 @@ def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16898,7 +16898,7 @@ def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_ord :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -16977,7 +16977,7 @@ def update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_or_create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17059,7 +17059,7 @@ def update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purc :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17147,7 +17147,7 @@ def update_purchase_order_attachment_by_file_name_with_http_info(xero_tenant_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_purchase_order_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17229,7 +17229,7 @@ def update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17317,7 +17317,7 @@ def update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17402,7 +17402,7 @@ def update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts = { :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17490,7 +17490,7 @@ def update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receip :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17578,7 +17578,7 @@ def update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17654,7 +17654,7 @@ def update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_tax_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17736,7 +17736,7 @@ def update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -17824,7 +17824,7 @@ def update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AccountingApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#update_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index f7b4fc3b..be796277 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -90,7 +90,7 @@ def create_asset_with_http_info(xero_tenant_id, asset, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -164,7 +164,7 @@ def create_asset_type_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -240,7 +240,7 @@ def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -310,7 +310,7 @@ def get_asset_settings_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -380,7 +380,7 @@ def get_asset_types_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -484,7 +484,7 @@ def get_assets_with_http_info(xero_tenant_id, status, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AssetApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/files_api.rb b/lib/xero-ruby/api/files_api.rb index 252309d1..b9cf08f2 100644 --- a/lib/xero-ruby/api/files_api.rb +++ b/lib/xero-ruby/api/files_api.rb @@ -92,7 +92,7 @@ def create_file_association_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#create_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -166,7 +166,7 @@ def create_folder_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -242,7 +242,7 @@ def delete_file_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -324,7 +324,7 @@ def delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#delete_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -400,7 +400,7 @@ def delete_folder_with_http_info(xero_tenant_id, folder_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -476,7 +476,7 @@ def get_associations_by_object_with_http_info(xero_tenant_id, object_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_associations_by_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -550,7 +550,7 @@ def get_file_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -626,7 +626,7 @@ def get_file_associations_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_file_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -702,7 +702,7 @@ def get_file_content_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_file_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -791,7 +791,7 @@ def get_files_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -867,7 +867,7 @@ def get_folder_with_http_info(xero_tenant_id, folder_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -944,7 +944,7 @@ def get_folders_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1014,7 +1014,7 @@ def get_inbox_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#get_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1094,7 +1094,7 @@ def update_file_with_http_info(xero_tenant_id, file_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#update_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1178,7 +1178,7 @@ def update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "FilesApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1263,7 +1263,10 @@ def upload_file_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + puts "new_options: #{new_options}" + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FilesApi", new_options) + if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/payroll_au_api.rb b/lib/xero-ruby/api/payroll_au_api.rb index 8f59859c..4a9e5f46 100644 --- a/lib/xero-ruby/api/payroll_au_api.rb +++ b/lib/xero-ruby/api/payroll_au_api.rb @@ -88,7 +88,7 @@ def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -164,7 +164,7 @@ def create_leave_application_with_http_info(xero_tenant_id, leave_application, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -240,7 +240,7 @@ def create_pay_item_with_http_info(xero_tenant_id, pay_item, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_pay_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -316,7 +316,7 @@ def create_pay_run_with_http_info(xero_tenant_id, pay_run, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -392,7 +392,7 @@ def create_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_payroll_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -468,7 +468,7 @@ def create_superfund_with_http_info(xero_tenant_id, super_fund, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -544,7 +544,7 @@ def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -618,7 +618,7 @@ def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -698,7 +698,7 @@ def get_employees_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -772,7 +772,7 @@ def get_leave_application_with_http_info(xero_tenant_id, leave_application_id, o :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -852,7 +852,7 @@ def get_leave_applications_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_leave_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -932,7 +932,7 @@ def get_pay_items_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1006,7 +1006,7 @@ def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1086,7 +1086,7 @@ def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1160,7 +1160,7 @@ def get_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_payroll_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1240,7 +1240,7 @@ def get_payroll_calendars_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_payroll_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1314,7 +1314,7 @@ def get_payslip_with_http_info(xero_tenant_id, payslip_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_payslip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1382,7 +1382,7 @@ def get_settings_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1456,7 +1456,7 @@ def get_superfund_with_http_info(xero_tenant_id, super_fund_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1530,7 +1530,7 @@ def get_superfund_products_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_superfund_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1610,7 +1610,7 @@ def get_superfunds_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_superfunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1684,7 +1684,7 @@ def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1764,7 +1764,7 @@ def get_timesheets_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1844,7 +1844,7 @@ def update_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1926,7 +1926,7 @@ def update_leave_application_with_http_info(xero_tenant_id, leave_application_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_leave_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2006,7 +2006,7 @@ def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2086,7 +2086,7 @@ def update_payslip_with_http_info(xero_tenant_id, payslip_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_payslip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2166,7 +2166,7 @@ def update_superfund_with_http_info(xero_tenant_id, super_fund_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_superfund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2246,7 +2246,7 @@ def update_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollAuApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollAuApi#update_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/payroll_nz_api.rb b/lib/xero-ruby/api/payroll_nz_api.rb index 36964e9f..a60f8c2d 100644 --- a/lib/xero-ruby/api/payroll_nz_api.rb +++ b/lib/xero-ruby/api/payroll_nz_api.rb @@ -86,7 +86,7 @@ def approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#approve_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -162,7 +162,7 @@ def create_deduction_with_http_info(xero_tenant_id, deduction, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -238,7 +238,7 @@ def create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -314,7 +314,7 @@ def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -396,7 +396,7 @@ def create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -478,7 +478,7 @@ def create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_l :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -560,7 +560,7 @@ def create_employee_leave_setup_with_http_info(xero_tenant_id, employee_id, empl :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave_setup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -642,7 +642,7 @@ def create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, emplo :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -724,7 +724,7 @@ def create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -806,7 +806,7 @@ def create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, p :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -888,7 +888,7 @@ def create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -970,7 +970,7 @@ def create_employment_with_http_info(xero_tenant_id, employee_id, employment, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_employment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1046,7 +1046,7 @@ def create_leave_type_with_http_info(xero_tenant_id, leave_type, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1128,7 +1128,7 @@ def create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, em :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_multiple_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1204,7 +1204,7 @@ def create_pay_run_with_http_info(xero_tenant_id, pay_run, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1280,7 +1280,7 @@ def create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1356,7 +1356,7 @@ def create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1432,7 +1432,7 @@ def create_superannuation_with_http_info(xero_tenant_id, benefit, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_superannuation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1508,7 +1508,7 @@ def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1590,7 +1590,7 @@ def create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#create_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1670,7 +1670,7 @@ def delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1750,7 +1750,7 @@ def delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1830,7 +1830,7 @@ def delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1904,7 +1904,7 @@ def delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#delete_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1984,7 +1984,7 @@ def delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#delete_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2058,7 +2058,7 @@ def get_deduction_with_http_info(xero_tenant_id, deduction_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2129,7 +2129,7 @@ def get_deductions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2203,7 +2203,7 @@ def get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2274,7 +2274,7 @@ def get_earnings_rates_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_earnings_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2348,7 +2348,7 @@ def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2422,7 +2422,7 @@ def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2502,7 +2502,7 @@ def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2576,7 +2576,7 @@ def get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2650,7 +2650,7 @@ def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_leaves\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2724,7 +2724,7 @@ def get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2798,7 +2798,7 @@ def get_employee_pay_templates_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_pay_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2872,7 +2872,7 @@ def get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2952,7 +2952,7 @@ def get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, sal :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3029,7 +3029,7 @@ def get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_salary_and_wages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3103,7 +3103,7 @@ def get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3180,7 +3180,7 @@ def get_employees_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3254,7 +3254,7 @@ def get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3328,7 +3328,7 @@ def get_leave_types_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3402,7 +3402,7 @@ def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3476,7 +3476,7 @@ def get_pay_run_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3547,7 +3547,7 @@ def get_pay_run_calendars_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_run_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3625,7 +3625,7 @@ def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3699,7 +3699,7 @@ def get_pay_slip_with_http_info(xero_tenant_id, pay_slip_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_slip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3777,7 +3777,7 @@ def get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_pay_slips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3851,7 +3851,7 @@ def get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3922,7 +3922,7 @@ def get_reimbursements_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_reimbursements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3990,7 +3990,7 @@ def get_settings_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4064,7 +4064,7 @@ def get_statutory_deduction_with_http_info(xero_tenant_id, id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_statutory_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4135,7 +4135,7 @@ def get_statutory_deductions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_statutory_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4209,7 +4209,7 @@ def get_superannuation_with_http_info(xero_tenant_id, superannuation_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_superannuation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4280,7 +4280,7 @@ def get_superannuations_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_superannuations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4354,7 +4354,7 @@ def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4431,7 +4431,7 @@ def get_timesheets_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4499,7 +4499,7 @@ def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4573,7 +4573,7 @@ def revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#revert_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4655,7 +4655,7 @@ def update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4743,7 +4743,7 @@ def update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4831,7 +4831,7 @@ def update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4919,7 +4919,7 @@ def update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5001,7 +5001,7 @@ def update_employee_tax_with_http_info(xero_tenant_id, employee_id, employee_tax :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5083,7 +5083,7 @@ def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5165,7 +5165,7 @@ def update_pay_slip_line_items_with_http_info(xero_tenant_id, pay_slip_id, pay_s :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_pay_slip_line_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5253,7 +5253,7 @@ def update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollNzApi#update_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/payroll_uk_api.rb b/lib/xero-ruby/api/payroll_uk_api.rb index 97bfa8c4..d7c12601 100644 --- a/lib/xero-ruby/api/payroll_uk_api.rb +++ b/lib/xero-ruby/api/payroll_uk_api.rb @@ -86,7 +86,7 @@ def approve_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#approve_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -162,7 +162,7 @@ def create_benefit_with_http_info(xero_tenant_id, benefit, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_benefit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -238,7 +238,7 @@ def create_deduction_with_http_info(xero_tenant_id, deduction, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -314,7 +314,7 @@ def create_earnings_rate_with_http_info(xero_tenant_id, earnings_rate, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -390,7 +390,7 @@ def create_employee_with_http_info(xero_tenant_id, employee, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -472,7 +472,7 @@ def create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -554,7 +554,7 @@ def create_employee_leave_with_http_info(xero_tenant_id, employee_id, employee_l :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -636,7 +636,7 @@ def create_employee_leave_type_with_http_info(xero_tenant_id, employee_id, emplo :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -718,7 +718,7 @@ def create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -800,7 +800,7 @@ def create_employee_payment_method_with_http_info(xero_tenant_id, employee_id, p :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -882,7 +882,7 @@ def create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -958,7 +958,7 @@ def create_employee_statutory_sick_leave_with_http_info(xero_tenant_id, employee :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employee_statutory_sick_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1040,7 +1040,7 @@ def create_employment_with_http_info(xero_tenant_id, employee_id, employment, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_employment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1116,7 +1116,7 @@ def create_leave_type_with_http_info(xero_tenant_id, leave_type, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1198,7 +1198,7 @@ def create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, em :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_multiple_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1274,7 +1274,7 @@ def create_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1350,7 +1350,7 @@ def create_reimbursement_with_http_info(xero_tenant_id, reimbursement, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1426,7 +1426,7 @@ def create_timesheet_with_http_info(xero_tenant_id, timesheet, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1508,7 +1508,7 @@ def create_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#create_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1586,7 +1586,7 @@ def delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1666,7 +1666,7 @@ def delete_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1744,7 +1744,7 @@ def delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#delete_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1818,7 +1818,7 @@ def delete_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#delete_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1898,7 +1898,7 @@ def delete_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#delete_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1972,7 +1972,7 @@ def get_benefit_with_http_info(xero_tenant_id, id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_benefit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2043,7 +2043,7 @@ def get_benefits_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_benefits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2117,7 +2117,7 @@ def get_deduction_with_http_info(xero_tenant_id, deduction_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_deduction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2188,7 +2188,7 @@ def get_deductions_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_deductions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2262,7 +2262,7 @@ def get_earnings_order_with_http_info(xero_tenant_id, id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2333,7 +2333,7 @@ def get_earnings_orders_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2407,7 +2407,7 @@ def get_earnings_rate_with_http_info(xero_tenant_id, earnings_rate_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2478,7 +2478,7 @@ def get_earnings_rates_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_earnings_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2552,7 +2552,7 @@ def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2632,7 +2632,7 @@ def get_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2706,7 +2706,7 @@ def get_employee_leave_balances_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2786,7 +2786,7 @@ def get_employee_leave_periods_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2860,7 +2860,7 @@ def get_employee_leave_types_with_http_info(xero_tenant_id, employee_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -2934,7 +2934,7 @@ def get_employee_leaves_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_leaves\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3008,7 +3008,7 @@ def get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3082,7 +3082,7 @@ def get_employee_pay_template_with_http_info(xero_tenant_id, employee_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_pay_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3156,7 +3156,7 @@ def get_employee_payment_method_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3236,7 +3236,7 @@ def get_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, sal :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3313,7 +3313,7 @@ def get_employee_salary_and_wages_with_http_info(xero_tenant_id, employee_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_salary_and_wages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3393,7 +3393,7 @@ def get_employee_statutory_leave_balances_with_http_info(xero_tenant_id, employe :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_statutory_leave_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3467,7 +3467,7 @@ def get_employee_statutory_sick_leave_with_http_info(xero_tenant_id, statutory_s :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_statutory_sick_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3541,7 +3541,7 @@ def get_employee_tax_with_http_info(xero_tenant_id, employee_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employee_tax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3618,7 +3618,7 @@ def get_employees_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3692,7 +3692,7 @@ def get_leave_type_with_http_info(xero_tenant_id, leave_type_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_leave_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3766,7 +3766,7 @@ def get_leave_types_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_leave_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3840,7 +3840,7 @@ def get_pay_run_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3914,7 +3914,7 @@ def get_pay_run_calendar_with_http_info(xero_tenant_id, pay_run_calendar_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -3985,7 +3985,7 @@ def get_pay_run_calendars_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_run_calendars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4063,7 +4063,7 @@ def get_pay_runs_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4137,7 +4137,7 @@ def get_pay_slip_with_http_info(xero_tenant_id, payslip_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_slip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4215,7 +4215,7 @@ def get_pay_slips_with_http_info(xero_tenant_id, pay_run_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_pay_slips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4289,7 +4289,7 @@ def get_reimbursement_with_http_info(xero_tenant_id, reimbursement_id, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_reimbursement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4360,7 +4360,7 @@ def get_reimbursements_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_reimbursements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4428,7 +4428,7 @@ def get_settings_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4505,7 +4505,7 @@ def get_statutory_leave_summary_with_http_info(xero_tenant_id, employee_id, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_statutory_leave_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4579,7 +4579,7 @@ def get_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4656,7 +4656,7 @@ def get_timesheets_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_timesheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4724,7 +4724,7 @@ def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4798,7 +4798,7 @@ def revert_timesheet_with_http_info(xero_tenant_id, timesheet_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#revert_timesheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4880,7 +4880,7 @@ def update_employee_with_http_info(xero_tenant_id, employee_id, employee, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -4968,7 +4968,7 @@ def update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_earnings_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5056,7 +5056,7 @@ def update_employee_leave_with_http_info(xero_tenant_id, employee_id, leave_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_leave\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5138,7 +5138,7 @@ def update_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_opening_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5226,7 +5226,7 @@ def update_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_employee_salary_and_wage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5308,7 +5308,7 @@ def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts = {} :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -5396,7 +5396,7 @@ def update_timesheet_line_with_http_info(xero_tenant_id, timesheet_id, timesheet :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PayrollUkApi#update_timesheet_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index 5a008630..eb80d427 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -88,7 +88,7 @@ def create_project_with_http_info(xero_tenant_id, project_create_or_update, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -172,7 +172,7 @@ def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_crea :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#create_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -252,7 +252,7 @@ def delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#delete_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -328,7 +328,7 @@ def get_project_with_http_info(xero_tenant_id, project_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -412,7 +412,7 @@ def get_project_users_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_project_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -505,7 +505,7 @@ def get_projects_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -587,7 +587,7 @@ def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -672,7 +672,7 @@ def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -778,7 +778,7 @@ def get_time_entries_with_http_info(xero_tenant_id, project_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_time_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -860,7 +860,7 @@ def get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#get_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -944,7 +944,7 @@ def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1028,7 +1028,7 @@ def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -1116,7 +1116,7 @@ def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "ProjectApi", new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectApi#update_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index 76e4b633..8ae276fe 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -69,17 +69,17 @@ def files_api def payroll_au_api @config.base_url = @config.payroll_au_url - XeroRuby::PayrollAu.new(self) + XeroRuby::PayrollAuApi.new(self) end def payroll_nz_api @config.base_url = @config.payroll_nz_url - XeroRuby::PayrollNz.new(self) + XeroRuby::PayrollNzApi.new(self) end def payroll_uk_api @config.base_url = @config.payroll_uk_url - XeroRuby::PayrollUk.new(self) + XeroRuby::PayrollUkApi.new(self) end # Token Helpers @@ -152,7 +152,7 @@ def disconnect(connection_id) # # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) + def call_api(http_method, path, api_client, opts = {}) ssl_options = { :ca_file => @config.ssl_ca_file, :verify => @config.ssl_verify, @@ -197,7 +197,7 @@ def call_api(http_method, path, opts = {}) if opts[:return_type] prepare_file(response) if opts[:return_type] == 'File' - data = deserialize(response, opts[:return_type]) + data = deserialize(response, opts[:return_type], api_client) else data = nil end @@ -261,10 +261,8 @@ def build_request_body(header_params, form_params, body) form_params.each do |key, value| case value when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + data[form_params["name"]] = Faraday::UploadIO.new(value.path, form_params["mimeType"], value.path) when ::Array, nil - # let Faraday handle Array and nil parameters data[key] = value else data[key] = value.to_s @@ -294,7 +292,7 @@ def json_mime?(mime) # # @param [Response] response HTTP response # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) + def deserialize(response, return_type, api_client) body = response.body # handle file downloading - return the File instance processed in request callbacks @@ -319,16 +317,16 @@ def deserialize(response, return_type) else raise e end - end + end - convert_to_type(data, return_type) + convert_to_type(data, return_type, api_client) end # Convert data to the given return type. # @param [Object] data Data to be converted # @param [String] return_type Return type # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) + def convert_to_type(data, return_type, api_client) return nil if data.nil? case return_type when 'String' @@ -359,21 +357,20 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - api_set = api_set_prefix(return_type) - case api_set - when 'accounting' + case api_client + when 'AccountingApi' XeroRuby::Accounting.const_get(return_type).build_from_hash(data) - when 'assets' + when 'AssetApi' XeroRuby::Assets.const_get(return_type).build_from_hash(data) - when 'projects' + when 'ProjectApi' XeroRuby::Projects.const_get(return_type).build_from_hash(data) - when 'files' + when 'FilesApi' XeroRuby::Files.const_get(return_type).build_from_hash(data) - when 'payroll_au' + when 'PayrollAuApi' XeroRuby::PayrollAu.const_get(return_type).build_from_hash(data) - when 'payroll_nz' + when 'PayrollNzApi' XeroRuby::PayrollNz.const_get(return_type).build_from_hash(data) - when 'payroll_uk' + when 'PayrollUkApi' XeroRuby::PayrollUk.const_get(return_type).build_from_hash(data) else XeroRuby::Accounting.const_get(return_type).build_from_hash(data) @@ -381,20 +378,6 @@ def convert_to_type(data, return_type) end end - # Traverses the model tree to find the model's namespacing - # based on the deserializing model/return_type name - def api_set_prefix(return_type) - api_set = '' - Find.find("#{File.dirname(__FILE__)}/models/") do |path| - model_path = path.split('/') - matching_name = model_path.last.gsub('.rb','').gsub("_",'') - if return_type.downcase === matching_name - api_set = path.split('/')[-2] - end - end - return api_set - end - # Save response body into a file in (the defined) temporary folder, using the filename # from the "Content-Disposition" header if provided, otherwise a random filename. # The response body is written to the file in chunks in order to handle files which diff --git a/lib/xero-ruby/models/files/object_type.rb b/lib/xero-ruby/models/files/object_type.rb index 3285ab9e..2f5f0a94 100644 --- a/lib/xero-ruby/models/files/object_type.rb +++ b/lib/xero-ruby/models/files/object_type.rb @@ -17,6 +17,7 @@ module XeroRuby::Files class ObjectType ACCOUNT = "ACCOUNT".freeze ACCPAY = "ACCPAY".freeze + ACCPAY = "Accpay".freeze ACCPAYCREDIT = "ACCPAYCREDIT".freeze ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze ACCREC = "ACCREC".freeze From ac7d27b26ac99e507eb900445af5c70e77223284 Mon Sep 17 00:00:00 2001 From: serknight Date: Mon, 2 Nov 2020 15:28:32 -0700 Subject: [PATCH 5/5] 4 sets built - specs - manual updates added --- lib/xero-ruby/api/accounting_api.rb | 2 -- lib/xero-ruby/api/asset_api.rb | 2 -- lib/xero-ruby/api/files_api.rb | 5 ---- lib/xero-ruby/api/payroll_au_api.rb | 2 -- lib/xero-ruby/api/payroll_nz_api.rb | 2 -- lib/xero-ruby/api/payroll_uk_api.rb | 2 -- lib/xero-ruby/api/project_api.rb | 2 -- lib/xero-ruby/api_client.rb | 7 ++--- lib/xero-ruby/models/accounting/account.rb | 2 +- .../models/accounting/organisation.rb | 26 +++++++++---------- lib/xero-ruby/models/files/object_type.rb | 2 -- spec/api_client_spec.rb | 6 ++--- 12 files changed, 21 insertions(+), 39 deletions(-) diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index f7bd49b1..ea580619 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class AccountingApi attr_accessor :api_client diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index be796277..ffa607af 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class AssetApi attr_accessor :api_client diff --git a/lib/xero-ruby/api/files_api.rb b/lib/xero-ruby/api/files_api.rb index b9cf08f2..00e9210f 100644 --- a/lib/xero-ruby/api/files_api.rb +++ b/lib/xero-ruby/api/files_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class FilesApi attr_accessor :api_client @@ -1263,10 +1261,7 @@ def upload_file_with_http_info(xero_tenant_id, opts = {}) :return_type => return_type ) - puts "new_options: #{new_options}" - data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FilesApi", new_options) - if @api_client.config.debugging @api_client.config.logger.debug "API called: FilesApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/xero-ruby/api/payroll_au_api.rb b/lib/xero-ruby/api/payroll_au_api.rb index 4a9e5f46..b1dd8bfc 100644 --- a/lib/xero-ruby/api/payroll_au_api.rb +++ b/lib/xero-ruby/api/payroll_au_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class PayrollAuApi attr_accessor :api_client diff --git a/lib/xero-ruby/api/payroll_nz_api.rb b/lib/xero-ruby/api/payroll_nz_api.rb index a60f8c2d..90ef7eba 100644 --- a/lib/xero-ruby/api/payroll_nz_api.rb +++ b/lib/xero-ruby/api/payroll_nz_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class PayrollNzApi attr_accessor :api_client diff --git a/lib/xero-ruby/api/payroll_uk_api.rb b/lib/xero-ruby/api/payroll_uk_api.rb index d7c12601..77cdd212 100644 --- a/lib/xero-ruby/api/payroll_uk_api.rb +++ b/lib/xero-ruby/api/payroll_uk_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class PayrollUkApi attr_accessor :api_client diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index eb80d427..dbd4e674 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -10,8 +10,6 @@ =end -require 'cgi' - module XeroRuby class ProjectApi attr_accessor :api_client diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index 8ae276fe..7ffa66e9 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -263,6 +263,7 @@ def build_request_body(header_params, form_params, body) when ::File, ::Tempfile data[form_params["name"]] = Faraday::UploadIO.new(value.path, form_params["mimeType"], value.path) when ::Array, nil + # let Faraday handle Array and nil parameters data[key] = value else data[key] = value.to_s @@ -317,7 +318,7 @@ def deserialize(response, return_type, api_client) else raise e end - end + end convert_to_type(data, return_type, api_client) end @@ -349,12 +350,12 @@ def convert_to_type(data, return_type, api_client) when /\AArray<(.+)>\z/ # e.g. Array sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } + data.map { |item| convert_to_type(item, sub_type, api_client) } when /\AHash\\z/ # e.g. Hash sub_type = $1 {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + data.each { |k, v| hash[k] = convert_to_type(v, sub_type, api_client) } end else case api_client diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index e97a836c..eca4fe04 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -91,7 +91,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - EMPTY = "".freeze + # EMPTY = "".freeze # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 61b13154..287bb5e4 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -114,7 +114,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - NONE = "NONE".freeze + # NONE = "NONE".freeze # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax @@ -136,18 +136,18 @@ class Organisation # Organisation Entity Type attr_accessor :organisation_entity_type - ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze - COMPANY = "COMPANY".freeze - CHARITY = "CHARITY".freeze - CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze - LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze - NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze - PARTNERSHIP = "PARTNERSHIP".freeze - S_CORPORATION = "S_CORPORATION".freeze - SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze - SOLE_TRADER = "SOLE_TRADER".freeze - SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze - TRUST = "TRUST".freeze + # ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + # COMPANY = "COMPANY".freeze + # CHARITY = "CHARITY".freeze + # CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + # LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + # NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + # PARTNERSHIP = "PARTNERSHIP".freeze + # S_CORPORATION = "S_CORPORATION".freeze + # SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + # SOLE_TRADER = "SOLE_TRADER".freeze + # SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + # TRUST = "TRUST".freeze # A unique identifier for the organisation. Potential uses. attr_accessor :short_code diff --git a/lib/xero-ruby/models/files/object_type.rb b/lib/xero-ruby/models/files/object_type.rb index 2f5f0a94..6d799d28 100644 --- a/lib/xero-ruby/models/files/object_type.rb +++ b/lib/xero-ruby/models/files/object_type.rb @@ -16,11 +16,9 @@ module XeroRuby::Files class ObjectType ACCOUNT = "ACCOUNT".freeze - ACCPAY = "ACCPAY".freeze ACCPAY = "Accpay".freeze ACCPAYCREDIT = "ACCPAYCREDIT".freeze ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze - ACCREC = "ACCREC".freeze ACC_REC = "AccRec".freeze ACCRECCREDIT = "ACCRECCREDIT".freeze ACCRECPAYMENT = "ACCRECPAYMENT".freeze diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 5c18ada3..cf5b96ee 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -56,7 +56,7 @@ api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') + data = api_client.deserialize(response, 'Array', 'AccountingApi') expect(data).to be_instance_of(Array) expect(data).to eq([12, 34]) end @@ -65,7 +65,7 @@ api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') + data = api_client.deserialize(response, 'Array>', 'AccountingApi') expect(data).to be_instance_of(Array) expect(data).to eq([[12, 34], [56]]) end @@ -74,7 +74,7 @@ api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') + data = api_client.deserialize(response, 'Hash', 'AccountingApi') expect(data).to be_instance_of(Hash) expect(data).to eq(:message => 'Hello') end