diff --git a/docs/v4/accounting/index.html b/docs/v4/accounting/index.html index 3378f1aa..85c714a7 100644 --- a/docs/v4/accounting/index.html +++ b/docs/v4/accounting/index.html @@ -6335,7 +6335,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods createAccount diff --git a/docs/v4/appstore/index.html b/docs/v4/appstore/index.html index aef8baae..8a3dbc41 100644 --- a/docs/v4/appstore/index.html +++ b/docs/v4/appstore/index.html @@ -1237,7 +1237,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods getSubscription diff --git a/docs/v4/assets/index.html b/docs/v4/assets/index.html index 0ff6c1cc..fbef76c6 100644 --- a/docs/v4/assets/index.html +++ b/docs/v4/assets/index.html @@ -1388,7 +1388,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods createAsset diff --git a/docs/v4/files/index.html b/docs/v4/files/index.html index 4f8c44a5..4fa5771f 100644 --- a/docs/v4/files/index.html +++ b/docs/v4/files/index.html @@ -1144,7 +1144,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods createFileAssociation diff --git a/docs/v4/finance/index.html b/docs/v4/finance/index.html index 43034eea..acd9b458 100644 --- a/docs/v4/finance/index.html +++ b/docs/v4/finance/index.html @@ -2712,7 +2712,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods getAccountingActivityAccountUsage diff --git a/docs/v4/payroll-au/index.html b/docs/v4/payroll-au/index.html index 7106e291..d5b45c3e 100644 --- a/docs/v4/payroll-au/index.html +++ b/docs/v4/payroll-au/index.html @@ -3411,7 +3411,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods approveLeaveApplication diff --git a/docs/v4/payroll-nz/index.html b/docs/v4/payroll-nz/index.html index 007c1930..809fb606 100644 --- a/docs/v4/payroll-nz/index.html +++ b/docs/v4/payroll-nz/index.html @@ -4083,7 +4083,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods approveTimesheet diff --git a/docs/v4/payroll-uk/index.html b/docs/v4/payroll-uk/index.html index a99f612c..898301e6 100644 --- a/docs/v4/payroll-uk/index.html +++ b/docs/v4/payroll-uk/index.html @@ -1593,6 +1593,16 @@ "format" : "date-time", "x-is-datetime" : true }, + "niCategory" : { + "$ref" : "#/components/schemas/NICategoryLetter" + }, + "niCategories" : { + "type" : "array", + "description" : "The employee's NI categories", + "items" : { + "$ref" : "#/components/schemas/NICategory" + } + }, "nationalInsuranceNumber" : { "type" : "string", "description" : "National insurance number of the employee", @@ -2260,7 +2270,7 @@ }; defs["Employment"] = { "title" : "", - "required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ], + "required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ], "type" : "object", "properties" : { "payrollCalendarID" : { @@ -2280,10 +2290,14 @@ "example" : "7" }, "niCategory" : { - "type" : "string", - "description" : "The NI Category of the employee", - "example" : "A", - "enum" : [ "A", "B", "C", "F", "H", "I", "J", "L", "M", "S", "V", "X", "Z" ] + "$ref" : "#/components/schemas/NICategoryLetter" + }, + "niCategories" : { + "type" : "array", + "description" : "The employee's NI categories", + "items" : { + "$ref" : "#/components/schemas/NICategory" + } } }, "description" : "" @@ -2500,6 +2514,75 @@ } }, "description" : "" +}; + defs["NICategory"] = { + "title" : "", + "required" : [ "niCategory", "workplacePostcode" ], + "type" : "object", + "properties" : { + "startDate" : { + "type" : "string", + "description" : "The start date of the NI category (YYYY-MM-DD)", + "format" : "date", + "example" : "2024-12-02", + "x-is-date" : true + }, + "niCategory" : { + "$ref" : "#/components/schemas/NICategoryLetter" + }, + "niCategoryID" : { + "type" : "number", + "description" : "Xero unique identifier for the NI category", + "example" : 15 + }, + "dateFirstEmployedAsCivilian" : { + "type" : "string", + "description" : "The date in which the employee was first employed as a civilian (YYYY-MM-DD)", + "format" : "date", + "example" : "2024-12-02", + "x-is-date" : true + }, + "workplacePostcode" : { + "type" : "string", + "description" : "The workplace postcode", + "example" : "SW1A 1AA" + } + }, + "description" : "", + "oneOf" : [ { + "$ref" : "#/components/schemas/NICategory_oneOf" + }, { + "$ref" : "#/components/schemas/NICategory_oneOf_1" + } ] +}; + defs["NICategoryLetter"] = { + "title" : "", + "type" : "string", + "description" : "The employee's NI Category letter.", + "example" : "I", + "enum" : [ "A", "B", "C", "D", "E", "F", "H", "I", "J", "K", "L", "M", "N", "S", "V", "X", "Z" ] +}; + defs["NICategory_oneOf"] = { + "title" : "", + "required" : [ "workplacePostcode" ], + "properties" : { + "niCategory" : { + "type" : "string", + "enum" : [ "F", "I", "L", "S", "N", "E", "D", "K" ] + } + }, + "description" : "" +}; + defs["NICategory_oneOf_1"] = { + "title" : "", + "required" : [ "dateFirstEmployedAsCivilian" ], + "properties" : { + "niCategory" : { + "type" : "string", + "enum" : [ "V" ] + } + }, + "description" : "" }; defs["Pagination"] = { "title" : "", @@ -3513,7 +3596,7 @@ SDK: - VSN: 9.1.0 + VSN: 10.0.0 Methods approveTimesheet @@ -5872,6 +5955,8 @@ Usage and SDK Samples Employment employment = new Employment(); employment.setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000")); employment.setStartDate(startDate); + + NICategories niCategories = new NICategories(); try { EmploymentObject result = apiInstance.createEmployment(accessToken, xeroTenantId, employeeID, employment, idempotencyKey); @@ -6006,7 +6091,7 @@ Parameters "schema" : { "$ref" : "#/components/schemas/Employment" }, - "example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"EmployeeNumber\": \"123ABC\", \"NICategory\": \"A\" }" + "example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"NICategories\": [ { \"NICategory\": \"A\", \"StartDate\": \"2020-05-01\" } ], \"EmployeeNumber\": \"123ABC\" }" } }, "required" : true diff --git a/pom.xml b/pom.xml index cc4735df..88e3193d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ xero-java jar xero-java - 9.1.0 + 10.0.0 https://github.com/XeroAPI/Xero-Java This is the official Java SDK for Xero API diff --git a/src/main/java/com/xero/api/client/AccountingApi.java b/src/main/java/com/xero/api/client/AccountingApi.java index d40fe7bf..36d5a9b0 100644 --- a/src/main/java/com/xero/api/client/AccountingApi.java +++ b/src/main/java/com/xero/api/client/AccountingApi.java @@ -2,7 +2,7 @@ * Xero Accounting API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -102,7 +102,7 @@ public class AccountingApi { private ApiClient apiClient; private static AccountingApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(AccountingApi.class); /** AccountingApi */ diff --git a/src/main/java/com/xero/api/client/AppStoreApi.java b/src/main/java/com/xero/api/client/AppStoreApi.java index 71be1f83..6d4cdb09 100644 --- a/src/main/java/com/xero/api/client/AppStoreApi.java +++ b/src/main/java/com/xero/api/client/AppStoreApi.java @@ -2,7 +2,7 @@ * Xero AppStore API * These endpoints are for Xero Partners to interact with the App Store Billing platform * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -46,7 +46,7 @@ public class AppStoreApi { private ApiClient apiClient; private static AppStoreApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(AppStoreApi.class); /** AppStoreApi */ diff --git a/src/main/java/com/xero/api/client/AssetApi.java b/src/main/java/com/xero/api/client/AssetApi.java index 48369d3b..3ab6c7fa 100644 --- a/src/main/java/com/xero/api/client/AssetApi.java +++ b/src/main/java/com/xero/api/client/AssetApi.java @@ -2,7 +2,7 @@ * Xero Assets API * The Assets API exposes fixed asset related functions of the Xero Accounting application and can be used for a variety of purposes such as creating assets, retrieving asset valuations etc. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ public class AssetApi { private ApiClient apiClient; private static AssetApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(AssetApi.class); /** AssetApi */ diff --git a/src/main/java/com/xero/api/client/BankFeedsApi.java b/src/main/java/com/xero/api/client/BankFeedsApi.java index 9a8ffb11..dc9a7fde 100644 --- a/src/main/java/com/xero/api/client/BankFeedsApi.java +++ b/src/main/java/com/xero/api/client/BankFeedsApi.java @@ -2,7 +2,7 @@ * Xero Bank Feeds API * The Bank Feeds API is a closed API that is only available to financial institutions that have an established financial services partnership with Xero. If you're an existing financial services partner that wants access, contact your local Partner Manager. If you're a financial institution who wants to provide bank feeds to your business customers, contact us to become a financial services partner. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -48,7 +48,7 @@ public class BankFeedsApi { private ApiClient apiClient; private static BankFeedsApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(BankFeedsApi.class); /** BankFeedsApi */ diff --git a/src/main/java/com/xero/api/client/FilesApi.java b/src/main/java/com/xero/api/client/FilesApi.java index 57c4c810..b691fe6c 100644 --- a/src/main/java/com/xero/api/client/FilesApi.java +++ b/src/main/java/com/xero/api/client/FilesApi.java @@ -2,7 +2,7 @@ * Xero Files API * These endpoints are specific to Xero Files API * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ public class FilesApi { private ApiClient apiClient; private static FilesApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(FilesApi.class); /** FilesApi */ diff --git a/src/main/java/com/xero/api/client/FinanceApi.java b/src/main/java/com/xero/api/client/FinanceApi.java index 926e6d57..a1d3258d 100644 --- a/src/main/java/com/xero/api/client/FinanceApi.java +++ b/src/main/java/com/xero/api/client/FinanceApi.java @@ -2,7 +2,7 @@ * Xero Finance API * The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ public class FinanceApi { private ApiClient apiClient; private static FinanceApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(FinanceApi.class); /** FinanceApi */ diff --git a/src/main/java/com/xero/api/client/IdentityApi.java b/src/main/java/com/xero/api/client/IdentityApi.java index 5621e75b..866a9d69 100644 --- a/src/main/java/com/xero/api/client/IdentityApi.java +++ b/src/main/java/com/xero/api/client/IdentityApi.java @@ -2,7 +2,7 @@ * Xero OAuth 2 Identity Service API * These endpoints are related to managing authentication tokens and identity for Xero API * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -45,7 +45,7 @@ public class IdentityApi { private ApiClient apiClient; private static IdentityApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(IdentityApi.class); /** IdentityApi */ diff --git a/src/main/java/com/xero/api/client/PayrollAuApi.java b/src/main/java/com/xero/api/client/PayrollAuApi.java index 974107ae..ae0b2742 100644 --- a/src/main/java/com/xero/api/client/PayrollAuApi.java +++ b/src/main/java/com/xero/api/client/PayrollAuApi.java @@ -2,7 +2,7 @@ * Xero Payroll AU API * This is the Xero Payroll API for orgs in Australia region. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -65,7 +65,7 @@ public class PayrollAuApi { private ApiClient apiClient; private static PayrollAuApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(PayrollAuApi.class); /** PayrollAuApi */ diff --git a/src/main/java/com/xero/api/client/PayrollNzApi.java b/src/main/java/com/xero/api/client/PayrollNzApi.java index 3745bf54..c84a431c 100644 --- a/src/main/java/com/xero/api/client/PayrollNzApi.java +++ b/src/main/java/com/xero/api/client/PayrollNzApi.java @@ -2,7 +2,7 @@ * Xero Payroll NZ * This is the Xero Payroll API for orgs in the NZ region. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -109,7 +109,7 @@ public class PayrollNzApi { private ApiClient apiClient; private static PayrollNzApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(PayrollNzApi.class); /** PayrollNzApi */ diff --git a/src/main/java/com/xero/api/client/PayrollUkApi.java b/src/main/java/com/xero/api/client/PayrollUkApi.java index d23859df..68b8e85d 100644 --- a/src/main/java/com/xero/api/client/PayrollUkApi.java +++ b/src/main/java/com/xero/api/client/PayrollUkApi.java @@ -2,7 +2,7 @@ * Xero Payroll UK * This is the Xero Payroll API for orgs in the UK region. * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -106,7 +106,7 @@ public class PayrollUkApi { private ApiClient apiClient; private static PayrollUkApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(PayrollUkApi.class); /** PayrollUkApi */ diff --git a/src/main/java/com/xero/api/client/ProjectApi.java b/src/main/java/com/xero/api/client/ProjectApi.java index b31ca0f7..6eac96fd 100644 --- a/src/main/java/com/xero/api/client/ProjectApi.java +++ b/src/main/java/com/xero/api/client/ProjectApi.java @@ -2,7 +2,7 @@ * Xero Projects API * This is the Xero Projects API * - * The version of the OpenAPI document: 7.1.0 + * The version of the OpenAPI document: 8.0.0 * Contact: api@xero.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -57,7 +57,7 @@ public class ProjectApi { private ApiClient apiClient; private static ProjectApi instance = null; private String userAgent = "Default"; - private String version = "9.1.0"; + private String version = "10.0.0"; static final Logger logger = LoggerFactory.getLogger(ProjectApi.class); /** ProjectApi */ diff --git a/src/main/java/com/xero/models/payrolluk/Employee.java b/src/main/java/com/xero/models/payrolluk/Employee.java index 392b266e..7436d3e8 100644 --- a/src/main/java/com/xero/models/payrolluk/Employee.java +++ b/src/main/java/com/xero/models/payrolluk/Employee.java @@ -16,6 +16,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.xero.api.StringUtil; import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -116,6 +118,12 @@ public static GenderEnum fromValue(String value) { @JsonProperty("createdDateUTC") private LocalDateTime createdDateUTC; + @JsonProperty("niCategory") + private NICategoryLetter niCategory; + + @JsonProperty("niCategories") + private List niCategories = new ArrayList(); + @JsonProperty("nationalInsuranceNumber") private String nationalInsuranceNumber; @@ -619,6 +627,90 @@ public void setCreatedDateUTC(LocalDateTime createdDateUTC) { this.createdDateUTC = createdDateUTC; } + /** + * niCategory + * + * @param niCategory NICategoryLetter + * @return Employee + */ + public Employee niCategory(NICategoryLetter niCategory) { + this.niCategory = niCategory; + return this; + } + + /** + * Get niCategory + * + * @return niCategory + */ + @ApiModelProperty(value = "") + /** + * niCategory + * + * @return niCategory NICategoryLetter + */ + public NICategoryLetter getNiCategory() { + return niCategory; + } + + /** + * niCategory + * + * @param niCategory NICategoryLetter + */ + public void setNiCategory(NICategoryLetter niCategory) { + this.niCategory = niCategory; + } + + /** + * The employee's NI categories + * + * @param niCategories List<NICategory> + * @return Employee + */ + public Employee niCategories(List niCategories) { + this.niCategories = niCategories; + return this; + } + + /** + * The employee's NI categories + * + * @param niCategoriesItem NICategory + * @return Employee + */ + public Employee addNiCategoriesItem(NICategory niCategoriesItem) { + if (this.niCategories == null) { + this.niCategories = new ArrayList(); + } + this.niCategories.add(niCategoriesItem); + return this; + } + + /** + * The employee's NI categories + * + * @return niCategories + */ + @ApiModelProperty(value = "The employee's NI categories") + /** + * The employee's NI categories + * + * @return niCategories List + */ + public List getNiCategories() { + return niCategories; + } + + /** + * The employee's NI categories + * + * @param niCategories List<NICategory> + */ + public void setNiCategories(List niCategories) { + this.niCategories = niCategories; + } + /** * National insurance number of the employee * @@ -712,6 +804,8 @@ public boolean equals(java.lang.Object o) { && Objects.equals(this.payrollCalendarID, employee.payrollCalendarID) && Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) && Objects.equals(this.createdDateUTC, employee.createdDateUTC) + && Objects.equals(this.niCategory, employee.niCategory) + && Objects.equals(this.niCategories, employee.niCategories) && Objects.equals(this.nationalInsuranceNumber, employee.nationalInsuranceNumber) && Objects.equals(this.isOffPayrollWorker, employee.isOffPayrollWorker); } @@ -733,6 +827,8 @@ public int hashCode() { payrollCalendarID, updatedDateUTC, createdDateUTC, + niCategory, + niCategories, nationalInsuranceNumber, isOffPayrollWorker); } @@ -755,6 +851,8 @@ public String toString() { sb.append(" payrollCalendarID: ").append(toIndentedString(payrollCalendarID)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" createdDateUTC: ").append(toIndentedString(createdDateUTC)).append("\n"); + sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n"); + sb.append(" niCategories: ").append(toIndentedString(niCategories)).append("\n"); sb.append(" nationalInsuranceNumber: ") .append(toIndentedString(nationalInsuranceNumber)) .append("\n"); diff --git a/src/main/java/com/xero/models/payrolluk/Employment.java b/src/main/java/com/xero/models/payrolluk/Employment.java index a4861f9b..a84dd200 100644 --- a/src/main/java/com/xero/models/payrolluk/Employment.java +++ b/src/main/java/com/xero/models/payrolluk/Employment.java @@ -11,11 +11,11 @@ package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; import com.xero.api.StringUtil; import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -32,91 +32,12 @@ public class Employment { @JsonProperty("employeeNumber") private String employeeNumber; - /** The NI Category of the employee */ - public enum NiCategoryEnum { - /** A */ - A("A"), - - /** B */ - B("B"), - - /** C */ - C("C"), - - /** F */ - F("F"), - - /** H */ - H("H"), - - /** I */ - I("I"), - - /** J */ - J("J"), - - /** L */ - L("L"), - - /** M */ - M("M"), - - /** S */ - S("S"), - - /** V */ - V("V"), - - /** X */ - X("X"), - - /** Z */ - Z("Z"); - - private String value; - - NiCategoryEnum(String value) { - this.value = value; - } - - /** - * getValue - * - * @return String value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * toString - * - * @return String value - */ - @Override - public String toString() { - return String.valueOf(value); - } - - /** - * fromValue - * - * @param value String - */ - @JsonCreator - public static NiCategoryEnum fromValue(String value) { - for (NiCategoryEnum b : NiCategoryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } @JsonProperty("niCategory") - private NiCategoryEnum niCategory; + private NICategoryLetter niCategory; + + @JsonProperty("niCategories") + private List niCategories = new ArrayList(); /** * Xero unique identifier for the payroll calendar of the employee * @@ -223,40 +144,89 @@ public void setEmployeeNumber(String employeeNumber) { } /** - * The NI Category of the employee + * niCategory * - * @param niCategory NiCategoryEnum + * @param niCategory NICategoryLetter * @return Employment */ - public Employment niCategory(NiCategoryEnum niCategory) { + public Employment niCategory(NICategoryLetter niCategory) { this.niCategory = niCategory; return this; } /** - * The NI Category of the employee + * Get niCategory * * @return niCategory */ - @ApiModelProperty(example = "A", value = "The NI Category of the employee") + @ApiModelProperty(value = "") /** - * The NI Category of the employee + * niCategory * - * @return niCategory NiCategoryEnum + * @return niCategory NICategoryLetter */ - public NiCategoryEnum getNiCategory() { + public NICategoryLetter getNiCategory() { return niCategory; } /** - * The NI Category of the employee + * niCategory * - * @param niCategory NiCategoryEnum + * @param niCategory NICategoryLetter */ - public void setNiCategory(NiCategoryEnum niCategory) { + public void setNiCategory(NICategoryLetter niCategory) { this.niCategory = niCategory; } + /** + * The employee's NI categories + * + * @param niCategories List<NICategory> + * @return Employment + */ + public Employment niCategories(List niCategories) { + this.niCategories = niCategories; + return this; + } + + /** + * The employee's NI categories + * + * @param niCategoriesItem NICategory + * @return Employment + */ + public Employment addNiCategoriesItem(NICategory niCategoriesItem) { + if (this.niCategories == null) { + this.niCategories = new ArrayList(); + } + this.niCategories.add(niCategoriesItem); + return this; + } + + /** + * The employee's NI categories + * + * @return niCategories + */ + @ApiModelProperty(value = "The employee's NI categories") + /** + * The employee's NI categories + * + * @return niCategories List + */ + public List getNiCategories() { + return niCategories; + } + + /** + * The employee's NI categories + * + * @param niCategories List<NICategory> + */ + public void setNiCategories(List niCategories) { + this.niCategories = niCategories; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,12 +239,13 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.payrollCalendarID, employment.payrollCalendarID) && Objects.equals(this.startDate, employment.startDate) && Objects.equals(this.employeeNumber, employment.employeeNumber) - && Objects.equals(this.niCategory, employment.niCategory); + && Objects.equals(this.niCategory, employment.niCategory) + && Objects.equals(this.niCategories, employment.niCategories); } @Override public int hashCode() { - return Objects.hash(payrollCalendarID, startDate, employeeNumber, niCategory); + return Objects.hash(payrollCalendarID, startDate, employeeNumber, niCategory, niCategories); } @Override @@ -285,6 +256,7 @@ public String toString() { sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" employeeNumber: ").append(toIndentedString(employeeNumber)).append("\n"); sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n"); + sb.append(" niCategories: ").append(toIndentedString(niCategories)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/xero/models/payrolluk/NICategory.java b/src/main/java/com/xero/models/payrolluk/NICategory.java new file mode 100644 index 00000000..918cbc65 --- /dev/null +++ b/src/main/java/com/xero/models/payrolluk/NICategory.java @@ -0,0 +1,264 @@ +/* + * Xero Payroll UK + * This is the Xero Payroll API for orgs in the UK region. + * + * Contact: api@xero.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.xero.models.payrolluk; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.Objects; +import org.threeten.bp.LocalDate; + +/** NICategory */ +public class NICategory { + StringUtil util = new StringUtil(); + + @JsonProperty("startDate") + private LocalDate startDate; + + @JsonProperty("niCategory") + private NICategoryLetter niCategory; + + @JsonProperty("niCategoryID") + private BigDecimal niCategoryID; + + @JsonProperty("dateFirstEmployedAsCivilian") + private LocalDate dateFirstEmployedAsCivilian; + + @JsonProperty("workplacePostcode") + private String workplacePostcode; + /** + * The start date of the NI category (YYYY-MM-DD) + * + * @param startDate LocalDate + * @return NICategory + */ + public NICategory startDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the NI category (YYYY-MM-DD) + * + * @return startDate + */ + @ApiModelProperty( + example = "Mon Dec 02 00:00:00 UTC 2024", + value = "The start date of the NI category (YYYY-MM-DD)") + /** + * The start date of the NI category (YYYY-MM-DD) + * + * @return startDate LocalDate + */ + public LocalDate getStartDate() { + return startDate; + } + + /** + * The start date of the NI category (YYYY-MM-DD) + * + * @param startDate LocalDate + */ + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + /** + * niCategory + * + * @param niCategory NICategoryLetter + * @return NICategory + */ + public NICategory niCategory(NICategoryLetter niCategory) { + this.niCategory = niCategory; + return this; + } + + /** + * Get niCategory + * + * @return niCategory + */ + @ApiModelProperty(required = true, value = "") + /** + * niCategory + * + * @return niCategory NICategoryLetter + */ + public NICategoryLetter getNiCategory() { + return niCategory; + } + + /** + * niCategory + * + * @param niCategory NICategoryLetter + */ + public void setNiCategory(NICategoryLetter niCategory) { + this.niCategory = niCategory; + } + + /** + * Xero unique identifier for the NI category + * + * @param niCategoryID BigDecimal + * @return NICategory + */ + public NICategory niCategoryID(BigDecimal niCategoryID) { + this.niCategoryID = niCategoryID; + return this; + } + + /** + * Xero unique identifier for the NI category + * + * @return niCategoryID + */ + @ApiModelProperty(example = "15", value = "Xero unique identifier for the NI category") + /** + * Xero unique identifier for the NI category + * + * @return niCategoryID BigDecimal + */ + public BigDecimal getNiCategoryID() { + return niCategoryID; + } + + /** + * Xero unique identifier for the NI category + * + * @param niCategoryID BigDecimal + */ + public void setNiCategoryID(BigDecimal niCategoryID) { + this.niCategoryID = niCategoryID; + } + + /** + * The date in which the employee was first employed as a civilian (YYYY-MM-DD) + * + * @param dateFirstEmployedAsCivilian LocalDate + * @return NICategory + */ + public NICategory dateFirstEmployedAsCivilian(LocalDate dateFirstEmployedAsCivilian) { + this.dateFirstEmployedAsCivilian = dateFirstEmployedAsCivilian; + return this; + } + + /** + * The date in which the employee was first employed as a civilian (YYYY-MM-DD) + * + * @return dateFirstEmployedAsCivilian + */ + @ApiModelProperty( + example = "Mon Dec 02 00:00:00 UTC 2024", + value = "The date in which the employee was first employed as a civilian (YYYY-MM-DD)") + /** + * The date in which the employee was first employed as a civilian (YYYY-MM-DD) + * + * @return dateFirstEmployedAsCivilian LocalDate + */ + public LocalDate getDateFirstEmployedAsCivilian() { + return dateFirstEmployedAsCivilian; + } + + /** + * The date in which the employee was first employed as a civilian (YYYY-MM-DD) + * + * @param dateFirstEmployedAsCivilian LocalDate + */ + public void setDateFirstEmployedAsCivilian(LocalDate dateFirstEmployedAsCivilian) { + this.dateFirstEmployedAsCivilian = dateFirstEmployedAsCivilian; + } + + /** + * The workplace postcode + * + * @param workplacePostcode String + * @return NICategory + */ + public NICategory workplacePostcode(String workplacePostcode) { + this.workplacePostcode = workplacePostcode; + return this; + } + + /** + * The workplace postcode + * + * @return workplacePostcode + */ + @ApiModelProperty(example = "SW1A 1AA", required = true, value = "The workplace postcode") + /** + * The workplace postcode + * + * @return workplacePostcode String + */ + public String getWorkplacePostcode() { + return workplacePostcode; + } + + /** + * The workplace postcode + * + * @param workplacePostcode String + */ + public void setWorkplacePostcode(String workplacePostcode) { + this.workplacePostcode = workplacePostcode; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NICategory niCategory = (NICategory) o; + return Objects.equals(this.startDate, niCategory.startDate) + && Objects.equals(this.niCategory, niCategory.niCategory) + && Objects.equals(this.niCategoryID, niCategory.niCategoryID) + && Objects.equals(this.dateFirstEmployedAsCivilian, niCategory.dateFirstEmployedAsCivilian) + && Objects.equals(this.workplacePostcode, niCategory.workplacePostcode); + } + + @Override + public int hashCode() { + return Objects.hash( + startDate, niCategory, niCategoryID, dateFirstEmployedAsCivilian, workplacePostcode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NICategory {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n"); + sb.append(" niCategoryID: ").append(toIndentedString(niCategoryID)).append("\n"); + sb.append(" dateFirstEmployedAsCivilian: ") + .append(toIndentedString(dateFirstEmployedAsCivilian)) + .append("\n"); + sb.append(" workplacePostcode: ").append(toIndentedString(workplacePostcode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/xero/models/payrolluk/NICategoryLetter.java b/src/main/java/com/xero/models/payrolluk/NICategoryLetter.java new file mode 100644 index 00000000..7b7e213e --- /dev/null +++ b/src/main/java/com/xero/models/payrolluk/NICategoryLetter.java @@ -0,0 +1,108 @@ +/* + * Xero Payroll UK + * This is the Xero Payroll API for orgs in the UK region. + * + * Contact: api@xero.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.xero.models.payrolluk; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The employee's NI Category letter. */ +public enum NICategoryLetter { + + /** A */ + A("A"), + + /** B */ + B("B"), + + /** C */ + C("C"), + + /** F */ + F("F"), + + /** H */ + H("H"), + + /** I */ + I("I"), + + /** J */ + J("J"), + + /** L */ + L("L"), + + /** M */ + M("M"), + + /** S */ + S("S"), + + /** V */ + V("V"), + + /** X */ + X("X"), + + /** Z */ + Z("Z"), + + /** D */ + D("D"), + + /** E */ + E("E"), + + /** K */ + K("K"), + + /** N */ + N("N"); + + private String value; + + NICategoryLetter(String value) { + this.value = value; + } + + /** @return String value */ + @JsonValue + public String getValue() { + return value; + } + + /** + * toString + * + * @return String value + */ + @Override + public String toString() { + return String.valueOf(value); + } + + /** + * fromValue + * + * @param value String + */ + @JsonCreator + public static NICategoryLetter fromValue(String value) { + for (NICategoryLetter b : NICategoryLetter.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/xero/models/payrolluk/NICategoryOneOf.java b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf.java new file mode 100644 index 00000000..699207a9 --- /dev/null +++ b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf.java @@ -0,0 +1,164 @@ +/* + * Xero Payroll UK + * This is the Xero Payroll API for orgs in the UK region. + * + * Contact: api@xero.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.xero.models.payrolluk; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** NICategoryOneOf */ +public class NICategoryOneOf { + StringUtil util = new StringUtil(); + /** Gets or Sets niCategory */ + public enum NiCategoryEnum { + /** F */ + F("F"), + + /** I */ + I("I"), + + /** L */ + L("L"), + + /** S */ + S("S"), + + /** N */ + N("N"), + + /** E */ + E("E"), + + /** D */ + D("D"), + + /** K */ + K("K"); + + private String value; + + NiCategoryEnum(String value) { + this.value = value; + } + + /** + * getValue + * + * @return String value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * toString + * + * @return String value + */ + @Override + public String toString() { + return String.valueOf(value); + } + + /** + * fromValue + * + * @param value String + */ + @JsonCreator + public static NiCategoryEnum fromValue(String value) { + for (NiCategoryEnum b : NiCategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("niCategory") + private NiCategoryEnum niCategory; + /** + * niCategory + * + * @param niCategory NiCategoryEnum + * @return NICategoryOneOf + */ + public NICategoryOneOf niCategory(NiCategoryEnum niCategory) { + this.niCategory = niCategory; + return this; + } + + /** + * Get niCategory + * + * @return niCategory + */ + @ApiModelProperty(value = "") + /** + * niCategory + * + * @return niCategory NiCategoryEnum + */ + public NiCategoryEnum getNiCategory() { + return niCategory; + } + + /** + * niCategory + * + * @param niCategory NiCategoryEnum + */ + public void setNiCategory(NiCategoryEnum niCategory) { + this.niCategory = niCategory; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NICategoryOneOf niCategoryOneOf = (NICategoryOneOf) o; + return Objects.equals(this.niCategory, niCategoryOneOf.niCategory); + } + + @Override + public int hashCode() { + return Objects.hash(niCategory); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NICategoryOneOf {\n"); + sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/xero/models/payrolluk/NICategoryOneOf1.java b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf1.java new file mode 100644 index 00000000..2336f6cf --- /dev/null +++ b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf1.java @@ -0,0 +1,143 @@ +/* + * Xero Payroll UK + * This is the Xero Payroll API for orgs in the UK region. + * + * Contact: api@xero.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.xero.models.payrolluk; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** NICategoryOneOf1 */ +public class NICategoryOneOf1 { + StringUtil util = new StringUtil(); + /** Gets or Sets niCategory */ + public enum NiCategoryEnum { + /** V */ + V("V"); + + private String value; + + NiCategoryEnum(String value) { + this.value = value; + } + + /** + * getValue + * + * @return String value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * toString + * + * @return String value + */ + @Override + public String toString() { + return String.valueOf(value); + } + + /** + * fromValue + * + * @param value String + */ + @JsonCreator + public static NiCategoryEnum fromValue(String value) { + for (NiCategoryEnum b : NiCategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("niCategory") + private NiCategoryEnum niCategory; + /** + * niCategory + * + * @param niCategory NiCategoryEnum + * @return NICategoryOneOf1 + */ + public NICategoryOneOf1 niCategory(NiCategoryEnum niCategory) { + this.niCategory = niCategory; + return this; + } + + /** + * Get niCategory + * + * @return niCategory + */ + @ApiModelProperty(value = "") + /** + * niCategory + * + * @return niCategory NiCategoryEnum + */ + public NiCategoryEnum getNiCategory() { + return niCategory; + } + + /** + * niCategory + * + * @param niCategory NiCategoryEnum + */ + public void setNiCategory(NiCategoryEnum niCategory) { + this.niCategory = niCategory; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NICategoryOneOf1 niCategoryOneOf1 = (NICategoryOneOf1) o; + return Objects.equals(this.niCategory, niCategoryOneOf1.niCategory); + } + + @Override + public int hashCode() { + return Objects.hash(niCategory); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NICategoryOneOf1 {\n"); + sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/java/com/xero/api/client/PayrollUkApiEmploymentTest.java b/src/test/java/com/xero/api/client/PayrollUkApiEmploymentTest.java index b10a2757..3465569e 100644 --- a/src/test/java/com/xero/api/client/PayrollUkApiEmploymentTest.java +++ b/src/test/java/com/xero/api/client/PayrollUkApiEmploymentTest.java @@ -77,7 +77,7 @@ public void createEmploymentTest() throws IOException { assertThat(response.getEmployment().getPayrollCalendarID(), is(equalTo(UUID.fromString("216d80e6-af55-47b1-b718-9457c3f5d2fe")))); assertThat(response.getEmployment().getStartDate(), is(equalTo(LocalDate.of(2020, 04, 01)))); assertThat(response.getEmployment().getEmployeeNumber(), is(equalTo("123ABC"))); - assertThat(response.getEmployment().getNiCategory(), is(equalTo(com.xero.models.payrolluk.Employment.NiCategoryEnum.A))); + assertThat(response.getEmployment().getNiCategory(), is(equalTo(com.xero.models.payrolluk.NICategoryLetter.A))); //System.out.println(response.toString()); } }