From 0af235961d87111340ee24ba100bb5c8b482eef4 Mon Sep 17 00:00:00 2001 From: sangeet-joy_xero Date: Tue, 30 Jul 2024 14:13:34 +0530 Subject: [PATCH 1/4] Update from OAS 6.1.1 --- docs/accounting/BankTransactions.md | 2 + docs/accounting/Contacts.md | 2 + docs/accounting/CreditNotes.md | 2 + docs/accounting/Invoices.md | 2 + docs/accounting/Journals.md | 4 +- docs/accounting/ManualJournals.md | 2 + docs/accounting/Overpayments.md | 2 + docs/accounting/Payments.md | 2 + docs/accounting/Prepayments.md | 2 + docs/accounting/PurchaseOrders.md | 2 + docs/accounting/index.html | 148 ++- docs/payroll_au/index.html | 22 +- docs/payroll_nz/Employee.md | 6 +- docs/payroll_nz/EmployeeLeaveSetup.md | 6 +- docs/payroll_nz/EmployeeLeaveType.md | 4 +- docs/payroll_nz/EmployeeWorkingPattern.md | 19 + .../EmployeeWorkingPatternWithWorkingWeeks.md | 21 + ...yeeWorkingPatternWithWorkingWeeksObject.md | 21 + ...eeWorkingPatternWithWorkingWeeksRequest.md | 19 + .../EmployeeWorkingPatternsObject.md | 21 + docs/payroll_nz/Employment.md | 6 +- docs/payroll_nz/PayrollNzApi.md | 291 +++++- docs/payroll_nz/SalaryAndWage.md | 4 +- docs/payroll_nz/WorkingWeek.md | 29 + docs/payroll_nz/index.html | 974 ++++++++++++++++-- lib/xero-ruby.rb | 6 + lib/xero-ruby/api/payroll_nz_api.rb | 337 +++++- .../models/accounting/bank_transactions.rb | 14 +- lib/xero-ruby/models/accounting/contacts.rb | 14 +- .../models/accounting/credit_notes.rb | 14 +- lib/xero-ruby/models/accounting/invoices.rb | 14 +- lib/xero-ruby/models/accounting/journals.rb | 14 +- .../models/accounting/manual_journals.rb | 14 +- .../models/accounting/overpayments.rb | 14 +- lib/xero-ruby/models/accounting/payments.rb | 14 +- .../models/accounting/prepayments.rb | 14 +- .../models/accounting/purchase_orders.rb | 14 +- lib/xero-ruby/models/payroll_nz/employee.rb | 28 +- .../models/payroll_nz/employee_leave_setup.rb | 28 +- .../models/payroll_nz/employee_leave_type.rb | 18 +- .../payroll_nz/employee_working_pattern.rb | 242 +++++ ...oyee_working_pattern_with_working_weeks.rb | 254 +++++ ...rking_pattern_with_working_weeks_object.rb | 242 +++++ ...king_pattern_with_working_weeks_request.rb | 244 +++++ .../employee_working_patterns_object.rb | 244 +++++ lib/xero-ruby/models/payroll_nz/employment.rb | 28 +- .../models/payroll_nz/salary_and_wage.rb | 32 +- .../models/payroll_nz/working_week.rb | 317 ++++++ lib/xero-ruby/version.rb | 2 +- 49 files changed, 3581 insertions(+), 194 deletions(-) create mode 100644 docs/payroll_nz/EmployeeWorkingPattern.md create mode 100644 docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeks.md create mode 100644 docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksObject.md create mode 100644 docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksRequest.md create mode 100644 docs/payroll_nz/EmployeeWorkingPatternsObject.md create mode 100644 docs/payroll_nz/WorkingWeek.md create mode 100644 lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb create mode 100644 lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb create mode 100644 lib/xero-ruby/models/payroll_nz/working_week.rb diff --git a/docs/accounting/BankTransactions.md b/docs/accounting/BankTransactions.md index 1a42933b..4ee25c0a 100644 --- a/docs/accounting/BankTransactions.md +++ b/docs/accounting/BankTransactions.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **bank_transactions** | [**Array<BankTransaction>**](BankTransaction.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::BankTransactions.new(pagination: null, + warnings: null, bank_transactions: null) ``` diff --git a/docs/accounting/Contacts.md b/docs/accounting/Contacts.md index 9dd8acce..e8d97d5e 100644 --- a/docs/accounting/Contacts.md +++ b/docs/accounting/Contacts.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **contacts** | [**Array<Contact>**](Contact.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::Contacts.new(pagination: null, + warnings: null, contacts: null) ``` diff --git a/docs/accounting/CreditNotes.md b/docs/accounting/CreditNotes.md index dc1dc2a2..4cce5449 100644 --- a/docs/accounting/CreditNotes.md +++ b/docs/accounting/CreditNotes.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **credit_notes** | [**Array<CreditNote>**](CreditNote.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::CreditNotes.new(pagination: null, + warnings: null, credit_notes: null) ``` diff --git a/docs/accounting/Invoices.md b/docs/accounting/Invoices.md index 1b14144f..25d4e7f4 100644 --- a/docs/accounting/Invoices.md +++ b/docs/accounting/Invoices.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **invoices** | [**Array<Invoice>**](Invoice.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::Invoices.new(pagination: null, + warnings: null, invoices: null) ``` diff --git a/docs/accounting/Journals.md b/docs/accounting/Journals.md index bccd124b..b43a6943 100644 --- a/docs/accounting/Journals.md +++ b/docs/accounting/Journals.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **journals** | [**Array<Journal>**](Journal.md) | | [optional] ## Code Sample @@ -11,7 +12,8 @@ Name | Type | Description | Notes ```ruby require 'XeroRuby::Accounting' -instance = XeroRuby::Accounting::Journals.new(journals: null) +instance = XeroRuby::Accounting::Journals.new(warnings: null, + journals: null) ``` diff --git a/docs/accounting/ManualJournals.md b/docs/accounting/ManualJournals.md index 1bf5bd45..6f591e34 100644 --- a/docs/accounting/ManualJournals.md +++ b/docs/accounting/ManualJournals.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **manual_journals** | [**Array<ManualJournal>**](ManualJournal.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::ManualJournals.new(pagination: null, + warnings: null, manual_journals: null) ``` diff --git a/docs/accounting/Overpayments.md b/docs/accounting/Overpayments.md index 5df81c8f..48514049 100644 --- a/docs/accounting/Overpayments.md +++ b/docs/accounting/Overpayments.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **overpayments** | [**Array<Overpayment>**](Overpayment.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::Overpayments.new(pagination: null, + warnings: null, overpayments: null) ``` diff --git a/docs/accounting/Payments.md b/docs/accounting/Payments.md index b9b3aa86..93913168 100644 --- a/docs/accounting/Payments.md +++ b/docs/accounting/Payments.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **payments** | [**Array<Payment>**](Payment.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::Payments.new(pagination: null, + warnings: null, payments: null) ``` diff --git a/docs/accounting/Prepayments.md b/docs/accounting/Prepayments.md index 93381a99..165969e2 100644 --- a/docs/accounting/Prepayments.md +++ b/docs/accounting/Prepayments.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **prepayments** | [**Array<Prepayment>**](Prepayment.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::Prepayments.new(pagination: null, + warnings: null, prepayments: null) ``` diff --git a/docs/accounting/PurchaseOrders.md b/docs/accounting/PurchaseOrders.md index c25a50a3..643ef35d 100644 --- a/docs/accounting/PurchaseOrders.md +++ b/docs/accounting/PurchaseOrders.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**Pagination**](Pagination.md) | | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] **purchase_orders** | [**Array<PurchaseOrder>**](PurchaseOrder.md) | | [optional] ## Code Sample @@ -13,6 +14,7 @@ Name | Type | Description | Notes require 'XeroRuby::Accounting' instance = XeroRuby::Accounting::PurchaseOrders.new(pagination: null, + warnings: null, purchase_orders: null) ``` diff --git a/docs/accounting/index.html b/docs/accounting/index.html index 938e36df..da2fcd25 100644 --- a/docs/accounting/index.html +++ b/docs/accounting/index.html @@ -989,7 +989,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "accounts" }; defs["AccountsPayable"] = { "title" : "", @@ -1056,7 +1056,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "actions" }; defs["Address"] = { "title" : "", @@ -1245,7 +1245,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "allocations" }; defs["Attachment"] = { "title" : "", @@ -1298,7 +1298,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "attachments" }; defs["BalanceDetails"] = { "title" : "", @@ -1468,6 +1468,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "BankTransactions" : { "type" : "array", "items" : { @@ -1476,7 +1483,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "bank_transactions" }; defs["BankTransfer"] = { "title" : "", @@ -1580,7 +1587,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "bank_transfers" }; defs["BatchPayment"] = { "title" : "", @@ -1770,7 +1777,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "batch_payments" }; defs["Bill"] = { "title" : "", @@ -1840,7 +1847,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "branding_themes" }; defs["Budget"] = { "title" : "", @@ -1953,7 +1960,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "budgets" }; defs["CISOrgSetting"] = { "title" : "", @@ -1991,7 +1998,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "cis_settings" }; defs["CISSetting"] = { "title" : "", @@ -2025,7 +2032,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "cis_settings" }; defs["Contact"] = { "title" : "", @@ -2291,7 +2298,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "contact_groups" }; defs["ContactPerson"] = { "title" : "", @@ -2326,6 +2333,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Contacts" : { "type" : "array", "items" : { @@ -2334,7 +2348,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "contacts" }; defs["ConversionBalances"] = { "title" : "", @@ -2564,6 +2578,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "CreditNotes" : { "type" : "array", "items" : { @@ -2572,7 +2593,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "credit_notes" }; defs["Currencies"] = { "title" : "", @@ -2586,7 +2607,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "currencies" }; defs["Currency"] = { "title" : "", @@ -2721,7 +2742,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "employees" }; defs["Error"] = { "title" : "", @@ -2845,7 +2866,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "expense_claims" }; defs["ExternalLink"] = { "title" : "", @@ -2910,7 +2931,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "history_records" }; defs["ImportSummary"] = { "title" : "", @@ -3271,7 +3292,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "invoice_reminders" }; defs["Invoices"] = { "title" : "", @@ -3280,6 +3301,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Invoices" : { "type" : "array", "items" : { @@ -3288,7 +3316,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "invoices" }; defs["Item"] = { "title" : "", @@ -3390,7 +3418,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "items" }; defs["Journal"] = { "title" : "", @@ -3526,6 +3554,13 @@ "title" : "", "type" : "object", "properties" : { + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Journals" : { "type" : "array", "items" : { @@ -3534,7 +3569,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "journals" }; defs["LineAmountTypes"] = { "title" : "", @@ -3767,7 +3802,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "linked_transactions" }; defs["ManualJournal"] = { "title" : "", @@ -3919,6 +3954,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "ManualJournals" : { "type" : "array", "items" : { @@ -3927,7 +3969,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "manual_journals" }; defs["OnlineInvoice"] = { "title" : "", @@ -3955,7 +3997,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "online_invoices" }; defs["Organisation"] = { "title" : "", @@ -4130,7 +4172,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "organisations" }; defs["Overpayment"] = { "title" : "", @@ -4256,6 +4298,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Overpayments" : { "type" : "array", "items" : { @@ -4264,7 +4313,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "overpayments" }; defs["Pagination"] = { "title" : "", @@ -4493,7 +4542,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "payment_services" }; defs["PaymentTerm"] = { "title" : "", @@ -4524,6 +4573,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Payments" : { "type" : "array", "items" : { @@ -4532,7 +4588,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "payments" }; defs["Phone"] = { "title" : "", @@ -4692,6 +4748,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "Prepayments" : { "type" : "array", "items" : { @@ -4700,7 +4763,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "prepayments" }; defs["Purchase"] = { "title" : "", @@ -4894,6 +4957,13 @@ "pagination" : { "$ref" : "#/components/schemas/Pagination" }, + "Warnings" : { + "type" : "array", + "description" : "Displays array of warning messages from the API", + "items" : { + "$ref" : "#/components/schemas/ValidationError" + } + }, "PurchaseOrders" : { "type" : "array", "items" : { @@ -4902,7 +4972,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "purchase_orders" }; defs["Quote"] = { "title" : "", @@ -5061,7 +5131,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "quotes" }; defs["Receipt"] = { "title" : "", @@ -5182,7 +5252,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "receipts" }; defs["RepeatingInvoice"] = { "title" : "", @@ -5310,7 +5380,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "repeating_invoices" }; defs["Report"] = { "title" : "", @@ -5522,7 +5592,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "reports" }; defs["RequestEmpty"] = { "title" : "", @@ -5744,7 +5814,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "tax_rates" }; defs["TaxType"] = { "title" : "", @@ -5904,7 +5974,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "tracking_categories" }; defs["TrackingCategory"] = { "title" : "", @@ -5990,7 +6060,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "options" }; defs["User"] = { "title" : "", @@ -6047,7 +6117,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "users" }; defs["ValidationError"] = { "title" : "", diff --git a/docs/payroll_au/index.html b/docs/payroll_au/index.html index 33b1184e..ed0f7187 100644 --- a/docs/payroll_au/index.html +++ b/docs/payroll_au/index.html @@ -1469,7 +1469,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "employees" }; defs["EmploymentBasis"] = { "title" : "", @@ -1644,7 +1644,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "leave_applications" }; defs["LeaveBalance"] = { "title" : "", @@ -1778,7 +1778,7 @@ } }, "description" : "The leave type lines", - "x-isObjectArray" : true + "x-objectArrayKey" : "employee" }; defs["LeavePeriod"] = { "title" : "", @@ -2027,7 +2027,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "pay_items" }; defs["PayOutType"] = { "title" : "", @@ -2162,7 +2162,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "pay_runs" }; defs["PayTemplate"] = { "title" : "", @@ -2272,7 +2272,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "payroll_calendars" }; defs["Payslip"] = { "title" : "", @@ -2560,7 +2560,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "payslips" }; defs["RateType"] = { "title" : "", @@ -2611,7 +2611,7 @@ } }, "description" : "The reimbursement type lines", - "x-isObjectArray" : true + "x-objectArrayKey" : "reimbursement_lines" }; defs["ReimbursementType"] = { "title" : "", @@ -2865,7 +2865,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "super_fund_products" }; defs["SuperFundType"] = { "title" : "", @@ -2885,7 +2885,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "super_funds" }; defs["SuperLine"] = { "title" : "", @@ -3307,7 +3307,7 @@ } }, "description" : "", - "x-isObjectArray" : true + "x-objectArrayKey" : "timesheets" }; defs["ValidationError"] = { "title" : "", diff --git a/docs/payroll_nz/Employee.md b/docs/payroll_nz/Employee.md index 73eaabce..1b28f881 100644 --- a/docs/payroll_nz/Employee.md +++ b/docs/payroll_nz/Employee.md @@ -19,6 +19,8 @@ Name | Type | Description | Notes **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] **job_title** | **String** | Employee's job title | [optional] +**engagement_type** | **String** | Engagement type of the employee | [optional] +**fixed_term_end_date** | **Date** | End date for an employee with a fixed-term engagement type | [optional] ## Code Sample @@ -39,7 +41,9 @@ instance = XeroRuby::PayrollNz::Employee.new(employee_id: d90457c4-f1be-4f2e-b4e payroll_calendar_id: null, updated_date_utc: null, created_date_utc: null, - job_title: General Manager) + job_title: General Manager, + engagement_type: Permanent, + fixed_term_end_date: Sun Jan 19 00:00:00 GMT 2020) ``` diff --git a/docs/payroll_nz/EmployeeLeaveSetup.md b/docs/payroll_nz/EmployeeLeaveSetup.md index 62d2b55b..e80cd00c 100644 --- a/docs/payroll_nz/EmployeeLeaveSetup.md +++ b/docs/payroll_nz/EmployeeLeaveSetup.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **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] +**sick_leave_schedule_of_accrual** | **String** | Set Schedule of Accrual Type for Sick Leave | [optional] +**sick_leave_anniversary_date** | **Date** | If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave | [optional] ## Code Sample @@ -23,7 +25,9 @@ instance = XeroRuby::PayrollNz::EmployeeLeaveSetup.new(include_holiday_pay: fals 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) + sick_leave_opening_balance: 10.5, + sick_leave_schedule_of_accrual: OnAnniversaryDate, + sick_leave_anniversary_date: Sun Jan 19 00:00:00 GMT 2020) ``` diff --git a/docs/payroll_nz/EmployeeLeaveType.md b/docs/payroll_nz/EmployeeLeaveType.md index cd53b7e3..2a2da709 100644 --- a/docs/payroll_nz/EmployeeLeaveType.md +++ b/docs/payroll_nz/EmployeeLeaveType.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **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] +**schedule_of_accrual_date** | **Date** | The date when an employee becomes entitled to their accrual. | [optional] ## Code Sample @@ -29,7 +30,8 @@ instance = XeroRuby::PayrollNz::EmployeeLeaveType.new(leave_type_id: null, percentage_of_gross_earnings: null, include_holiday_pay_every_pay: null, show_annual_leave_in_advance: null, - annual_leave_total_amount_paid: null) + annual_leave_total_amount_paid: null, + schedule_of_accrual_date: Sun Jan 19 00:00:00 GMT 2020) ``` diff --git a/docs/payroll_nz/EmployeeWorkingPattern.md b/docs/payroll_nz/EmployeeWorkingPattern.md new file mode 100644 index 00000000..5e3cfe6c --- /dev/null +++ b/docs/payroll_nz/EmployeeWorkingPattern.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::EmployeeWorkingPattern + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payee_working_pattern_id** | **String** | The Xero identifier for for Employee working pattern | +**effective_from** | **Date** | The effective date of the corresponding salary and wages | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeWorkingPattern.new(payee_working_pattern_id: null, + effective_from: null) +``` + + diff --git a/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeks.md b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeks.md new file mode 100644 index 00000000..9dc2a8fd --- /dev/null +++ b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeks.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payee_working_pattern_id** | **String** | The Xero identifier for for Employee working pattern | +**effective_from** | **Date** | The effective date of the corresponding salary and wages | +**working_weeks** | [**Array<WorkingWeek>**](WorkingWeek.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeks.new(payee_working_pattern_id: null, + effective_from: null, + working_weeks: null) +``` + + diff --git a/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksObject.md b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksObject.md new file mode 100644 index 00000000..30cd2bbb --- /dev/null +++ b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**payee_working_pattern** | [**EmployeeWorkingPatternWithWorkingWeeks**](EmployeeWorkingPatternWithWorkingWeeks.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksObject.new(pagination: null, + problem: null, + payee_working_pattern: null) +``` + + diff --git a/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksRequest.md b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksRequest.md new file mode 100644 index 00000000..29848d75 --- /dev/null +++ b/docs/payroll_nz/EmployeeWorkingPatternWithWorkingWeeksRequest.md @@ -0,0 +1,19 @@ +# XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effective_from** | **Date** | The effective date of the corresponding salary and wages | +**working_weeks** | [**Array<WorkingWeek>**](WorkingWeek.md) | | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksRequest.new(effective_from: null, + working_weeks: null) +``` + + diff --git a/docs/payroll_nz/EmployeeWorkingPatternsObject.md b/docs/payroll_nz/EmployeeWorkingPatternsObject.md new file mode 100644 index 00000000..6ec8f082 --- /dev/null +++ b/docs/payroll_nz/EmployeeWorkingPatternsObject.md @@ -0,0 +1,21 @@ +# XeroRuby::PayrollNz::EmployeeWorkingPatternsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**problem** | [**Problem**](Problem.md) | | [optional] +**payee_working_patterns** | [**Array<EmployeeWorkingPattern>**](EmployeeWorkingPattern.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::EmployeeWorkingPatternsObject.new(pagination: null, + problem: null, + payee_working_patterns: null) +``` + + diff --git a/docs/payroll_nz/Employment.md b/docs/payroll_nz/Employment.md index 18bb70f3..4a60ee8d 100644 --- a/docs/payroll_nz/Employment.md +++ b/docs/payroll_nz/Employment.md @@ -7,6 +7,8 @@ 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] +**engagement_type** | **String** | Engagement type of the employee | [optional] +**fixed_term_end_date** | **Date** | End date for an employee with a fixed-term engagement type | [optional] ## Code Sample @@ -15,7 +17,9 @@ require 'XeroRuby::PayrollNz' instance = XeroRuby::PayrollNz::Employment.new(payroll_calendar_id: null, pay_run_calendar_id: null, - start_date: null) + start_date: null, + engagement_type: Permanent, + fixed_term_end_date: Sun Jan 19 00:00:00 GMT 2020) ``` diff --git a/docs/payroll_nz/PayrollNzApi.md b/docs/payroll_nz/PayrollNzApi.md index c22da977..762adba1 100644 --- a/docs/payroll_nz/PayrollNzApi.md +++ b/docs/payroll_nz/PayrollNzApi.md @@ -8,25 +8,27 @@ Method | HTTP request | Description [**create_deduction**](PayrollNzApi.md#create_deduction) | **POST** /Deductions | Creates a new deduction for a specific employee [**create_earnings_rate**](PayrollNzApi.md#create_earnings_rate) | **POST** /EarningsRates | Creates a new earnings rate [**create_employee**](PayrollNzApi.md#create_employee) | **POST** /Employees | Creates an employees -[**create_employee_earnings_template**](PayrollNzApi.md#create_employee_earnings_template) | **POST** /Employees/{EmployeeID}/PayTemplates/earnings | Creates earnings template records for an employee +[**create_employee_earnings_template**](PayrollNzApi.md#create_employee_earnings_template) | **POST** /Employees/{EmployeeID}/PayTemplates/Earnings | Creates earnings template records for an employee [**create_employee_leave**](PayrollNzApi.md#create_employee_leave) | **POST** /Employees/{EmployeeID}/Leave | Creates leave records for a specific employee -[**create_employee_leave_setup**](PayrollNzApi.md#create_employee_leave_setup) | **POST** /Employees/{EmployeeID}/leaveSetup | Creates a leave set-up for a specific employee. This is required before viewing, configuring and requesting leave for an employee +[**create_employee_leave_setup**](PayrollNzApi.md#create_employee_leave_setup) | **POST** /Employees/{EmployeeID}/LeaveSetup | Creates a leave set-up 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 leave type records for a specific employee -[**create_employee_opening_balances**](PayrollNzApi.md#create_employee_opening_balances) | **POST** /Employees/{EmployeeID}/openingBalances | Creates opening balances for a specific employee +[**create_employee_opening_balances**](PayrollNzApi.md#create_employee_opening_balances) | **POST** /Employees/{EmployeeID}/OpeningBalances | Creates opening balances for a specific employee [**create_employee_payment_method**](PayrollNzApi.md#create_employee_payment_method) | **POST** /Employees/{EmployeeID}/PaymentMethods | Creates a payment method for an employee [**create_employee_salary_and_wage**](PayrollNzApi.md#create_employee_salary_and_wage) | **POST** /Employees/{EmployeeID}/SalaryAndWages | Creates an employee salary and wage record +[**create_employee_working_pattern**](PayrollNzApi.md#create_employee_working_pattern) | **POST** /Employees/{EmployeeID}/Working-Patterns | Creates an employee working pattern [**create_employment**](PayrollNzApi.md#create_employment) | **POST** /Employees/{EmployeeID}/Employment | Creates an employment detail for a specific employee [**create_leave_type**](PayrollNzApi.md#create_leave_type) | **POST** /LeaveTypes | Creates 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 for a specific employee +[**create_multiple_employee_earnings_template**](PayrollNzApi.md#create_multiple_employee_earnings_template) | **POST** /Employees/{EmployeeID}/PayTemplateEarnings | Creates multiple employee earnings template records for a specific employee [**create_pay_run**](PayrollNzApi.md#create_pay_run) | **POST** /PayRuns | Creates a pay run [**create_pay_run_calendar**](PayrollNzApi.md#create_pay_run_calendar) | **POST** /PayRunCalendars | Creates a new payrun calendar [**create_reimbursement**](PayrollNzApi.md#create_reimbursement) | **POST** /Reimbursements | Creates a new reimbursement [**create_superannuation**](PayrollNzApi.md#create_superannuation) | **POST** /Superannuations | Creates a new superannuation [**create_timesheet**](PayrollNzApi.md#create_timesheet) | **POST** /Timesheets | Creates a new timesheet [**create_timesheet_line**](PayrollNzApi.md#create_timesheet_line) | **POST** /Timesheets/{TimesheetID}/Lines | Create a new timesheet line for a specific time sheet -[**delete_employee_earnings_template**](PayrollNzApi.md#delete_employee_earnings_template) | **DELETE** /Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID} | Deletes an employee's earnings template record +[**delete_employee_earnings_template**](PayrollNzApi.md#delete_employee_earnings_template) | **DELETE** /Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID} | Deletes an employee's earnings template record [**delete_employee_leave**](PayrollNzApi.md#delete_employee_leave) | **DELETE** /Employees/{EmployeeID}/Leave/{LeaveID} | Deletes a leave record for a specific employee [**delete_employee_salary_and_wage**](PayrollNzApi.md#delete_employee_salary_and_wage) | **DELETE** /Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID} | Deletes an employee's salary and wages record +[**delete_employee_working_pattern**](PayrollNzApi.md#delete_employee_working_pattern) | **DELETE** /Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID} | deletes employee's working patterns [**delete_timesheet**](PayrollNzApi.md#delete_timesheet) | **DELETE** /Timesheets/{TimesheetID} | Deletes a timesheet [**delete_timesheet_line**](PayrollNzApi.md#delete_timesheet_line) | **DELETE** /Timesheets/{TimesheetID}/Lines/{TimesheetLineID} | Deletes a timesheet line for a specific timesheet [**get_deduction**](PayrollNzApi.md#get_deduction) | **GET** /Deductions/{deductionId} | Retrieves a single deduction by using a unique deduction ID @@ -38,12 +40,14 @@ Method | HTTP request | Description [**get_employee_leave_periods**](PayrollNzApi.md#get_employee_leave_periods) | **GET** /Employees/{EmployeeID}/LeavePeriods | Retrieves leave periods for a specific employee [**get_employee_leave_types**](PayrollNzApi.md#get_employee_leave_types) | **GET** /Employees/{EmployeeID}/LeaveTypes | Retrieves leave types for a specific employee [**get_employee_leaves**](PayrollNzApi.md#get_employee_leaves) | **GET** /Employees/{EmployeeID}/Leave | Retrieves leave records for a specific employee -[**get_employee_opening_balances**](PayrollNzApi.md#get_employee_opening_balances) | **GET** /Employees/{EmployeeID}/openingBalances | Retrieves the opening balance for a specific employee +[**get_employee_opening_balances**](PayrollNzApi.md#get_employee_opening_balances) | **GET** /Employees/{EmployeeID}/OpeningBalances | Retrieves the opening balance for a specific employee [**get_employee_pay_templates**](PayrollNzApi.md#get_employee_pay_templates) | **GET** /Employees/{EmployeeID}/PayTemplates | Retrieves pay templates for a specific employee [**get_employee_payment_method**](PayrollNzApi.md#get_employee_payment_method) | **GET** /Employees/{EmployeeID}/PaymentMethods | Retrieves available payment methods for a specific employee [**get_employee_salary_and_wage**](PayrollNzApi.md#get_employee_salary_and_wage) | **GET** /Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID} | Retrieves an employee's salary and wages record by using a unique salary and wage 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 | Retrieves tax records for a specific employee +[**get_employee_working_pattern**](PayrollNzApi.md#get_employee_working_pattern) | **GET** /Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID} | Retrieves employee's working patterns +[**get_employee_working_patterns**](PayrollNzApi.md#get_employee_working_patterns) | **GET** /Employees/{EmployeeID}/Working-Patterns | Retrieves employee's working patterns [**get_employees**](PayrollNzApi.md#get_employees) | **GET** /Employees | Retrieves employees [**get_leave_type**](PayrollNzApi.md#get_leave_type) | **GET** /LeaveTypes/{LeaveTypeID} | Retrieves a specific leave type by using a unique leave type ID [**get_leave_types**](PayrollNzApi.md#get_leave_types) | **GET** /LeaveTypes | Retrieves leave types @@ -65,7 +69,7 @@ Method | HTTP request | Description [**get_tracking_categories**](PayrollNzApi.md#get_tracking_categories) | **GET** /Settings/TrackingCategories | Retrieves tracking categories [**revert_timesheet**](PayrollNzApi.md#revert_timesheet) | **POST** /Timesheets/{TimesheetID}/RevertToDraft | Reverts a timesheet to draft [**update_employee**](PayrollNzApi.md#update_employee) | **PUT** /Employees/{EmployeeID} | Updates an existing employee -[**update_employee_earnings_template**](PayrollNzApi.md#update_employee_earnings_template) | **PUT** /Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID} | Updates an earnings template records for an employee +[**update_employee_earnings_template**](PayrollNzApi.md#update_employee_earnings_template) | **PUT** /Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID} | Updates an earnings template records for an employee [**update_employee_leave**](PayrollNzApi.md#update_employee_leave) | **PUT** /Employees/{EmployeeID}/Leave/{LeaveID} | Updates leave records for a specific employee [**update_employee_salary_and_wage**](PayrollNzApi.md#update_employee_salary_and_wage) | **PUT** /Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID} | Updates an employee's salary and wages record [**update_employee_tax**](PayrollNzApi.md#update_employee_tax) | **POST** /Employees/{EmployeeID}/Tax | Updates the tax records for a specific employee @@ -526,7 +530,7 @@ 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 | +employee_leave_setup = { "holidayPayOpeningBalance": 10, "annualLeaveOpeningBalance": 100, "sickLeaveHoursToAccrueAnnually": 20, "sickLeaveToAccrueAnnually": 20, "sickLeaveOpeningBalance": 10, "sickLeaveScheduleOfAccrual": "OnAnniversaryDate", "sickLeaveAnniversaryDate": "2023-12-31", "annualLeaveAnniversaryDate": "2023-12-31" } # EmployeeLeaveSetup | opts = { idempotency_key: 'KEY_VALUE' # String | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. } @@ -597,7 +601,7 @@ 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 | +employee_leave_type = { "leaveTypeID": "35da97ae-05b9-427f-9a98-69157ba42cec", "scheduleOfAccrual": "AnnuallyAfter6Months", "hoursAccruedAnnually": 10, "unitsAccruedAnnually": 10, "typeOfUnitsToAccrue": "Hours", "openingBalanceTypeOfUnits": "Hours" "maximumToAccrue": 80, "openingBalance": 100, "rateAccruedHourly": 3.5 } # EmployeeLeaveType | opts = { idempotency_key: 'KEY_VALUE' # String | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. } @@ -848,6 +852,77 @@ Name | Type | Description | Notes - **Accept**: application/json +## create_employee_working_pattern + +> EmployeeWorkingPatternWithWorkingWeeksObject create_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_with_working_weeks_request, opts) + +Creates an employee working pattern + +### 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, :app_store_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_working_pattern_with_working_weeks_request = { "effectiveFrom": "2020-01-01T00:00:00", "workingWeeks": [ { "monday": 0.0, "tuesday": 3.0000, "wednesday": 0.0, "thursday": 0.0, "friday": 0.0, "saturday": 0.0, "sunday": 0.0 } ] } # EmployeeWorkingPatternWithWorkingWeeksRequest | +opts = { + idempotency_key: 'KEY_VALUE' # String | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. +} + +begin + #Creates an employee working pattern + result = api_instance.create_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_with_working_weeks_request, opts) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->create_employee_working_pattern: #{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_working_pattern_with_working_weeks_request** | [**EmployeeWorkingPatternWithWorkingWeeksRequest**](EmployeeWorkingPatternWithWorkingWeeksRequest.md)| | + **idempotency_key** | **String**| This allows you to safely retry requests without the risk of duplicate processing. 128 character max. | [optional] + +### Return type + +[**EmployeeWorkingPatternWithWorkingWeeksObject**](EmployeeWorkingPatternWithWorkingWeeksObject.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, opts) @@ -881,7 +956,7 @@ 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 | +employment = { "payrollCalendarID": "9aa56064-990f-4ad3-a189-d966d8f6a030", "startDate": "2020-09-02", "engagementType": "FixedTerm", "fixedTermEndDate": "2026-01-01" } # Employment | opts = { idempotency_key: 'KEY_VALUE' # String | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. } @@ -1673,6 +1748,72 @@ Name | Type | Description | Notes - **Accept**: application/json +## delete_employee_working_pattern + +> EmployeeLeaveObject delete_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id) + +deletes employee's working patterns + +### 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, :app_store_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_working_pattern_id = '4ff1e5cc-9835-40d5-bb18-09f3b118db9c' # String | Employee working pattern id for single object +begin + #deletes employee's working patterns + result = api_instance.delete_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->delete_employee_working_pattern: #{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_working_pattern_id** | [**String**](.md)| Employee working pattern 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_timesheet > TimesheetLine delete_timesheet(xero_tenant_id, timesheet_id) @@ -2784,6 +2925,136 @@ Name | Type | Description | Notes - **Accept**: application/json +## get_employee_working_pattern + +> EmployeeWorkingPatternWithWorkingWeeksObject get_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id) + +Retrieves employee's working patterns + +### 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, :app_store_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_working_pattern_id = '4ff1e5cc-9835-40d5-bb18-09f3b118db9c' # String | Employee working pattern id for single object +begin + #Retrieves employee's working patterns + result = api_instance.get_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_working_pattern: #{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_working_pattern_id** | [**String**](.md)| Employee working pattern id for single object | + +### Return type + +[**EmployeeWorkingPatternWithWorkingWeeksObject**](EmployeeWorkingPatternWithWorkingWeeksObject.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee_working_patterns + +> EmployeeWorkingPatternsObject get_employee_working_patterns(xero_tenant_id, employee_id) + +Retrieves employee's working patterns + +### 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, :app_store_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 employee's working patterns + result = api_instance.get_employee_working_patterns(xero_tenant_id, employee_id) + p result +rescue XeroRuby::PayrollNz::ApiError => e + puts "Exception when calling PayrollNzApi->get_employee_working_patterns: #{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 + +[**EmployeeWorkingPatternsObject**](EmployeeWorkingPatternsObject.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) diff --git a/docs/payroll_nz/SalaryAndWage.md b/docs/payroll_nz/SalaryAndWage.md index 13703cd1..25dec04d 100644 --- a/docs/payroll_nz/SalaryAndWage.md +++ b/docs/payroll_nz/SalaryAndWage.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **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 | +**work_pattern_type** | **String** | The type of the Working Pattern of the corresponding salary and wages | [optional] ## Code Sample @@ -29,7 +30,8 @@ instance = XeroRuby::PayrollNz::SalaryAndWage.new(salary_and_wages_id: null, effective_from: null, annual_salary: null, status: null, - payment_type: null) + payment_type: null, + work_pattern_type: null) ``` diff --git a/docs/payroll_nz/WorkingWeek.md b/docs/payroll_nz/WorkingWeek.md new file mode 100644 index 00000000..2fd7efd7 --- /dev/null +++ b/docs/payroll_nz/WorkingWeek.md @@ -0,0 +1,29 @@ +# XeroRuby::PayrollNz::WorkingWeek + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monday** | **BigDecimal** | The number of hours worked on a Monday | +**tuesday** | **BigDecimal** | The number of hours worked on a Tuesday | +**wednesday** | **BigDecimal** | The number of hours worked on a Wednesday | +**thursday** | **BigDecimal** | The number of hours worked on a Thursday | +**friday** | **BigDecimal** | The number of hours worked on a Friday | +**saturday** | **BigDecimal** | The number of hours worked on a Saturday | +**sunday** | **BigDecimal** | The number of hours worked on a Sunday | + +## Code Sample + +```ruby +require 'XeroRuby::PayrollNz' + +instance = XeroRuby::PayrollNz::WorkingWeek.new(monday: null, + tuesday: null, + wednesday: null, + thursday: null, + friday: null, + saturday: null, + sunday: null) +``` + + diff --git a/docs/payroll_nz/index.html b/docs/payroll_nz/index.html index ff8c6efc..47bdbe6d 100644 --- a/docs/payroll_nz/index.html +++ b/docs/payroll_nz/index.html @@ -1507,6 +1507,18 @@ "type" : "string", "description" : "Employee's job title", "example" : "General Manager" + }, + "engagementType" : { + "type" : "string", + "description" : "Engagement type of the employee", + "example" : "Permanent" + }, + "fixedTermEndDate" : { + "type" : "string", + "description" : "End date for an employee with a fixed-term engagement type", + "format" : "date", + "example" : "2020-01-19", + "x-is-date" : true } }, "description" : "" @@ -1690,6 +1702,18 @@ "format" : "double", "example" : 10.5, "x-is-money" : true + }, + "SickLeaveScheduleOfAccrual" : { + "type" : "string", + "description" : "Set Schedule of Accrual Type for Sick Leave", + "example" : "OnAnniversaryDate" + }, + "SickLeaveAnniversaryDate" : { + "type" : "string", + "description" : "If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave", + "format" : "date", + "example" : "2020-01-19", + "x-is-date" : true } }, "description" : "" @@ -1767,6 +1791,13 @@ "description" : "Specific to Annual Leave. Annual leave balance in dollars", "format" : "double", "x-is-money" : true + }, + "scheduleOfAccrualDate" : { + "type" : "string", + "description" : "The date when an employee becomes entitled to their accrual.", + "format" : "date", + "example" : "2020-01-19", + "x-is-date" : true } }, "description" : "" @@ -2285,6 +2316,96 @@ } }, "description" : "" +}; + defs["EmployeeWorkingPattern"] = { + "title" : "", + "required" : [ "effectiveFrom", "payeeWorkingPatternID" ], + "type" : "object", + "properties" : { + "payeeWorkingPatternID" : { + "type" : "string", + "description" : "The Xero identifier for for Employee working pattern", + "format" : "uuid" + }, + "effectiveFrom" : { + "type" : "string", + "description" : "The effective date of the corresponding salary and wages", + "format" : "date", + "x-is-date" : true + } + }, + "description" : "" +}; + defs["EmployeeWorkingPatternWithWorkingWeeks"] = { + "title" : "", + "required" : [ "effectiveFrom", "payeeWorkingPatternID" ], + "type" : "object", + "properties" : { + "payeeWorkingPatternID" : { + "type" : "string", + "description" : "The Xero identifier for for Employee working pattern", + "format" : "uuid" + }, + "effectiveFrom" : { + "type" : "string", + "description" : "The effective date of the corresponding salary and wages", + "format" : "date", + "x-is-date" : true + }, + "workingWeeks" : { + "$ref" : "#/components/schemas/WorkingWeeks" + } + }, + "description" : "" +}; + defs["EmployeeWorkingPatternWithWorkingWeeksObject"] = { + "title" : "", + "type" : "object", + "properties" : { + "pagination" : { + "$ref" : "#/components/schemas/Pagination" + }, + "problem" : { + "$ref" : "#/components/schemas/Problem" + }, + "payeeWorkingPattern" : { + "$ref" : "#/components/schemas/EmployeeWorkingPatternWithWorkingWeeks" + } + }, + "description" : "" +}; + defs["EmployeeWorkingPatternWithWorkingWeeksRequest"] = { + "title" : "", + "required" : [ "effectiveFrom", "workingWeeks" ], + "type" : "object", + "properties" : { + "effectiveFrom" : { + "type" : "string", + "description" : "The effective date of the corresponding salary and wages", + "format" : "date", + "x-is-date" : true + }, + "workingWeeks" : { + "$ref" : "#/components/schemas/WorkingWeeks" + } + }, + "description" : "" +}; + defs["EmployeeWorkingPatternsObject"] = { + "title" : "", + "type" : "object", + "properties" : { + "pagination" : { + "$ref" : "#/components/schemas/Pagination" + }, + "problem" : { + "$ref" : "#/components/schemas/Problem" + }, + "payeeWorkingPatterns" : { + "$ref" : "#/components/schemas/EmployeeWorkingPatterns" + } + }, + "description" : "" }; defs["Employees"] = { "title" : "", @@ -2307,7 +2428,7 @@ }; defs["Employment"] = { "title" : "", - "required" : [ "PayrollCalendarID", "StartDate" ], + "required" : [ "EngagementType", "PayrollCalendarID", "StartDate" ], "type" : "object", "properties" : { "payrollCalendarID" : { @@ -2325,6 +2446,18 @@ "description" : "Start date of the employment (YYYY-MM-DD)", "format" : "date", "x-is-date" : true + }, + "engagementType" : { + "type" : "string", + "description" : "Engagement type of the employee", + "example" : "Permanent" + }, + "fixedTermEndDate" : { + "type" : "string", + "description" : "End date for an employee with a fixed-term engagement type", + "format" : "date", + "example" : "2020-01-19", + "x-is-date" : true } }, "description" : "" @@ -3234,6 +3367,11 @@ "type" : "string", "description" : "The type of the payment of the corresponding salary and wages", "enum" : [ "Salary", "Hourly" ] + }, + "workPatternType" : { + "type" : "string", + "description" : "The type of the Working Pattern of the corresponding salary and wages", + "enum" : [ "DaysAndHours", "RegularWeek" ] } }, "description" : "" @@ -3760,6 +3898,56 @@ }, "description" : "" }; + defs["WorkingWeek"] = { + "title" : "", + "required" : [ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" ], + "type" : "object", + "properties" : { + "monday" : { + "type" : "number", + "description" : "The number of hours worked on a Monday", + "format" : "double", + "x-is-money" : true + }, + "tuesday" : { + "type" : "number", + "description" : "The number of hours worked on a Tuesday", + "format" : "double", + "x-is-money" : true + }, + "wednesday" : { + "type" : "number", + "description" : "The number of hours worked on a Wednesday", + "format" : "double", + "x-is-money" : true + }, + "thursday" : { + "type" : "number", + "description" : "The number of hours worked on a Thursday", + "format" : "double", + "x-is-money" : true + }, + "friday" : { + "type" : "number", + "description" : "The number of hours worked on a Friday", + "format" : "double", + "x-is-money" : true + }, + "saturday" : { + "type" : "number", + "description" : "The number of hours worked on a Saturday", + "format" : "double", + "x-is-money" : true + }, + "sunday" : { + "type" : "number", + "description" : "The number of hours worked on a Sunday", + "format" : "double", + "x-is-money" : true + } + }, + "description" : "" +}; var errs = {}; @@ -3878,6 +4066,9 @@
  • createEmployeeSalaryAndWage
  • +
  • + createEmployeeWorkingPattern +
  • createEmployment
  • @@ -3914,6 +4105,9 @@
  • deleteEmployeeSalaryAndWage
  • +
  • + deleteEmployeeWorkingPattern +
  • deleteTimesheet
  • @@ -3965,6 +4159,12 @@
  • getEmployeeTax
  • +
  • + getEmployeeWorkingPattern +
  • +
  • + getEmployeeWorkingPatterns +
  • getEmployees
  • @@ -4648,7 +4848,7 @@

    createEmployeeEarningsTemplate


    -
    /Employees/{EmployeeID}/PayTemplates/earnings
    +
    /Employees/{EmployeeID}/PayTemplates/Earnings

    Usage and SDK Samples

    @@ -4851,7 +5051,9 @@

    Usage and SDK Samples

    employee_leave = { leave_type_id: "00000000-0000-0000-0000-000000000000", start_date: start_date, - end_date: end_date + end_date: end_date, + number_of_units: number_of_units, + number_of_units_taken: number_of_units_taken } begin @@ -5007,7 +5209,7 @@

    createEmployeeLeaveSetup


    -
    /Employees/{EmployeeID}/leaveSetup
    +
    /Employees/{EmployeeID}/LeaveSetup

    Usage and SDK Samples

    @@ -5030,7 +5232,12 @@

    Usage and SDK Samples

    annual_leave_opening_balance: 25.89, sick_leave_hours_to_accrue_annually: 100.0, sick_leave_maximum_hours_to_accrue: 200.0, - sick_leave_opening_balance: 10.5 + sick_leave_opening_balance: 10.5, + sick_leave_to_accrue_annually: 100.0, + sick_leave_maximum_to_accrue: 200.0, + sick_leave_schedule_of_accrual: "", + sick_leave_anniversary_date: , + annual_leave_anniversary_date: } begin @@ -5164,7 +5371,7 @@

    Parameters

    "schema" : { "$ref" : "#/components/schemas/EmployeeLeaveSetup" }, - "example" : "{ \"holidayPayOpeningBalance\": 10, \"annualLeaveOpeningBalance\": 100, \"sickLeaveHoursToAccrueAnnually\": 20, \"sickLeaveOpeningBalance\": 10 }" + "example" : "{ \"holidayPayOpeningBalance\": 10, \"annualLeaveOpeningBalance\": 100, \"sickLeaveHoursToAccrueAnnually\": 20, \"sickLeaveToAccrueAnnually\": 20, \"sickLeaveOpeningBalance\": 10, \"sickLeaveScheduleOfAccrual\": \"OnAnniversaryDate\", \"sickLeaveAnniversaryDate\": \"2023-12-31\", \"annualLeaveAnniversaryDate\": \"2023-12-31\" }" } }, "required" : true @@ -5206,7 +5413,8 @@

    Usage and SDK Samples

    employee_leave_type = { leave_type_id: "00000000-0000-0000-0000-000000000000", schedule_of_accrual: XeroRuby::PayrollNz::EmployeeLeaveType::schedule_of_accrual::PERCENTAGEOFGROSSEARNINGS, - opening_balance: 5.25 + opening_balance: 5.25, + schedule_of_accrual_date: } begin @@ -5340,7 +5548,7 @@

    Parameters

    "schema" : { "$ref" : "#/components/schemas/EmployeeLeaveType" }, - "example" : "{ \"leaveTypeID\": \"35da97ae-05b9-427f-9a98-69157ba42cec\", \"scheduleOfAccrual\": \"AnnuallyAfter6Months\", \"hoursAccruedAnnually\": 10, \"maximumToAccrue\": 80, \"openingBalance\": 100, \"rateAccruedHourly\": 3.5 }" + "example" : "{ \"leaveTypeID\": \"35da97ae-05b9-427f-9a98-69157ba42cec\", \"scheduleOfAccrual\": \"AnnuallyAfter6Months\", \"hoursAccruedAnnually\": 10, \"unitsAccruedAnnually\": 10, \"typeOfUnitsToAccrue\": \"Hours\", \"openingBalanceTypeOfUnits\": \"Hours\" \"maximumToAccrue\": 80, \"openingBalance\": 100, \"rateAccruedHourly\": 3.5 }" } }, "required" : true @@ -5362,7 +5570,7 @@

    createEmployeeOpeningBalances


    -
    /Employees/{EmployeeID}/openingBalances
    +
    /Employees/{EmployeeID}/OpeningBalances

    Usage and SDK Samples

    @@ -5888,11 +6096,11 @@

    Parameters


    -
    -
    +
    +
    -

    createEmployment

    -

    Creates an employment detail for a specific employee

    +

    createEmployeeWorkingPattern

    +

    Creates an employee working pattern

    @@ -5900,34 +6108,39 @@

    createEmployment


    -
    /Employees/{EmployeeID}/Employment
    +
    /Employees/{EmployeeID}/Working-Patterns

    Usage and SDK Samples

    -
    +
    xero_client.set_token_set(user.token_set)
     
     xero_tenant_id = 'xeroTenantId_example'
     employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
     idempotency_key = 'KEY_VALUE'
    -start_date = 'YYYY-MM-DD'
    -
    -employment = { 
    -  payroll_calendar_id: "00000000-0000-0000-0000-000000000000",
    -  start_date:  start_date
    +effective_from = 'YYYY-MM-DD'
    +
    +workingWeek = { 
    +  monday: 8,
    +  tuesday: 8,
    +  wednesday: 8,
    +  thursday: 8,
    +  friday: 8,
    +  saturday: 0,
    +  sunday: 0
     }  
     
     begin
    -  response = xero_client.accounting_api.create_employment(xero_tenant_id, employee_id, employment, idempotency_key)
    +  response = xero_client.accounting_api.create_employee_working_pattern(xero_tenant_id, employee_id, employeeWorkingPatternWithWorkingWeeksRequest, idempotency_key)
       return response
     rescue XeroRuby::ApiError => e
    -  puts "Exception when calling create_employment: #{e}"
    +  puts "Exception when calling create_employee_working_pattern: #{e}"
     end
     
    @@ -5952,7 +6165,7 @@

    Parameters

    -
    +
    @@ -5985,7 +6198,7 @@

    Parameters

    -
    +
    @@ -6008,7 +6221,7 @@

    Parameters

    -
    +
    @@ -6032,12 +6245,12 @@

    Parameters

    Description - employment * + employeeWorkingPatternWithWorkingWeeksRequest *
    - Employment + EmployeeWorkingPatternWithWorkingWeeksRequest
    @@ -6052,9 +6265,9 @@

    Parameters

    "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Employment" + "$ref" : "#/components/schemas/EmployeeWorkingPatternWithWorkingWeeksRequest" }, - "example" : "{ \"payrollCalendarID\": \"9aa56064-990f-4ad3-a189-d966d8f6a030\", \"startDate\": \"2020-09-02\" }" + "example" : "{ \"effectiveFrom\": \"2020-01-01T00:00:00\", \"workingWeeks\": [ { \"monday\": 0.0, \"tuesday\": 3.0000, \"wednesday\": 0.0, \"thursday\": 0.0, \"friday\": 0.0, \"saturday\": 0.0, \"sunday\": 0.0 } ] }" } }, "required" : true @@ -6064,11 +6277,11 @@

    Parameters


    -
    -
    +
    +
    -

    createLeaveType

    -

    Creates a new leave type

    +

    createEmployment

    +

    Creates an employment detail for a specific employee

    @@ -6076,33 +6289,36 @@

    createLeaveType


    -
    /LeaveTypes
    +
    /Employees/{EmployeeID}/Employment

    Usage and SDK Samples

    -
    +
    xero_client.set_token_set(user.token_set)
     
     xero_tenant_id = 'xeroTenantId_example'
    +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
     idempotency_key = 'KEY_VALUE'
    +start_date = 'YYYY-MM-DD'
     
    -leave_type = { 
    -  name: "LeaveType",
    -  is_paid_leave: true,
    -  show_on_payslip: true
    +employment = { 
    +  payroll_calendar_id: "00000000-0000-0000-0000-000000000000",
    +  start_date:  start_date,
    +  engagement_type: "",
    +  fixed_term_end_date: 
     }  
     
     begin
    -  response = xero_client.accounting_api.create_leave_type(xero_tenant_id, leaveType, idempotency_key)
    +  response = xero_client.accounting_api.create_employment(xero_tenant_id, employee_id, employment, idempotency_key)
       return response
     rescue XeroRuby::ApiError => e
    -  puts "Exception when calling create_leave_type: #{e}"
    +  puts "Exception when calling create_employment: #{e}"
     end
     
    @@ -6111,12 +6327,45 @@

    Scopes

    - - + +
    payroll.settingsGrant read-write access to payroll settingspayroll.employeesGrant read-write access to payroll employees

    Parameters

    +
    Path parameters
    + + + + + + + + + +
    NameDescription
    EmployeeID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Employee id for single object +
    +
    +
    + Required +
    +
    +
    +
    Header parameters
    @@ -6127,7 +6376,7 @@

    Parameters

    - + + + +
    -
    +
    @@ -6150,7 +6399,7 @@

    Parameters

    -
    +
    @@ -6174,12 +6423,12 @@

    Parameters

    Description
    leaveType *employment *
    - LeaveType + Employment
    @@ -6194,9 +6443,9 @@

    Parameters

    "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/LeaveType" + "$ref" : "#/components/schemas/Employment" }, - "example" : "{ \"name\": \"My wqwhhiktun Leave\", \"isPaidLeave\": false, \"showOnPayslip\": true }" + "example" : "{ \"payrollCalendarID\": \"9aa56064-990f-4ad3-a189-d966d8f6a030\", \"startDate\": \"2020-09-02\", \"engagementType\": \"FixedTerm\", \"fixedTermEndDate\": \"2026-01-01\" }" } }, "required" : true @@ -6206,11 +6455,11 @@

    Parameters


    -
    -
    +
    +
    -

    createMultipleEmployeeEarningsTemplate

    -

    Creates multiple employee earnings template records for a specific employee

    +

    createLeaveType

    +

    Creates a new leave type

    @@ -6218,34 +6467,176 @@

    createMultipleEmployeeEarningsTemplate


    -
    /Employees/{EmployeeID}/paytemplateearnings
    +
    /LeaveTypes

    Usage and SDK Samples

    -
    +
    xero_client.set_token_set(user.token_set)
     
     xero_tenant_id = 'xeroTenantId_example'
    -employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
     idempotency_key = 'KEY_VALUE'
     
    -earnings_template = { 
    -  pay_template_earning_id: "00000000-0000-0000-0000-000000000000",
    -  rate_per_unit: 14.25,
    -  number_of_units: 35.5,
    -  fixed_amount: 50,
    -  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
    -  name: "Overtime Hours"
    -}    
    -earnings_templates = []
    -earnings_templates << earnings_template
    -
    +leave_type = { 
    +  name: "LeaveType",
    +  is_paid_leave: true,
    +  show_on_payslip: true
    +}  
    +
    +begin
    +  response = xero_client.accounting_api.create_leave_type(xero_tenant_id, leaveType, idempotency_key)
    +  return response
    +rescue XeroRuby::ApiError => e
    +  puts "Exception when calling create_leave_type: #{e}"
    +end
    +
    +
    +
    +

    Scopes

    + + + + + + + +
    payroll.settingsGrant read-write access to payroll settings
    +

    Parameters

    +
    Header parameters
    + + + + + + + + + + + + + +
    NameDescription
    Xero-Tenant-Id* + + +
    +
    +
    + + String + + +
    +Xero identifier for Tenant +
    +
    +
    + Required +
    +
    +
    +
    Idempotency-Key + + +
    +
    +
    + + String + + +
    +This allows you to safely retry requests without the risk of duplicate processing. 128 character max. +
    +
    +
    +
    +
    +
    Body parameters
    + + + + + + + +
    NameDescription
    leaveType * +
    +
    + + LeaveType + +
    + +
    +
    +
    + Required +
    +
    + +
    +
    +
    +
    +
    +
    +
    +

    createMultipleEmployeeEarningsTemplate

    +

    Creates multiple employee earnings template records for a specific employee

    +
    +
    +
    +

    +

    +

    +
    +
    /Employees/{EmployeeID}/PayTemplateEarnings
    +

    +

    Usage and SDK Samples

    +

    + +
    + +
    +
    xero_client.set_token_set(user.token_set)
    +
    +xero_tenant_id = 'xeroTenantId_example'
    +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
    +idempotency_key = 'KEY_VALUE'
    +
    +earnings_template = { 
    +  pay_template_earning_id: "00000000-0000-0000-0000-000000000000",
    +  rate_per_unit: 14.25,
    +  number_of_units: 35.5,
    +  fixed_amount: 50,
    +  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
    +  name: "Overtime Hours"
    +}    
    +earnings_templates = []
    +earnings_templates << earnings_template
    +
     begin
       response = xero_client.accounting_api.create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earningsTemplate, idempotency_key)
       return response
    @@ -7297,7 +7688,7 @@ 

    deleteEmployeeEarningsTemplate


    -
    /Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}
    +
    /Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}

    Usage and SDK Samples

    @@ -7520,7 +7911,147 @@

    Parameters

    -Leave id for single object +Leave id for single object +
    +
    +
    + Required +
    +
    +
    +
    +
    Header parameters
    + + + + + + + + + +
    NameDescription
    Xero-Tenant-Id* + + +
    +
    +
    + + String + + +
    +Xero identifier for Tenant +
    +
    +
    + Required +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    deleteEmployeeSalaryAndWage

    +

    Deletes an employee's salary and wages record

    +
    +
    +
    +

    +

    +

    +
    +
    /Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}
    +

    +

    Usage and SDK Samples

    +

    + +
    + +
    +
    xero_client.set_token_set(user.token_set)
    +
    +xero_tenant_id = 'xeroTenantId_example'
    +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
    +salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    +
    +begin
    +  response = xero_client.accounting_api.delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id)
    +  return response
    +rescue XeroRuby::ApiError => e
    +  puts "Exception when calling delete_employee_salary_and_wage: #{e}"
    +end
    +
    +
    +
    +

    Scopes

    + + + + + + + +
    payroll.employeesGrant read-write access to payroll employees
    +

    Parameters

    +
    Path parameters
    + + + + + + + + + + + - + + + +
    NameDescription
    EmployeeID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Employee id for single object +
    +
    +
    + Required +
    +
    +
    +
    SalaryAndWagesID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Id for single salary and wages object
    @@ -7542,7 +8073,7 @@

    Parameters

    -
    +
    @@ -7565,11 +8096,11 @@

    Parameters


    -
    -
    +
    +
    -

    deleteEmployeeSalaryAndWage

    -

    Deletes an employee's salary and wages record

    +

    deleteEmployeeWorkingPattern

    +

    deletes employee's working patterns

    @@ -7577,28 +8108,28 @@

    deleteEmployeeSalaryAndWage


    -
    /Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}
    +
    /Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}

    Usage and SDK Samples

    -
    +
    xero_client.set_token_set(user.token_set)
     
     xero_tenant_id = 'xeroTenantId_example'
     employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
    -salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    +employee_working_pattern_id = '4ff1e5cc-9835-40d5-bb18-09f3b118db9c'
     
     begin
    -  response = xero_client.accounting_api.delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id)
    +  response = xero_client.accounting_api.delete_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id)
       return response
     rescue XeroRuby::ApiError => e
    -  puts "Exception when calling delete_employee_salary_and_wage: #{e}"
    +  puts "Exception when calling delete_employee_working_pattern: #{e}"
     end
     
    @@ -7623,7 +8154,7 @@

    Parameters

    -
    +
    @@ -7645,11 +8176,11 @@

    Parameters

    SalaryAndWagesID*
    EmployeeWorkingPatternID* -
    +
    @@ -7660,7 +8191,7 @@

    Parameters

    -Id for single salary and wages object +Employee working pattern id for single object
    @@ -7682,7 +8213,7 @@

    Parameters

    -
    +
    @@ -9075,7 +9606,7 @@

    getEmployeeOpeningBalances


    -
    /Employees/{EmployeeID}/openingBalances
    +
    /Employees/{EmployeeID}/OpeningBalances

    Usage and SDK Samples

    @@ -9820,6 +10351,269 @@

    Parameters

    +
    +
    +
    +
    +
    +
    +

    getEmployeeWorkingPattern

    +

    Retrieves employee's working patterns

    +
    +
    +
    +

    +

    +

    +
    +
    /Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}
    +

    +

    Usage and SDK Samples

    +

    + +
    + +
    +
    xero_client.set_token_set(user.token_set)
    +
    +xero_tenant_id = 'xeroTenantId_example'
    +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
    +employee_working_pattern_id = '4ff1e5cc-9835-40d5-bb18-09f3b118db9c'
    +
    +begin
    +  response = xero_client.accounting_api.get_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id)
    +  return response
    +rescue XeroRuby::ApiError => e
    +  puts "Exception when calling get_employee_working_pattern: #{e}"
    +end
    +
    +
    +
    +

    Scopes

    + + + + + + + + + + + + +
    payroll.employeesGrant read-write access to payroll employees
    payroll.employees.readGrant read-only access to payroll employees
    +

    Parameters

    +
    Path parameters
    + + + + + + + + + + + + + +
    NameDescription
    EmployeeID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Employee id for single object +
    +
    +
    + Required +
    +
    +
    +
    EmployeeWorkingPatternID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Employee working pattern id for single object +
    +
    +
    + Required +
    +
    +
    +
    +
    Header parameters
    + + + + + + + + + +
    NameDescription
    Xero-Tenant-Id* + + +
    +
    +
    + + String + + +
    +Xero identifier for Tenant +
    +
    +
    + Required +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    getEmployeeWorkingPatterns

    +

    Retrieves employee's working patterns

    +
    +
    +
    +

    +

    +

    +
    +
    /Employees/{EmployeeID}/Working-Patterns
    +

    +

    Usage and SDK Samples

    +

    + +
    + +
    +
    xero_client.set_token_set(user.token_set)
    +
    +xero_tenant_id = 'xeroTenantId_example'
    +employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
    +
    +begin
    +  response = xero_client.accounting_api.get_employee_working_patterns(xero_tenant_id, employee_id)
    +  return response
    +rescue XeroRuby::ApiError => e
    +  puts "Exception when calling get_employee_working_patterns: #{e}"
    +end
    +
    +
    +
    +

    Scopes

    + + + + + + + + + + + + +
    payroll.employeesGrant read-write access to payroll employees
    payroll.employees.readGrant read-only access to payroll employees
    +

    Parameters

    +
    Path parameters
    + + + + + + + + + +
    NameDescription
    EmployeeID* + + +
    +
    +
    + + UUID + + + (uuid) + + +
    +Employee id for single object +
    +
    +
    + Required +
    +
    +
    +
    +
    Header parameters
    + + + + + + +
    NameDescription
    Xero-Tenant-Id* + + +
    +
    +
    + + String + + +
    +Xero identifier for Tenant +
    +
    +
    + Required +
    +
    +
    +
    @@ -12472,7 +13266,7 @@

    updateEmployeeEarningsTemplate


    -
    /Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}
    +
    /Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}

    Usage and SDK Samples

    diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index 8471a9a1..c133fa84 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -218,6 +218,11 @@ 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/employee_working_pattern' +require 'xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks' +require 'xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object' +require 'xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request' +require 'xero-ruby/models/payroll_nz/employee_working_patterns_object' require 'xero-ruby/models/payroll_nz/employees' require 'xero-ruby/models/payroll_nz/employment' require 'xero-ruby/models/payroll_nz/employment_object' @@ -271,6 +276,7 @@ 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_nz/working_week' require 'xero-ruby/models/payroll_au/api_exception' require 'xero-ruby/models/payroll_au/account' require 'xero-ruby/models/payroll_au/account_type' diff --git a/lib/xero-ruby/api/payroll_nz_api.rb b/lib/xero-ruby/api/payroll_nz_api.rb index c31f0be0..0c5adeaf 100644 --- a/lib/xero-ruby/api/payroll_nz_api.rb +++ b/lib/xero-ruby/api/payroll_nz_api.rb @@ -371,7 +371,7 @@ def create_employee_earnings_template_with_http_info(xero_tenant_id, employee_id 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) + 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? @@ -543,7 +543,7 @@ def create_employee_leave_setup_with_http_info(xero_tenant_id, employee_id, empl 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) + 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? @@ -715,7 +715,7 @@ def create_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, 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) + 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? @@ -936,6 +936,92 @@ def create_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, return data, status_code, headers end + # Creates an employee working pattern + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_with_working_weeks_request [EmployeeWorkingPatternWithWorkingWeeksRequest] + # @param [Hash] opts the optional parameters + # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + # @return [EmployeeWorkingPatternWithWorkingWeeksObject] + def create_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_with_working_weeks_request, opts = {}) + data, _status_code, _headers = create_employee_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_with_working_weeks_request, opts) + data + end + + # Creates an employee working pattern + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_with_working_weeks_request [EmployeeWorkingPatternWithWorkingWeeksRequest] + # @param [Hash] opts the optional parameters + # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + # @return [Array<(EmployeeWorkingPatternWithWorkingWeeksObject, Integer, Hash)>] EmployeeWorkingPatternWithWorkingWeeksObject data, response status code and response headers + def create_employee_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_with_working_weeks_request, options = {}) + opts = options.dup + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.create_employee_working_pattern ...' + 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_working_pattern" + 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_working_pattern" + end + # verify the required parameter 'employee_working_pattern_with_working_weeks_request' is set + if @api_client.config.client_side_validation && employee_working_pattern_with_working_weeks_request.nil? + fail ArgumentError, "Missing the required parameter 'employee_working_pattern_with_working_weeks_request' when calling PayrollNzApi.create_employee_working_pattern" + end + # resource path + local_var_path = '/Employees/{EmployeeID}/Working-Patterns'.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 + header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employee_working_pattern_with_working_weeks_request) + + # return_type + return_type = opts[:return_type] || 'EmployeeWorkingPatternWithWorkingWeeksObject' + + # 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, "PayrollNzApi", new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#create_employee_working_pattern\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Creates an employment detail for a specific employee # @param xero_tenant_id [String] Xero identifier for Tenant # @param employee_id [String] Employee id for single object @@ -1139,7 +1225,7 @@ def create_multiple_employee_earnings_template_with_http_info(xero_tenant_id, em 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) + 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? @@ -1709,7 +1795,7 @@ def delete_employee_earnings_template_with_http_info(xero_tenant_id, employee_id 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) + 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? @@ -1917,6 +2003,87 @@ def delete_employee_salary_and_wage_with_http_info(xero_tenant_id, employee_id, return data, status_code, headers end + # deletes employee's working patterns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_id [String] Employee working pattern id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeLeaveObject] + def delete_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id, opts = {}) + data, _status_code, _headers = delete_employee_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_id, opts) + data + end + + # deletes employee's working patterns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_id [String] Employee working pattern 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_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_id, options = {}) + opts = options.dup + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.delete_employee_working_pattern ...' + 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_working_pattern" + 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_working_pattern" + end + # verify the required parameter 'employee_working_pattern_id' is set + if @api_client.config.client_side_validation && employee_working_pattern_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_working_pattern_id' when calling PayrollNzApi.delete_employee_working_pattern" + end + # resource path + local_var_path = '/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}'.sub('{' + 'EmployeeID' + '}', employee_id.to_s).sub('{' + 'EmployeeWorkingPatternID' + '}', employee_working_pattern_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, "PayrollNzApi", new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#delete_employee_working_pattern\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Deletes a timesheet # @param xero_tenant_id [String] Xero identifier for Tenant # @param timesheet_id [String] Identifier for the timesheet @@ -2777,7 +2944,7 @@ def get_employee_opening_balances_with_http_info(xero_tenant_id, employee_id, op 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) + 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? @@ -3207,6 +3374,162 @@ def get_employee_tax_with_http_info(xero_tenant_id, employee_id, options = {}) return data, status_code, headers end + # Retrieves employee's working patterns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_id [String] Employee working pattern id for single object + # @param [Hash] opts the optional parameters + # @return [EmployeeWorkingPatternWithWorkingWeeksObject] + def get_employee_working_pattern(xero_tenant_id, employee_id, employee_working_pattern_id, opts = {}) + data, _status_code, _headers = get_employee_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_id, opts) + data + end + + # Retrieves employee's working patterns + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Employee id for single object + # @param employee_working_pattern_id [String] Employee working pattern id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(EmployeeWorkingPatternWithWorkingWeeksObject, Integer, Hash)>] EmployeeWorkingPatternWithWorkingWeeksObject data, response status code and response headers + def get_employee_working_pattern_with_http_info(xero_tenant_id, employee_id, employee_working_pattern_id, options = {}) + opts = options.dup + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_working_pattern ...' + 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_working_pattern" + 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_working_pattern" + end + # verify the required parameter 'employee_working_pattern_id' is set + if @api_client.config.client_side_validation && employee_working_pattern_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_working_pattern_id' when calling PayrollNzApi.get_employee_working_pattern" + end + # resource path + local_var_path = '/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}'.sub('{' + 'EmployeeID' + '}', employee_id.to_s).sub('{' + 'EmployeeWorkingPatternID' + '}', employee_working_pattern_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] || 'EmployeeWorkingPatternWithWorkingWeeksObject' + + # 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, "PayrollNzApi", new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_working_pattern\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieves employee's working patterns + # @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 [EmployeeWorkingPatternsObject] + def get_employee_working_patterns(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_working_patterns_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # Retrieves employee's working patterns + # @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<(EmployeeWorkingPatternsObject, Integer, Hash)>] EmployeeWorkingPatternsObject data, response status code and response headers + def get_employee_working_patterns_with_http_info(xero_tenant_id, employee_id, options = {}) + opts = options.dup + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PayrollNzApi.get_employee_working_patterns ...' + 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_working_patterns" + 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_working_patterns" + end + # resource path + local_var_path = '/Employees/{EmployeeID}/Working-Patterns'.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] || 'EmployeeWorkingPatternsObject' + + # 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, "PayrollNzApi", new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PayrollNzApi#get_employee_working_patterns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Retrieves employees # @param xero_tenant_id [String] Xero identifier for Tenant # @param [Hash] opts the optional parameters @@ -4835,7 +5158,7 @@ def update_employee_earnings_template_with_http_info(xero_tenant_id, employee_id 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) + 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? diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb index c344d3e6..65826849 100644 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -19,6 +19,9 @@ class BankTransactions attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :bank_transactions @@ -26,6 +29,7 @@ class BankTransactions def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'bank_transactions' => :'BankTransactions' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'bank_transactions' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'bank_transactions') if (value = attributes[:'bank_transactions']).is_a?(Array) self.bank_transactions = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && bank_transactions == o.bank_transactions end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, bank_transactions].hash + [pagination, warnings, bank_transactions].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb index 36de103c..5ec55080 100644 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -19,6 +19,9 @@ class Contacts attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :contacts @@ -26,6 +29,7 @@ class Contacts def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'contacts' => :'Contacts' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'contacts' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'contacts') if (value = attributes[:'contacts']).is_a?(Array) self.contacts = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && contacts == o.contacts end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, contacts].hash + [pagination, warnings, contacts].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb index 0a19549d..8134e3f4 100644 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -19,6 +19,9 @@ class CreditNotes attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :credit_notes @@ -26,6 +29,7 @@ class CreditNotes def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'credit_notes' => :'CreditNotes' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'credit_notes' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'credit_notes') if (value = attributes[:'credit_notes']).is_a?(Array) self.credit_notes = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && credit_notes == o.credit_notes end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, credit_notes].hash + [pagination, warnings, credit_notes].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb index dac9cfeb..11c59b3b 100644 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -19,6 +19,9 @@ class Invoices attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :invoices @@ -26,6 +29,7 @@ class Invoices def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'invoices' => :'Invoices' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'invoices' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'invoices') if (value = attributes[:'invoices']).is_a?(Array) self.invoices = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && invoices == o.invoices end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, invoices].hash + [pagination, warnings, invoices].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb index 93796fa3..f4ca1b6a 100644 --- a/lib/xero-ruby/models/accounting/journals.rb +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -16,12 +16,16 @@ module XeroRuby::Accounting require 'bigdecimal' class Journals + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :journals # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'warnings' => :'Warnings', :'journals' => :'Journals' } end @@ -29,6 +33,7 @@ def self.attribute_map # Attribute type mapping. def self.openapi_types { + :'warnings' => :'Array', :'journals' => :'Array' } end @@ -48,6 +53,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'journals') if (value = attributes[:'journals']).is_a?(Array) self.journals = value @@ -73,6 +84,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + warnings == o.warnings && journals == o.journals end @@ -85,7 +97,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [journals].hash + [warnings, journals].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb index 620a4901..998312b3 100644 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -19,6 +19,9 @@ class ManualJournals attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :manual_journals @@ -26,6 +29,7 @@ class ManualJournals def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'manual_journals' => :'ManualJournals' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'manual_journals' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'manual_journals') if (value = attributes[:'manual_journals']).is_a?(Array) self.manual_journals = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && manual_journals == o.manual_journals end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, manual_journals].hash + [pagination, warnings, manual_journals].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb index 53ddca92..98314874 100644 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -19,6 +19,9 @@ class Overpayments attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :overpayments @@ -26,6 +29,7 @@ class Overpayments def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'overpayments' => :'Overpayments' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'overpayments' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'overpayments') if (value = attributes[:'overpayments']).is_a?(Array) self.overpayments = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && overpayments == o.overpayments end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, overpayments].hash + [pagination, warnings, overpayments].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb index 51ddedc5..ce10c6c3 100644 --- a/lib/xero-ruby/models/accounting/payments.rb +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -19,6 +19,9 @@ class Payments attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :payments @@ -26,6 +29,7 @@ class Payments def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'payments' => :'Payments' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'payments' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'payments') if (value = attributes[:'payments']).is_a?(Array) self.payments = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && payments == o.payments end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, payments].hash + [pagination, warnings, payments].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb index 224b80b5..3dfe384b 100644 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -19,6 +19,9 @@ class Prepayments attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :prepayments @@ -26,6 +29,7 @@ class Prepayments def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'prepayments' => :'Prepayments' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'prepayments' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'prepayments') if (value = attributes[:'prepayments']).is_a?(Array) self.prepayments = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && prepayments == o.prepayments end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, prepayments].hash + [pagination, warnings, prepayments].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb index bf288bfc..b4d8f8ec 100644 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -19,6 +19,9 @@ class PurchaseOrders attr_accessor :pagination + # Displays array of warning messages from the API + attr_accessor :warnings + attr_accessor :purchase_orders @@ -26,6 +29,7 @@ class PurchaseOrders def self.attribute_map { :'pagination' => :'pagination', + :'warnings' => :'Warnings', :'purchase_orders' => :'PurchaseOrders' } end @@ -34,6 +38,7 @@ def self.attribute_map def self.openapi_types { :'pagination' => :'Pagination', + :'warnings' => :'Array', :'purchase_orders' => :'Array' } end @@ -57,6 +62,12 @@ def initialize(attributes = {}) self.pagination = attributes[:'pagination'] end + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + if attributes.key?(:'purchase_orders') if (value = attributes[:'purchase_orders']).is_a?(Array) self.purchase_orders = value @@ -83,6 +94,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && pagination == o.pagination && + warnings == o.warnings && purchase_orders == o.purchase_orders end @@ -95,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [pagination, purchase_orders].hash + [pagination, warnings, purchase_orders].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/payroll_nz/employee.rb b/lib/xero-ruby/models/payroll_nz/employee.rb index 5df4bf94..301462e6 100644 --- a/lib/xero-ruby/models/payroll_nz/employee.rb +++ b/lib/xero-ruby/models/payroll_nz/employee.rb @@ -63,6 +63,12 @@ class Employee # Employee's job title attr_accessor :job_title + # Engagement type of the employee + attr_accessor :engagement_type + + # End date for an employee with a fixed-term engagement type + attr_accessor :fixed_term_end_date + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -102,7 +108,9 @@ def self.attribute_map :'payroll_calendar_id' => :'payrollCalendarID', :'updated_date_utc' => :'updatedDateUTC', :'created_date_utc' => :'createdDateUTC', - :'job_title' => :'jobTitle' + :'job_title' => :'jobTitle', + :'engagement_type' => :'engagementType', + :'fixed_term_end_date' => :'fixedTermEndDate' } end @@ -123,7 +131,9 @@ def self.openapi_types :'payroll_calendar_id' => :'String', :'updated_date_utc' => :'DateTime', :'created_date_utc' => :'DateTime', - :'job_title' => :'String' + :'job_title' => :'String', + :'engagement_type' => :'String', + :'fixed_term_end_date' => :'Date' } end @@ -201,6 +211,14 @@ def initialize(attributes = {}) if attributes.key?(:'job_title') self.job_title = attributes[:'job_title'] end + + if attributes.key?(:'engagement_type') + self.engagement_type = attributes[:'engagement_type'] + end + + if attributes.key?(:'fixed_term_end_date') + self.fixed_term_end_date = attributes[:'fixed_term_end_date'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -247,7 +265,9 @@ def ==(o) payroll_calendar_id == o.payroll_calendar_id && updated_date_utc == o.updated_date_utc && created_date_utc == o.created_date_utc && - job_title == o.job_title + job_title == o.job_title && + engagement_type == o.engagement_type && + fixed_term_end_date == o.fixed_term_end_date end # @see the `==` method @@ -259,7 +279,7 @@ def eql?(o) # 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, job_title].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, job_title, engagement_type, fixed_term_end_date].hash end # Builds the object from hash 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 4f11d508..d6a97330 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb @@ -37,6 +37,12 @@ class EmployeeLeaveSetup # Initial sick leave balance. This will be positive unless they've taken sick leave in advance attr_accessor :sick_leave_opening_balance + # Set Schedule of Accrual Type for Sick Leave + attr_accessor :sick_leave_schedule_of_accrual + + # If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave + attr_accessor :sick_leave_anniversary_date + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -46,7 +52,9 @@ def self.attribute_map :'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' + :'sick_leave_opening_balance' => :'sickLeaveOpeningBalance', + :'sick_leave_schedule_of_accrual' => :'SickLeaveScheduleOfAccrual', + :'sick_leave_anniversary_date' => :'SickLeaveAnniversaryDate' } end @@ -59,7 +67,9 @@ def self.openapi_types :'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' + :'sick_leave_opening_balance' => :'BigDecimal', + :'sick_leave_schedule_of_accrual' => :'String', + :'sick_leave_anniversary_date' => :'Date' } end @@ -105,6 +115,14 @@ def initialize(attributes = {}) if attributes.key?(:'sick_leave_opening_balance') self.sick_leave_opening_balance = attributes[:'sick_leave_opening_balance'] end + + if attributes.key?(:'sick_leave_schedule_of_accrual') + self.sick_leave_schedule_of_accrual = attributes[:'sick_leave_schedule_of_accrual'] + end + + if attributes.key?(:'sick_leave_anniversary_date') + self.sick_leave_anniversary_date = attributes[:'sick_leave_anniversary_date'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -131,7 +149,9 @@ def ==(o) 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 + sick_leave_opening_balance == o.sick_leave_opening_balance && + sick_leave_schedule_of_accrual == o.sick_leave_schedule_of_accrual && + sick_leave_anniversary_date == o.sick_leave_anniversary_date end # @see the `==` method @@ -143,7 +163,7 @@ def eql?(o) # 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 + [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, sick_leave_schedule_of_accrual, sick_leave_anniversary_date].hash end # Builds the object from hash 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 ce73a60d..7b8a98cb 100644 --- a/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +++ b/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb @@ -50,6 +50,9 @@ class EmployeeLeaveType # Specific to Annual Leave. Annual leave balance in dollars attr_accessor :annual_leave_total_amount_paid + # The date when an employee becomes entitled to their accrual. + attr_accessor :schedule_of_accrual_date + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -84,7 +87,8 @@ def self.attribute_map :'percentage_of_gross_earnings' => :'percentageOfGrossEarnings', :'include_holiday_pay_every_pay' => :'includeHolidayPayEveryPay', :'show_annual_leave_in_advance' => :'showAnnualLeaveInAdvance', - :'annual_leave_total_amount_paid' => :'annualLeaveTotalAmountPaid' + :'annual_leave_total_amount_paid' => :'annualLeaveTotalAmountPaid', + :'schedule_of_accrual_date' => :'scheduleOfAccrualDate' } end @@ -100,7 +104,8 @@ def self.openapi_types :'percentage_of_gross_earnings' => :'BigDecimal', :'include_holiday_pay_every_pay' => :'Boolean', :'show_annual_leave_in_advance' => :'Boolean', - :'annual_leave_total_amount_paid' => :'BigDecimal' + :'annual_leave_total_amount_paid' => :'BigDecimal', + :'schedule_of_accrual_date' => :'Date' } end @@ -158,6 +163,10 @@ def initialize(attributes = {}) if attributes.key?(:'annual_leave_total_amount_paid') self.annual_leave_total_amount_paid = attributes[:'annual_leave_total_amount_paid'] end + + if attributes.key?(:'schedule_of_accrual_date') + self.schedule_of_accrual_date = attributes[:'schedule_of_accrual_date'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -199,7 +208,8 @@ def ==(o) 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 + annual_leave_total_amount_paid == o.annual_leave_total_amount_paid && + schedule_of_accrual_date == o.schedule_of_accrual_date end # @see the `==` method @@ -211,7 +221,7 @@ def eql?(o) # 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 + [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, schedule_of_accrual_date].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb b/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb new file mode 100644 index 00000000..5dd5bb08 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb @@ -0,0 +1,242 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 EmployeeWorkingPattern + # The Xero identifier for for Employee working pattern + attr_accessor :payee_working_pattern_id + + # The effective date of the corresponding salary and wages + attr_accessor :effective_from + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payee_working_pattern_id' => :'payeeWorkingPatternID', + :'effective_from' => :'effectiveFrom' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payee_working_pattern_id' => :'String', + :'effective_from' => :'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::EmployeeWorkingPattern` 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::EmployeeWorkingPattern`. 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?(:'payee_working_pattern_id') + self.payee_working_pattern_id = attributes[:'payee_working_pattern_id'] + end + + if attributes.key?(:'effective_from') + self.effective_from = attributes[:'effective_from'] + 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 @payee_working_pattern_id.nil? + invalid_properties.push('invalid value for "payee_working_pattern_id", payee_working_pattern_id cannot be nil.') + end + + if @effective_from.nil? + invalid_properties.push('invalid value for "effective_from", effective_from 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 @payee_working_pattern_id.nil? + return false if @effective_from.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 && + payee_working_pattern_id == o.payee_working_pattern_id && + effective_from == o.effective_from + 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 + [payee_working_pattern_id, effective_from].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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb new file mode 100644 index 00000000..b368cdeb --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb @@ -0,0 +1,254 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 EmployeeWorkingPatternWithWorkingWeeks + # The Xero identifier for for Employee working pattern + attr_accessor :payee_working_pattern_id + + # The effective date of the corresponding salary and wages + attr_accessor :effective_from + + + attr_accessor :working_weeks + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payee_working_pattern_id' => :'payeeWorkingPatternID', + :'effective_from' => :'effectiveFrom', + :'working_weeks' => :'workingWeeks' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payee_working_pattern_id' => :'String', + :'effective_from' => :'Date', + :'working_weeks' => :'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::EmployeeWorkingPatternWithWorkingWeeks` 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::EmployeeWorkingPatternWithWorkingWeeks`. 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?(:'payee_working_pattern_id') + self.payee_working_pattern_id = attributes[:'payee_working_pattern_id'] + end + + if attributes.key?(:'effective_from') + self.effective_from = attributes[:'effective_from'] + end + + if attributes.key?(:'working_weeks') + if (value = attributes[:'working_weeks']).is_a?(Array) + self.working_weeks = 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 @payee_working_pattern_id.nil? + invalid_properties.push('invalid value for "payee_working_pattern_id", payee_working_pattern_id cannot be nil.') + end + + if @effective_from.nil? + invalid_properties.push('invalid value for "effective_from", effective_from 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 @payee_working_pattern_id.nil? + return false if @effective_from.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 && + payee_working_pattern_id == o.payee_working_pattern_id && + effective_from == o.effective_from && + working_weeks == o.working_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 + [payee_working_pattern_id, effective_from, working_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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb new file mode 100644 index 00000000..0c383ee6 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb @@ -0,0 +1,242 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 EmployeeWorkingPatternWithWorkingWeeksObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :payee_working_pattern + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'payee_working_pattern' => :'payeeWorkingPattern' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'payee_working_pattern' => :'EmployeeWorkingPatternWithWorkingWeeks' + } + 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::EmployeeWorkingPatternWithWorkingWeeksObject` 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::EmployeeWorkingPatternWithWorkingWeeksObject`. 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?(:'payee_working_pattern') + self.payee_working_pattern = attributes[:'payee_working_pattern'] + 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 && + payee_working_pattern == o.payee_working_pattern + 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, payee_working_pattern].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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb new file mode 100644 index 00000000..a69bb708 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb @@ -0,0 +1,244 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 EmployeeWorkingPatternWithWorkingWeeksRequest + # The effective date of the corresponding salary and wages + attr_accessor :effective_from + + + attr_accessor :working_weeks + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'effective_from' => :'effectiveFrom', + :'working_weeks' => :'workingWeeks' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'effective_from' => :'Date', + :'working_weeks' => :'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::EmployeeWorkingPatternWithWorkingWeeksRequest` 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::EmployeeWorkingPatternWithWorkingWeeksRequest`. 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?(:'effective_from') + self.effective_from = attributes[:'effective_from'] + end + + if attributes.key?(:'working_weeks') + if (value = attributes[:'working_weeks']).is_a?(Array) + self.working_weeks = 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 @effective_from.nil? + invalid_properties.push('invalid value for "effective_from", effective_from cannot be nil.') + end + + if @working_weeks.nil? + invalid_properties.push('invalid value for "working_weeks", working_weeks 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 @effective_from.nil? + return false if @working_weeks.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 && + effective_from == o.effective_from && + working_weeks == o.working_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 + [effective_from, working_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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb b/lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb new file mode 100644 index 00000000..e2db1873 --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb @@ -0,0 +1,244 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 EmployeeWorkingPatternsObject + + attr_accessor :pagination + + + attr_accessor :problem + + + attr_accessor :payee_working_patterns + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'problem' => :'problem', + :'payee_working_patterns' => :'payeeWorkingPatterns' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'problem' => :'Problem', + :'payee_working_patterns' => :'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::EmployeeWorkingPatternsObject` 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::EmployeeWorkingPatternsObject`. 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?(:'payee_working_patterns') + if (value = attributes[:'payee_working_patterns']).is_a?(Array) + self.payee_working_patterns = 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 && + payee_working_patterns == o.payee_working_patterns + 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, payee_working_patterns].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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/models/payroll_nz/employment.rb b/lib/xero-ruby/models/payroll_nz/employment.rb index f0cf7fce..4440c52c 100644 --- a/lib/xero-ruby/models/payroll_nz/employment.rb +++ b/lib/xero-ruby/models/payroll_nz/employment.rb @@ -25,12 +25,20 @@ class Employment # Start date of the employment (YYYY-MM-DD) attr_accessor :start_date + # Engagement type of the employee + attr_accessor :engagement_type + + # End date for an employee with a fixed-term engagement type + attr_accessor :fixed_term_end_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' + :'start_date' => :'startDate', + :'engagement_type' => :'engagementType', + :'fixed_term_end_date' => :'fixedTermEndDate' } end @@ -39,7 +47,9 @@ def self.openapi_types { :'payroll_calendar_id' => :'String', :'pay_run_calendar_id' => :'String', - :'start_date' => :'Date' + :'start_date' => :'Date', + :'engagement_type' => :'String', + :'fixed_term_end_date' => :'Date' } end @@ -69,6 +79,14 @@ def initialize(attributes = {}) if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end + + if attributes.key?(:'engagement_type') + self.engagement_type = attributes[:'engagement_type'] + end + + if attributes.key?(:'fixed_term_end_date') + self.fixed_term_end_date = attributes[:'fixed_term_end_date'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -91,7 +109,9 @@ def ==(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 + start_date == o.start_date && + engagement_type == o.engagement_type && + fixed_term_end_date == o.fixed_term_end_date end # @see the `==` method @@ -103,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [payroll_calendar_id, pay_run_calendar_id, start_date].hash + [payroll_calendar_id, pay_run_calendar_id, start_date, engagement_type, fixed_term_end_date].hash end # Builds the object from hash 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 f38f52ee..c8765f41 100644 --- a/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +++ b/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb @@ -51,6 +51,11 @@ class SalaryAndWage SALARY ||= "Salary".freeze HOURLY ||= "Hourly".freeze + # The type of the Working Pattern of the corresponding salary and wages + attr_accessor :work_pattern_type + DAYS_AND_HOURS ||= "DaysAndHours".freeze + REGULAR_WEEK ||= "RegularWeek".freeze + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -85,7 +90,8 @@ def self.attribute_map :'effective_from' => :'effectiveFrom', :'annual_salary' => :'annualSalary', :'status' => :'status', - :'payment_type' => :'paymentType' + :'payment_type' => :'paymentType', + :'work_pattern_type' => :'workPatternType' } end @@ -101,7 +107,8 @@ def self.openapi_types :'effective_from' => :'Date', :'annual_salary' => :'BigDecimal', :'status' => :'String', - :'payment_type' => :'String' + :'payment_type' => :'String', + :'work_pattern_type' => :'String' } end @@ -159,6 +166,10 @@ def initialize(attributes = {}) if attributes.key?(:'payment_type') self.payment_type = attributes[:'payment_type'] end + + if attributes.key?(:'work_pattern_type') + self.work_pattern_type = attributes[:'work_pattern_type'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -210,6 +221,8 @@ def valid? return false if @payment_type.nil? payment_type_validator = EnumAttributeValidator.new('String', ["Salary", "Hourly"]) return false unless payment_type_validator.valid?(@payment_type) + work_pattern_type_validator = EnumAttributeValidator.new('String', ["DaysAndHours", "RegularWeek"]) + return false unless work_pattern_type_validator.valid?(@work_pattern_type) true end @@ -233,6 +246,16 @@ def payment_type=(payment_type) @payment_type = payment_type end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] work_pattern_type Object to be assigned + def work_pattern_type=(work_pattern_type) + validator = EnumAttributeValidator.new('String', ["DaysAndHours", "RegularWeek"]) + unless validator.valid?(work_pattern_type) + fail ArgumentError, "invalid value for \"work_pattern_type\", must be one of #{validator.allowable_values}." + end + @work_pattern_type = work_pattern_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -247,7 +270,8 @@ def ==(o) effective_from == o.effective_from && annual_salary == o.annual_salary && status == o.status && - payment_type == o.payment_type + payment_type == o.payment_type && + work_pattern_type == o.work_pattern_type end # @see the `==` method @@ -259,7 +283,7 @@ def eql?(o) # 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 + [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, work_pattern_type].hash end # Builds the object from hash diff --git a/lib/xero-ruby/models/payroll_nz/working_week.rb b/lib/xero-ruby/models/payroll_nz/working_week.rb new file mode 100644 index 00000000..52c4061e --- /dev/null +++ b/lib/xero-ruby/models/payroll_nz/working_week.rb @@ -0,0 +1,317 @@ +=begin +#Xero Payroll NZ + +#This is the Xero Payroll API for orgs in the NZ region. + +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 WorkingWeek + # The number of hours worked on a Monday + attr_accessor :monday + + # The number of hours worked on a Tuesday + attr_accessor :tuesday + + # The number of hours worked on a Wednesday + attr_accessor :wednesday + + # The number of hours worked on a Thursday + attr_accessor :thursday + + # The number of hours worked on a Friday + attr_accessor :friday + + # The number of hours worked on a Saturday + attr_accessor :saturday + + # The number of hours worked on a Sunday + attr_accessor :sunday + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'monday' => :'monday', + :'tuesday' => :'tuesday', + :'wednesday' => :'wednesday', + :'thursday' => :'thursday', + :'friday' => :'friday', + :'saturday' => :'saturday', + :'sunday' => :'sunday' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'monday' => :'BigDecimal', + :'tuesday' => :'BigDecimal', + :'wednesday' => :'BigDecimal', + :'thursday' => :'BigDecimal', + :'friday' => :'BigDecimal', + :'saturday' => :'BigDecimal', + :'sunday' => :'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::WorkingWeek` 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::WorkingWeek`. 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?(:'monday') + self.monday = attributes[:'monday'] + end + + if attributes.key?(:'tuesday') + self.tuesday = attributes[:'tuesday'] + end + + if attributes.key?(:'wednesday') + self.wednesday = attributes[:'wednesday'] + end + + if attributes.key?(:'thursday') + self.thursday = attributes[:'thursday'] + end + + if attributes.key?(:'friday') + self.friday = attributes[:'friday'] + end + + if attributes.key?(:'saturday') + self.saturday = attributes[:'saturday'] + end + + if attributes.key?(:'sunday') + self.sunday = attributes[:'sunday'] + 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 @monday.nil? + invalid_properties.push('invalid value for "monday", monday cannot be nil.') + end + + if @tuesday.nil? + invalid_properties.push('invalid value for "tuesday", tuesday cannot be nil.') + end + + if @wednesday.nil? + invalid_properties.push('invalid value for "wednesday", wednesday cannot be nil.') + end + + if @thursday.nil? + invalid_properties.push('invalid value for "thursday", thursday cannot be nil.') + end + + if @friday.nil? + invalid_properties.push('invalid value for "friday", friday cannot be nil.') + end + + if @saturday.nil? + invalid_properties.push('invalid value for "saturday", saturday cannot be nil.') + end + + if @sunday.nil? + invalid_properties.push('invalid value for "sunday", sunday 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 @monday.nil? + return false if @tuesday.nil? + return false if @wednesday.nil? + return false if @thursday.nil? + return false if @friday.nil? + return false if @saturday.nil? + return false if @sunday.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 && + monday == o.monday && + tuesday == o.tuesday && + wednesday == o.wednesday && + thursday == o.thursday && + friday == o.friday && + saturday == o.saturday && + sunday == o.sunday + 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 + [monday, tuesday, wednesday, thursday, friday, saturday, sunday].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(downcase: false) + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + key = downcase ? attr : param + hash[key] = _to_hash(value, downcase: downcase) + end + hash + end + + # Returns the object in the form of hash with snake_case + def to_attributes + to_hash(downcase: true) + 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, downcase: false) + if value.is_a?(Array) + value.map do |v| + v.to_hash(downcase: downcase) + end + elsif value.is_a?(Hash) + {}.tap do |hash| + value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) } + end + elsif value.respond_to? :to_hash + value.to_hash(downcase: downcase) + else + value + end + end + + def parse_date(datestring) + if datestring.include?('Date') + date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\// + original, date, timezone = *date_pattern.match(datestring) + date = (date.to_i / 1000) + Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s + elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD + Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s + else # handle date 'types' for small subset of payroll API's + Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s + end + end + end +end diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index 079a7984..9210131f 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -7,7 +7,7 @@ Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 -The version of the XeroOpenAPI document: 6.0.0 +The version of the XeroOpenAPI document: 6.0.1 =end module XeroRuby From 9f15f5935381d03a15e988afd74576a7b05b81ac Mon Sep 17 00:00:00 2001 From: sangeet-joy_xero Date: Sun, 4 Aug 2024 19:03:54 +0530 Subject: [PATCH 2/4] updated minor version --- Gemfile.lock | 2 +- docs/accounting/index.html | 2 +- docs/app_store/index.html | 2 +- docs/assets/index.html | 2 +- docs/files/index.html | 2 +- docs/finance/index.html | 2 +- docs/payroll_au/index.html | 2 +- docs/payroll_nz/index.html | 2 +- docs/payroll_uk/index.html | 2 +- docs/projects/index.html | 2 +- lib/xero-ruby/version.rb | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 20fb911c..fdfaf492 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - xero-ruby (7.0.0) + xero-ruby (9.0.0) faraday (>= 2.0, < 3.0) json (~> 2.1, >= 2.1.0) json-jwt (~> 1.16, >= 1.16.3) diff --git a/docs/accounting/index.html b/docs/accounting/index.html index da2fcd25..894ee70d 100644 --- a/docs/accounting/index.html +++ b/docs/accounting/index.html @@ -6216,7 +6216,7 @@